Procedural world with 1000s of units

Hi, I am currently deciding on a pathfinding solution and would like to hear some feedback on wheter this package would actually fit my needs.

The goal, I have a procedural generated, split in Chunks that get generate when the player reaches there.
The gameplay is base defence, where the goal is to defend against massive number of enemies.
I am aware that A* is not the best solution for a ton of units, but the idea is to explore the possibilities on how to achieve this sort of behaviour.

My world current is portioned in 2D Chunks, that keep track of whether they are passable or not in a 2D Grid format.

The idea is that enemies will be randomly generate in radius around the player structures, and move towards specific zones, we are possible talking over 1000 of units moving towards a goal from different directions - something like a zombie horde behaviour.

The world is editable and extremely large (Pseudo open world), also the player can build walls/structures that change the chunk grid underlying possibility state. I could extend my chunk generation system to keep a connectivity network between chunks and possible generate a custom Graph for A*.

The chunks on itself have 50 * 50 units, so fairly small.
Maybe I can get away with pathfinding per chunk, after deciding the general chunk traversal order. Most units wont be moving too fast, so should have time to spread requests over frames.
Units shouldn’t collide between themselves, but local avoidance would be nice.

Any ideas on whether this would be achievable using the package?
In summary my idea was to use some sort of hierarchal pathfinding, first finding the path between the regions, and then actually pathfinding per each chunk.

Another thing I am wondering are there any cached paths , if multiple units request the same path do they get recalculate or do the path gets shared? Since in this scenario, if we go with Region Pathfinding, there will be repeated requests for the same coordinates - Maybe being able to calculate and store common paths is possible solution, since it updates will be very self contained, updating these paths shouldn`t be too bad.

Do you have any suggestions on how to approach something like - maybe I am missing better solution for this?

1 Like