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.
TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors
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.
-
- Global Moderator
- Posts: 1093
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors
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.
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.
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors
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.
-
- Global Moderator
- Posts: 1093
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors
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.
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.
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors
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.
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: TRF_THRUACTORS LineTrace() flag won't ignore SHOOTABLE actors
Addressed in this PR. The final position and distance should remain consistent whether the trace traversed nothing vs skipped everything it encountered.