1 decade ago by doobdargent
Hey,
while building my current game (a tower defense) I had to build a path-finding solution.
At first I used the A* plug-in available but it is not efficient in my case. It calculate a path for every entities while I need only 1 path for all my entities.
The flood fill path-finding consist of storing in each tiles, the distance to the exit. The monsters check the tiles neighbors and go to the one with the lowest distance value.
It's way more efficient but it concerns only games where all entities are going to the same destination.
It doesn't support diagonals.
Demo: http://doobdargent.com/alpha/distanceMap/
Sources: https://github.com/doobinay/Impact-DistanceMap/
while building my current game (a tower defense) I had to build a path-finding solution.
At first I used the A* plug-in available but it is not efficient in my case. It calculate a path for every entities while I need only 1 path for all my entities.
The flood fill path-finding consist of storing in each tiles, the distance to the exit. The monsters check the tiles neighbors and go to the one with the lowest distance value.
It's way more efficient but it concerns only games where all entities are going to the same destination.
It doesn't support diagonals.
Demo: http://doobdargent.com/alpha/distanceMap/
Sources: https://github.com/doobinay/Impact-DistanceMap/