Workshop Function Request: Pathfinding

The workshop’s been fun and all, but implementing custom pathfinding has proven to have its own share of problems. I remembered that Overwatch’s AI have their own pathfinding system, but there’s currently no way to get access to that pathfinding without having an AI present, and if you want to make a dummy bot who isn’t already available as AI use that pathfinding, you’d need two bots to do the job of one. Plus, if you’re in a mode like Elimination or Deathmatch, you can’t rely on those bots at all.

So, I’d like to request a pathfinder function. None of the AI currently use any advanced movement abilities, but the pathfinder could still be designed as such that it attempts to find a path that allows a character on that path to use their movement abilities, so long as the workshop rules allow bots to use these abilities.

Path to Position
Inputs: Starting position, ending position, altitude increase, altitude decrease, gap length
Returns an array of positions. This array begins with the starting position, and ends with the ending position. The positions between the start and end can be used with movement/throttle functions to bring a character along the path. If at any point the path cannot be traversed with the values provided, the array is prematurely ended.

The altitude increase and altitude decrease inputs would allow scripters to control how the pathfinder handles severe drops, walls, etc. If the altitude between two positions changes more than is allowed by these inputs, the pathfinder should either find another way or stop pathfinding altogether. Similarly, the gap length input allows the pathfinder to go above gaps which are short enough, and if a gap’s length exceeds the allowed value, the pathfinder walks around it or stops.

Naturally, it’ll be necessary to add rules to ensure that bots can climb walls, go above gaps, and so on, but these can be handled on a per-hero basis by scripters.

Here’s how this function might be used to handle movement as Genji.

First, the Genji dummy bot would have a player variable, CurrentPath, which is the result spit out by Path to Position. Gap Length, Altitude Increase, and Altitude Decrease would be set as such that the pathfinder would be willing to go across walls.

Assuming the pathfinder ended up working as described here, the CurrentPath array would neatly connect Point A to Point B, even if they’re on opposite sides of a wall.

Once the Genji bot has reached any point in the CurrentPath array, if they don’t have line of sight to the next point, they would start holding Jump. This should be sufficient to climb over any potential obstructions in most cases, but, if Genji takes too long to reach the next position in the array, a rule could be set up so that the bot would then seek a new, “safer” path, refusing to climb walls at all if the scripter so chooses.

6 Likes

I totally agree with you.

Its funny that you request this now, because Im currently working on a pathfinding algorithm and after the final testing, I think I will release it as a resource in the next days.
As long as the devs dont add a built-in pathfinding, I hope you will find my upcoming solution useful.

check out my bots for control modes: Custom Legendary Bots [RELEASE]

Yeah, I saw that a bit before making this thread, and I was actually really impressed with it. I’d enjoy having a solution that doesn’t require a lot of map-specific setup, though.

Would love this to be implemented :heart_eyes: , dummy bots are so basic right now and I feel like this would make them more advanced like the normal bots.

check out my bots for control modes: Custom Legendary Bots [RELEASE] xd just saying