I’m currently using EQS to find a safe attack location for ranged AI when their line of sight is blocked, but am having a hard time getting it to score correctly. Below are my results.
The issue is some of the points are too close to the wall. So if the player moves even 1 step then my AI has to yet again go into a state of checking for a good position. I tried adjusting this at the trace in test 3 to use a sphere trace, but then if the player is too close to a wall it’ll hit and nullify all points.
I think the best option is to fix this at the distance checks. Is there a way to clamp the distance check so it doesn’t try and pick a point too close to the querier? I tried min/max clamp, but it didn’t seam to help.
The below visualizes this a bit better. I am only using the best result for the location, but the debugger doesn’t have an option for that. So this is the best 5%.
Does anyone have any suggestions? I feel like the distance check is the ideal check for this, but can’t wrap my head around what settings I need to set for it.
The white square is the Context and the selected actor is the Querier in all my above screenshots if that helps understand more as well.
Ok, I think I finally got something that feels acceptable. Finds the furthest point, but takes into account self location as well so it doesn’t just pick something super far or super close.
Finally the line of sight check, which at the moment is a line trace, but a sphere trace might be better to rule out locations too close to a wall. Below is with a sphere trace.