In our case we had an enemy that wanted to find a place out of visibility from the player. It would end up running straight backwards some distance because the line trace from that spot to the player - AT THE TIME OF THE EQS QUERY- intersected the AI itself blocking visibility.
I don’t see an existing mechanism for adding “self”(query owner) to the ignoredactors list so I intend to add one via a UPROPERTY bool on the trace but I wanted to ask if there was some mechanism I didn’t know of or some reason this wasn’t done.
Thanks.
Steps to Reproduce
Do an EQS line trace query where the querier is on a straight line between the potential EQS point and the object of the trace, and(assuming collision flags allow) you can block your own trace.
Hi there,
From my understanding, adding additional tests to your generator to eliminate the enemy actor from your trace should work. But setting up your own system for filtering what sort of actors are involved in the trace the actors should be appropriate.
Is there anything specific you are doing that would make using the generator tests non-viable?
- Louis
You should be able to use the Trace test but change from using Trace by Channel to Trace by Profile. You can then add a collision preset in Project Settings->Collision or use one already made to ignore pawns. The Trace Profile Name in the EQS editor for the Trace test should match the name of the preset you wish to use. I believe this should work to only trace level geometry and not interact with any Pawns on the map that may provide a spot that breaks line of sight. Or do you need this to very specifically only ignore the player and not other Pawns.
You are correct that we do not have a way on the current test to ignore a list of actors outside of the context actors used. If you need a separate list of ignored actors, you could create a custom class from UEnvQueryTest_Trace and supply that list of actors to the collision query params. This would allow a flexible list of actors per query rather than always ignoring all Pawns. Once again, it is all dependent on what your game needs.
-James
I will pass this feedback to the team. It might be quite some inertia to change as it has been in the engine for a while and we do not like to change default behaviors. I see the ability to add actors to the ignore list. Your issue is a textbook example of why that is useful on a provided test.
-James
The Epic provided EnvQueryTest_Trace doesn’t return multiple actors, it traces to the desired item, and if that item is an actor, ignores that item. And then returns true/false. There’s no opportunity to ignore the actor as a trace result at this point.
If I want to trace from a test location to the player’s position, it will ignore the player. This is typically correct.
But if I want to trace from a test location to a player’s ally’s position, it will not ignore the player. This is also typically correct - the player could block my line of sight on the player’s ally.
The ignored actors are the context for the trace locations - so if I’m not tracing to an actor, it won’t ignore it. Since I’m not trying to trace to myself(usually) I’m not on the ignore list.
In this case an AI is trying to test line of sight to the player for firing - so other pawns should break line of sight but the player obviously should not.
I understand why ignoring random other actors (not in context) would merit a new env query (i.e. subclass of UEnvQueryTest_Trace) but it feels like having an EQS query for a pawn effectively pretend that the pawn was at the position being tested should be more supported use case.
In our case we just went and made an engine modification to our local code base to allow the trace(based on a UPROPERTY bool) to add the owner of the query to the ignore list.