I just finished to implement a better version of path finding for my cthulhu game.
The basis is still based on A* but i add some additional steps to make the path used by hostile smoother and clever: I describe my enhancements in drawings below:
- The first drawing explain the real situation: you have one hostile located at point A. This hostile is modelized as a rectange (the collision area); The hostile need to reach point B behind a wall.
- The second drawing explains a path finding result using A*. A* is based on tiled so you will have a tiled vision of the path to used to reach point B. But remember, our hostile is a rectangle on a map with x,y coordinates and not integer tile indices.
- My first enhancement take A* tile path result and remove unecessary tiles (see third drawing) to keep only turn points.
- Then i do some additional process to compute real points (x,y coordinates) which takes care of hostile collision area and mnimizes the path regarding turn points.
The result in action: