Procedural tower defense optimization - realtime heuristic optimization?

Hello,

I’m working on a tower defense game that has a procedurally generated map that is updated often at runtime. Everything is working well, including graph updates, but I’d like to improve my optimization.

Heuristic optimization seems perfect, since all agents have the same target. However, I’m not sure how best to do heuristic optimization in realtime. I’ve tried enabling and calling euclidean embedding’s RecalculateCosts() directly, which often causes unity to crash.

Should I write my own version of heuristic optimization, or is there an easy way to do this in astar pathfinding project (pro)?

Thanks!

Hi

If they all have the same target then you can instead use Documentation
The heuristic optimization code is not quite as efficient for that use case, and it requires a more expensive pre-processing step.

Oh, I didn’t know about FloodPath, thank you!

1 Like