TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Bugs that have been investigated and resolved somehow.

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.
User avatar
Jekyll Grim Payne
 
 
Posts: 939
Joined: Mon Jul 21, 2008 4:08 am
Graphics Processor: nVidia (Modern GZDoom)

TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Post by Jekyll Grim Payne »

TRF_THRUACTORS LineTrace() flag doesn't fully work: the trace is still blocked by actors with the SHOOTABLE flag. Observing this currently on 4.8.0 and today's 4.9pre build.

Attaching a demo on Google drive since attachment quota has apparently been reached: https://drive.google.com/file/d/1BVenFd ... sp=sharing

STR:
1. Start GZDoom with LineTraceBug.pk3
2. Give yourself TraceFromFace item (give TraceFromFace)
3. Spawn a shootable actor (I used a zombieman).
3. Move your view around and observe the movements of the visual identifier, as well as the console log that prints the distance of the trace. Try aiming at the shootable actor.

Expected behavior: the linetrace should ignore all actors and be only blocked by geometry.

Result: shootable actors block the linetrace.
User avatar
Marisa the Magician
 
 
Posts: 3843
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Post by Marisa the Magician »

It's not being blocked by the actor, it's returning the actor hit because it's the last thing the trace skipped over (note that the hit type will be TRACE_HitNone, not TRACE_HitActor).

The actual bug here is that there isn't a special case check in TraceTraverse() for everything being skipped, only for nothing ever getting crossed (distance equals zero). This could be easily fixed, I think.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48326
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Post by Graf Zahl »

I wouldn't even call that a bug - if TRACE_HitNone is returned, all the values containing a potential result are undefined and should not be checked.
User avatar
Jekyll Grim Payne
 
 
Posts: 939
Joined: Mon Jul 21, 2008 4:08 am
Graphics Processor: nVidia (Modern GZDoom)

Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Post by Jekyll Grim Payne »

I would call it a clear oversight.

For one, it causes inconsistent behavior, which is imo not great. When set to go through actors, the trace will return different things when:

1. it hits nothing at all (it extends all the way over the specified distance)
2. it hits an actor and there's nothing behind the actor (it extends only up to the actor)
3. it hits an actor but there's a plane/wall behind them within the specified distance (it extends all the way up to the plane/wall)

That just makes very little sense to me.

If this can be changed easily, I don't see why it shouldn't be done. Being able to just get a vector towards a geometry ignoring all actors seems like a perfectly valid need to me.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48326
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Post by Graf Zahl »

Again: If the trace returns TRACE_NONE, you are not supposed to check which actor or wall has been hit, the value in there is meaningless. Sure this can be changed, but if you do not check the type of hit before the actual object you are using this function wrong to begin with.
User avatar
Marisa the Magician
 
 
Posts: 3843
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors

Post by Marisa the Magician »

Addressed in this PR. The final position and distance should remain consistent whether the trace traversed nothing vs skipped everything it encountered.

Return to “Closed Bugs [GZDoom]”