Pathfinding for Delphi in 3D

Started by
10 comments, last by TaskyZZ 17 years, 6 months ago
TaskyZZ, check out the little app at this link(click the picture)
clicky

It demonstrates a bunch of methods of pathfinding.

The shortcutting smoothing several people have mentioned works great in 2d games, but typically has issues in 3d games, for similar reason to why points of visibility has issues in 3d games. Simply having line of sight between 2 nodes doesn't mean you can skip all the nodes in between in 3d. If your A* is set up properly you will get an optimal path. There are reasons the path planning usually makes non straight paths, that's to avoid holes, pillars, etc. If you start shooting rays and shortcutting the path you are going to run into more problems than you solve most likely, mostly with holes that the shortcuts could run the guys into. Just consider if that is an issue with the game you are working on before you implement it.

Much of the time the smoothness of the path doesn't matter so much as the way you make your agent follow it. If you lock him to the line then it will look bad, if you have him seek to a point always ahead of him on the path, he will naturally curve into the corners, though you need to make sure he doesn't cut corners too much so as to run into stuff he shouldn't. A common method is having the agent seek to each point in the path, and it considers it reached when he gets within some distance of the point, which he will then go to the next point. This has similar effect of rounding out corners of otherwise angular paths. It's not perfect, but it's very simple and produces reasonable results. Your search space representation has alot to do with your path post processing options.

[Edited by - DrEvil on October 11, 2006 11:54:16 AM]
Advertisement
Thanks.

I am still learning this stuff and appreciate all the help. You make some good points to think about, some of which I had been considering.

I don't get a lot of time to code, so I haven't been able to play with this in the last few days, but I will be jumping on it again this weekend for sure. It is fun makeing changes to the AI and then seeing the little guys walking around putting it to use. Seeing how they break my vision of it and then making changes to push them back along the path of my vision. :)

This topic is closed to new replies.

Advertisement