DooM Bear Posted January 4, 2021 Was just watching the latest Decino video and had a random thought :-P Do projectiles like revernant missiles, imp and caco fire balls, etc. have infinite height in the original Dos DooM and if so, how does that work? For instance, I swear that I have had projectiles fly over my head hundreds of times before but maybe I’m mistaken they were actually just off centre and thus didn’t hit me? If they do not have infinite height though, how does that work? I’ve always seen the hit miss thing described as the “projectile is in this 2D square, will it hit something in the next 2D square next tic - Y/N? If yes, deal damage” (watched a really awesome video by Coincident recently explaining the Blockmap bug using this description). Going off my understandingly this, all projectiles should have infinite height right? Sorry if this is a dumb question! 1 Quote Share this post Link to post
Edward850 Posted January 5, 2021 (edited) 26 minutes ago, DooM Bear said: Do projectiles like revernant missiles, imp and caco fire balls, etc. have infinite height in the original Dos DooM and if so, how does that work? Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo All things in Doom have height. This absolutely includes projectiles. They will pass over/under other solid actors like the player and enemies, this is easily observable at any time in gameplay. This also applies to hitscans, which will test the height of an actor based on their slope, which is a little harder to observe due to auto aim but can be if you put yourself in a situation where autoaim fails, such as an enemy being directly below you while on a ledge. As well as being observable without the source code, you can also review the relevant parts of the code here for the projectile in PIT_CheckThing (the iterative function used to check collisions between actors): https://github.com/chocolate-doom/chocolate-doom/blob/7a0db31614ec187e363e7664036d95ec56242e44/src/doom/p_map.c#L314 And here in PTR_ShootTraverse for hitscan collisions: https://github.com/chocolate-doom/chocolate-doom/blob/7a0db31614ec187e363e7664036d95ec56242e44/src/doom/p_map.c#L1027-L1037 The Coincident video doesn't explain the full characteristics of actor collision, probably because it's only really describing the blockmap (which is can be interpreted as 2D, though not relevant in the scheme of things as it's simply an array of blocks in which to sort relevant collisions), all actors have height and while the cross section is tested first initially, height is then tested after for confirming the collision or skipping it. Edited January 5, 2021 by Edward850 5 Quote Share this post Link to post
Doomkid Posted January 5, 2021 (edited) Nah, and actually nothing in Doom technically has "infinite height". That term is a bit of a misnomer! Quote Doom uses 3D game logic. The only thing “2D” about Doom are the sprites and map blueprints, the world is very much 3D. Actors aren’t actually infinitely tall, even in vanilla Doom. Explained here: https://doomwiki.org/wiki/Z-clipping but even that wiki page isn’t telling the full story, as it says Z heights only matter for projectiles, hitscans, and allowing solid objects to pass into a sector if the heights allow it. In reality, getting the player to “touch” and thus collect weapons, items and power-ups is also completely dependent on this behaviour. If you walk 100 units above an item you won’t pick it up, because actors are only infinitely tall in the case of two actors with the “solid” flag set attempting to enter the same X/Y coordinates. I have a video that briefly goes into it here (around the 6:55 mark). You can actually see the 3D bounding boxes that all objects have, which are responsible for collision detection: Edited January 5, 2021 by Doomkid 4 Quote Share this post Link to post
Murdoch Posted January 5, 2021 (edited) As others have said, they must definitely can and do go over your head. The myth of Doom's game environment not being true 3D stems largely from two things - the lack of room over room, and an oversight in the collision detection code. Not sure if it was done on purpose or whether it can fairly be called a bug. Actors cannot pass under and over each other. The movement code for them is different to the projectile code I believe, if my 20 years out of date recollection of the source code is accurate. The height check is in the projectile movement code, the item pickup code, probably others too - but not the actor movement code. Edit: nor in the attack code, hence the fun of getting scratched by an Imp 50 feet below you. Edited January 5, 2021 by Murdoch 3 Quote Share this post Link to post
Cruduxy Pegg Posted January 5, 2021 Go to map 3 and shoot rockets through any window, nothing gets hit even with an army of imps below it. 3 Quote Share this post Link to post
Gez Posted January 5, 2021 Projectiles are the only actors that get 3D collision checks with other actors. That PIT_CheckThing code shows this quite clearly: it starts with a collision check on X and Y axes only, has a safeguard against an actor colliding with itself, then handles charging lost soul collisions, and then we have the "if (projectile)" section that checks the Z axis, a check that is not done for non-missile actors. 2 Quote Share this post Link to post
BMWAG65321 Posted January 5, 2021 Off the top of my head, there are only three things in Doom that have infinite height: non-item things [players, demons, and I think decorations with collision], demon melee attacks, and explosions. Some examples: If you try to run over a chasm with a monster far at the bottom and in your path, you'll hit it and fall. You're in a cramped arena with cacos, pains, and lost souls, no matter how high up they may appear, you can't run under them. Monsters at the top of lifts/tall platforms can still punch/scratch you. The part I usually forget is that cacos can bite you from far up, and lost souls can still hit you far above your head. If a side of a pit is a wall, you can shoot rockets at that wall to hurt any demons close to that wall, no matter the height difference. 3 Quote Share this post Link to post
Doomkid Posted January 5, 2021 8 hours ago, Gez said: Projectiles are the only actors that get 3D collision checks with other actors. That PIT_CheckThing code shows this quite clearly: it starts with a collision check on X and Y axes only, has a safeguard against an actor colliding with itself, then handles charging lost soul collisions, and then we have the "if (projectile)" section that checks the Z axis, a check that is not done for non-missile actors. How then are items also making this check? If doomguy runs over a hole with an item or weapon in it, he won’t collect the item since he’s above it on the Z axis. Being on the right X and Y coordinates aren’t enough. Surely has to be some sort of 3D collision check happening here as well, despite no projectiles being involved, or else he could collect items below him. 2 Quote Share this post Link to post
QuotePilgrim Posted January 5, 2021 (edited) 20 hours ago, Murdoch said: The myth of Doom's game environment not being true 3D Whether it's a myth is largely dependent on what your definition of "true 3D" is. Doom uses the z axis for some things, but completely ignores it for others. It could be argued that it has two fully fledged dimensions and one incomplete one. Doom is 3D, but it is, in a sense, less 3D than most games you would call 3D. If that really means is not "true 3D" is subjective. I mean, if we are going to be really pedantic about this, no game really is "true" 3D. Edited January 5, 2021 by QuotePilgrim 2 Quote Share this post Link to post
boris Posted January 5, 2021 24 minutes ago, Doomkid said: How then are items also making this check? If doomguy runs over a hole with an item or weapon in it, he won’t collect the item since he’s above it on the Z axis. Being on the right X and Y coordinates aren’t enough. Surely has to be some sort of 3D collision check happening here as well, despite no projectiles being involved, or else he could collect items below him. PIT_CheckThing calls a function named P_TouchSpecialThing for pickups. P_TouchSpecialThing then checks if the z positions are ok: delta = special->z - toucher->z; if (delta > toucher->height || delta < -8*FRACUNIT) { // out of reach return; } 3 Quote Share this post Link to post
Doomkid Posted January 5, 2021 That makes perfect sense. So with that I guess it’s fair to say projectiles are not the only actors making a 3D height check, pickups are also making a similar check. 1 Quote Share this post Link to post
xX_Lol6_Xx Posted January 5, 2021 21 hours ago, Doomkid said: Nah, and actually nothing in Doom technically has "infinite height". That term is a bit of a misnomer! I have a video that briefly goes into it here (around the 6:55 mark). You can actually see the 3D bounding boxes that all objects have, which are responsible for collision detection: So Doomshack is yours! I always wondered who was the admin. Seriously, when I start up IDE, those are the first servers that appear 2 Quote Share this post Link to post
Murdoch Posted January 5, 2021 2 hours ago, QuotePilgrim said: Whether it's a myth is largely dependent on what your definition of "true 3D" is. Doom uses the z axis for some things, but completely ignores it for others. It could be argued that it has two fully fledged dimensions and one incomplete one. Doom is 3D, but it is, in a sense, less 3D than most games you would call 3D. If that really means is not "true 3D" is subjective. I mean, if we are going to be really pedantic about this, no game really is "true" 3D. Yes you are correct. It is one of those technicalities you could argue about until you are blue in the face. 3 Quote Share this post Link to post
DooM Bear Posted January 6, 2021 (edited) Thanks for all the replies all :-) That makes sense :-) I’d always heard doom being called 2.5D but never really understood what that meant :-P Any ideas as to why ID didn’t add heights to everything else (I.e. jumping over enemies, room over room and most importantly walking under caco’s :-P)? Is it likely just that computers of the time would have struggled with the extra calculations or maybe just a matter of requiring too much extra development time (seems that it shouldn’t be too hard to add height to everything if you have it for one thing but I’m not a coder so could be wrong)? 8 hours ago, Doomkid said: How then are items also making this check? If doomguy runs over a hole with an item or weapon in it, he won’t collect the item since he’s above it on the Z axis. Being on the right X and Y coordinates aren’t enough. Surely has to be some sort of 3D collision check happening here as well, despite no projectiles being involved, or else he could collect items below him. I had wondered about this due to the old lost soul smashing its head into an item 20 meters below it :-P Wasn’t sure if it was the item that was infinitely tall or the lost soul... or both :-P Edited January 6, 2021 by DooM Bear 1 Quote Share this post Link to post
Edward850 Posted January 6, 2021 1 minute ago, DooM Bear said: Any ideas as to why ID didn’t add heights to everything else (I.e. jumping over enemies, room over room and most importantly walking under caco’s :-P)? Is it likely just that computers of the time would have struggled with the extra calculations or maybe just a matter of requiring too much extra development time (seems that it shouldn’t be too hard to add height to everything if you have it for one thing but I’m not a coder so could be wrong)? Just time if anything. Hexen, Heretic and Strife all have it and they mostly simple checks, however it does require handling many cases if objects move vertically under/over other objects, such as if it was because the map moved them or otherwise. When what you have already seems to be working fine, no sense trying to disrupt it so late. 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.