A star: need a solution

Started by
1 comment, last by polyfrag 8 years, 10 months ago

Let's say a green person is located approximately (but not exactly) in cell (3,3) and wants to get to cell (3,2). A-star thinks that he's in cell (3,3) and decides that he can move up straight. But when he tries to follow this path, he collides with a green person.

Advertisement

- Snap positions used for collision to cells.

- Snap movement to cells.
- Add 0.5 or something tolerance to collision.
- Add buffer to persons for pathfinding. (Not so cool, cause pathfinding won't find a path between 2 persons standing 1 cell apart.)

- Decrease size of pathfinding cells.

I'd probably use the first one and the last one - however as long as positions/pathfinding/collision do not really use the same grid you will have inconsistencies. Graphical overlapping, collisions where there should be none, no collisions where the should be, etc. - You'd just have to pick the inconsistency you would feel most comfortable with.

(Also i think you mean "he collides with a blue person.")

I think what I'll do is only get a list of cells the person can move to from the current position to the open list, and that way I only have to do the accurate/expensive check once. From then on, the movement is strictly along path nodes. Thanks for the suggestions.

This topic is closed to new replies.

Advertisement