Any tips on getting EQS to more accurately find a safe attack position?

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.

I’m doing the following.

  1. Score points based off inverse distance to the Querier with a factor of 2
  2. Score points based off distance to the Context with a factor of 1
  3. Filter by line of sight line trace

The EQS itself is pretty simple.

Graph
image
Test 1


Test 2

Test 3

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%.

They’re all too close to the querier. I want it to pick something kind of in the middle further away. So more like the below.

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.

The query is as follows.

image

Distance check.

Querier path length check.

Context path length check.

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.

This works well enough for me, but will likely require more adjustments in the future.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.