I have a weapon that uses distance checks (A_JumpIfCloser) to see if the player is within melee range of an actor. It appears to work fine when attacking the front side of the actor, but when attacking from the bottom or the top side, it does not trigger properly, and melee attacks don't work fully either (The attack still occurs but no sound is played and the player's view isn't adjusted as would normally be).
The weapon that's not functioning correctly is attached below.
EDIT: Now here's a strange fact that I noticed: if you hit the top of an object while looking down at it, it doesn't count as a hit to melee or A_JumpIfCloser, but if you're literally standing on top of the object so that the object is "behind" you and you attack straight down (I'm using GZDoom to test this since it would be impossible due to the constrained freelook), it does count as a hit.
[tr-808] Z-collision and distance checks
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [tr-808] Z-collision and distance checks
Welcome to Doom's 2.5D physics engine... 

Re: [tr-808] Z-collision and distance checks
I know. How difficult would this be to fix exactly?
Re: [tr-808] Z-collision and distance checks
i believe that the doom physics is a big black box that numbers are sent into that spit back other numbers. Its inner workings are just that confusing (iirc) and would have to be re-written from scratch to be done right.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [tr-808] Z-collision and distance checks
That's 100% correct.
For example, yesterday I encountered a minor issue in the sliding code. However, even debugging yielded no usable information what's going wrong. Sometimes I just wonder how this code can work at all.
But this case is simpler: A_JumpIfCloser was missing a z-coordinate check, that's all.
Fixed
The other oddity being mentioned is trickier though and I think I'll just skip it.
For example, yesterday I encountered a minor issue in the sliding code. However, even debugging yielded no usable information what's going wrong. Sometimes I just wonder how this code can work at all.
But this case is simpler: A_JumpIfCloser was missing a z-coordinate check, that's all.
Fixed
The other oddity being mentioned is trickier though and I think I'll just skip it.