Special Advanced Follow AI

Hey,

I am trying to create an AI for my game, however I am not sure how to implement a certain behavior.

Let’s say the AI needs to be following the Character at all time, however there are multiple path that leads to the player, and the AI needs to take the shorted path to the player.
There are 2 items placed in the scene, the first is a teleport device, and it can save the AI some time (or in special cases lose some time) when chasing the player.
The second item is a door that opens and closes, when the door changes states, it will trigger an event for the AI that will cause him to recalculate his path. The AI can open the door, but he will lose some time doing so, and it might be faster for the AI to just take another path instead.

How can the AI do the following?

  • Identify multiple path, even the ones that are discontinued and connected by a teleport device
  • Calculate which path is the fastest to the player, and that implies the time it takes the AI to get to the player not the distance, as there are some object that might slow down or speed up the AI.
  • Do all of that while continuously chasing the player, the AI should not have a discontinued motion.

Any ideas on how to approach this, preferably in blueprint, because I don’t know.

Thank you

Ian … u here?

Just a basic idea: Use a weighting as decision and calculate the weighting from length of path multiplied by the weight of an obstacle/object.
For example an obstacle has a weight of 2 -> you need the double time. A teleport has weight 0.5, you need half the time.

Thank you!