justinhj/astar-algorithm-cpp

How to use two different volume gameobjects to navigate with the same grids?

chenlinyan opened this issue · 1 comments

You would need to take the size of the gameobject into account when writing your GetSuccessors function. There's no easy way to do it, I'd suggest keeping it simple if possible. For example your object can be only square and only 1,2 or 3 grid squares wide. Then when calculating possible movements you can check that the way is clear for the whole object when moving.

More complicated would be to define your objects as 2d convex hulls and then physically simulate the movement inside the grid to see if it is possible.