I implemented several approaches such as A* and Potential fields for my tower defense game. But I want smooth paths, first I tried to find path on very small grid ( 5x5 pixels per tile) but it is extremly slow. I found nice video showing an RTS demo where paths are found on big grid but units dont move from each cell's center to center. How do I implement such behavior? Some examples would be great.
Answer
There's actually a pretty nice article about this at Gamasutra (7 pages!). While Beizer curves will smooth a path, it won't cut across grid spaces like in your video example.
For example (from the article):
- (a) is the result of a standard A* search, while
- (b) shows the results of a postprocess smoothing operation.
- (c) shows the application of a turning radius for curved turns.
- (d) illustrates an A* modification that will enable searches to include curved turns that avoid collisions.
No comments:
Post a Comment