Aubergines Pathfinding solution

Hello,

Here is a prototype of my pathfinding solution, currently very WIP and at early stages but still very fast for considering it uses Dijkstras algorthym and physics.capsule checks for obstacle avoidance.

4 enemies finding a path to player takes only 1msc and doesnt have much impact to cpu.

Attached you can find the project, any contribution or help to improve is very much appreciated.

Note: Just load the test scene and press play, arrow keys move the player around and if you press space key, enemies find their paths.

Regards,

572866–20409–$Astar.rar (73.9 KB)

Not currently on a computer that has Unity so I can’t see it yet; any chance of a webplayer?

How does it work? Navmeshs? Waypoints? Raycasting?

It works on waypoints, not suitable for all kind of games. Mostly FPS and puzzle games.

Good thing is, you can group different waypoints under different zones. Sort of lod.

Just tried it out and skimmed through the code. Looks decently sound. If I didn’t misunderstand, you’re getting a node’s neighbors and checking the distance to the target node for each ? Wouldn’t that get somewhat heavy with a couple more seekers ?

While on a long train ride, I wrote a simple waypoint system [similar to this] but I ended up dropping it because of neighbor - target distance checks and how they bog down a handheld CPU with only a handful of seekers.

Looking forward to any updates.

As i mentioned, Dijkstra checks all possibilities and its not suitable for large outdoor scenes with so many waypoints and so many actors using it.
About your concern for distance checks, i use floats there but you can make it simpler with integers and use Vector2 instead of vector3.
Its enough for my needs, but if you are still concerned, you might want to simplfy the physics checks as well with raycast…etc.

The way i use it checks if target node is visible and if so, breaks the pathfinding routine. So if i place my waypoints carefully, i get no trouble.
Still, i just checked with 20 followers in the same test scene and cant see a visible frame drop.

Oh and by the way, in the awake function the neighbours are saved in a lookup list and if you noticed there is a neighbour check range which does keep the neighbour lists small in size.
And the distance check only occurs in these tiny lists of maximum 4-5 nodes.