3d Character Pathfinding

Alright, I have my character who walks about and does things, but now I want to make a little ‘sidekick’ that will follow him around the place walking on hills and mountains without falling off, walking on a surface he can’t walk across, or running through walls. This is probably really complicated (which is why I’m asking advice), does anyone know of some tutorials or python scripts that might help me out?

I have been looking through a book called “Artificial Intelligence for Games” by Ian Millington and it has so far been fantastic. I am sure it could answer those ai questions of yours. I am looking through the first addition at the moment.

If you aren’t interested in getting a book, look up A*. That will handle path finding. And see if you can find something about seeking ai algorithms for following the player.

I was looking around for blend files, but unfortunatly most have broken links. I was looking it up a little bit and I see that I can either make waypoints for the character to follow, but I don’t this will work too well for what I want my character to do. I also read something about a navigation mesh that the character will follow. This would probably be the best solution I can come up with, if I actually knew how to do it. The blend file attached to the thread is a broken link, so if anyone knows of any other navigation mesh resources that would help a lot.

I just remembered that one of the Google Summer of Code projects was implementing recast and detour into the bge. I don’t know how that went, but you can try looking it up and finding a build of it. That would help with creating your navigation mesh.

Mainly I just need a code that will help my character find the best path through the navigation mesh to the target spot, while avoiding any obstacles in it’s path.

Recast creates a navigation mesh, and detour does pathfinding on that mesh. If you don’t want to use a custom build of blender and already have some way to create the navigation mesh, then A* is the most common pathfinding algorithm.

I made this for Blender 2.49, if it’s any use


The first link should be paste all.org without the space.

It says the file doesn’t exist, or the wrong password was given, but that file looks like it would help alot if I could get a hold of it.

Sorry, the file upload had expired.

Or here is recast and detour, which is more efficient

Hey, that lower one is cool, I like that build, but when I use a navmesh and have it seek, it dosn’t folow the nav mesh, it just travels straight for the target, regardless of whats in the way. Any ideas as to what I’m doing wrong?

Looks pretty cool. I’ve been using 2.49 so far, but I might have to switch over. 2.5 is just so different though, I mean after using blender for so many years it’s weird seeing the screen all dark gray!