#Grid pathfinding with ECS?

1 messages · Page 1 of 1 (latest)

quartz sage
#

Trying to think of the best way to layout my entities / data for grid-based pathfinding. Given say a hex grid 1000x1000 with variable traversal weights.

My initial inclination would be to store references to neighbors on each entity and iterate through recursively with whatever algorithm but that doesn't seem great for ECS (based on my very limited knowledge).

Maybe best way would be a giant flattened unmanaged array and get neighbors on the fly? Or maybe managed 2d array in dynamic buffer would be much less painful with minimal performance hit (or better performance?)?

frigid basin
#

Hello @quartz sage , did you come up with anything good ? Did you check code monkey's video . but they are a bit old now ..

quartz sage
#

And catlikecoding has some great hex pathfinding stuff, though unfortunately non-ecs unity