3 ms·
Couldn’t you just do a breadth first flood fill from the player every time the environment changes? Would be O(n) where n is total number of cells, which would
by a13n 2y ago
Couldn’t you just do a breadth first flood fill from the player every time the environment changes? Would be O(n) where n is total number of cells, which would be fast on any hardware or in the browser.
You’d still want to use the directional chart idea.
- poincaredisk 2y agoOr when player moves. But this is also something that came to my mind. They acknowledge this in a footnote: [3] The approach I ended up using is very similar to a Dijkstra map, a pathfinding tool from roguelike games, which I discovered as I was writing this. As far as I could tell, my approach extends a Dijkstra map to handle minimal updates as the target moves and obstacles update