How to update part of an A* grid
So I have been watching these tutorials how how to use A* for pathfinding but I was wondering to you update just part of the grid because when the player opens a door I don't want to remake the whole grid as that would cause a lot of lag and be very inefficient.
Answer by Thajocoth · Jun 20, 2016 at 04:16 PM
A* on its own doesn't do well with changes to the environment or following a moving destination, but it's a good base to start with.
There's another algorithm called Dynamic A*, or D*, that will adapt more easily to a changing environment by calculating from the end to the start instead of start to end, keeping all the calculation data and using waves of "raise" & "lower". It uses more data in exchange for greater flexibility. D* isn't very good for following a moving destination either though...
I can't completely explain all of how D* works in this text box, but the point is that A* is a starting point from which you can apply a variety of modifications and optimizations to match your game and how it plays.
In a small world, or when calculating over a small area, regular A* without modifications can be the more efficient option too. Sometimes holding on to data to try not to be wasteful winds up taking more CPU cycles than throwing it out & recalculating. It really all depends on a variety of specifics.
Your answer
Follow this Question
Related Questions
Clear path from A to B 4 Answers
Help! Pathfinding 1 Answer
Astar pathfinding check if path can be reached 1 Answer
Pathfinding with branch 0 Answers
Node Based AI,Node Based AI System? 0 Answers