Hey, thanks for the comment.
Good question, I can provide some insight into how an agent would approach each situation.
The way AI travels to a Goal (like a map objective) is the same as a move command. It’s the same as if you right clicked a tribute and just let the game take you there. This is our pathfinding at work and it’s what our agents use for traveling to Goals. While it will get you where you clicked by taking the shortest route, it does not consider other possibilities like flanks or shortcuts. Those types of decisions are simple for human minds to make, but would require a much more sophisticated pathfinding system for AI to replicate.
Once agents get within a certain range of their goal they will then begin using Tactical fight logic (using abilities). Imagine a bubble around each objective where they say “OK, I’m nearby, lets fight!”. All targeted hero abilities require a point to use. The point is found by nodes in the AI tree if the appropriate conditions are met (things like target must be below this % of health, or find the centroid of a group 3 or more of units who are X distance from each other). It’s entirely possible for a Johanna to Falling Sword onto the enemy across terrain, or ETC to slide across walls to stun someone, if the right conditions are met.
“Escaping” really just means that the Goal system has determined that there is another Healing fountain/Healing altar/objective/lane/camp on the map that is more valuable to be at than where we are right now. Because this is determined by the Goal system it will use the pathfinding system, which as I have said earlier is not sophisticated enough to find alternate paths such as sliding across a wall. Now, is it possible to “program” this behavior into the Tactical tree? Yes, it’s possible, but it isn’t straightforward or easy, and can bloat the Tactical tree and make it harder to navigate. It would also undermine our separation between the Goal system (agent movement) and Tactical system (ability usage).
TL;DR - we would need a more sophisticated pathfinding system in order for AI to attempt alternate paths to their Goals.
It’s an interesting idea, I think I’ve seen it suggested before. I can imagine maybe putting in a new ping to direct agents who are following a human to only use their heroic abilities on the pinged target. I’ll add as possible future improvement, thanks!