I’m trying to come up with some AI behavior where they will prefer one path over another. An example would be pedestrians on a sidewalk - they would always prefer walking on the sidewalk if possible. If they can’t reach their destination VIA sidewalk, they should look for a crosswalk. If all else fails, simply cross the street. Another example might be a person on the coast. The preferred path would be to walk on land to the destination but if that is not possible they would swim.
I believe my answer relies on EQS query tests but I can’t seem to figure out what parameters I might use to define this preferred path. I am using an Actors of Class generator to get my destination point and a Distance To test to get the closest one but now I need to restrict the path the AI can take.
A couple images to clarify what I mean.
Scenario 1: A clear path to the destination, walk straight there along the platforms
Scenario 2: An indirect path to the destination, walk along the platforms
Scenario 3: No path to the destination, cross the gap in the platforms
I was able to accomplish the above by having two actors. One as the path the person should walk on and one to cover the areas the person should try to avoid. I added a NavModifier to each, the preferred platform having a cost of 1 and the avoid area having a cost of 2. This worked well.
HOWEVER, I now need an AI that will behave the opposite way. If we go back to the sidewalk example, I need to now handle the cars. So a car will prefer the road instead of the sidewalk. I feel like this flat cost will not work well for me. I’m unsure how to approach this problem.
Edit: After lots of googling, finally stumbled on the correct wording for the issue I was having and it led me to this video from Rama (of course!) about navigation filters: Rama's AI Nav Modifier Example, Move To With Filter - YouTube