Walkabout Navigation Toolkit
by Daniel Buckmaster · 07/14/2012 (4:47 am) · 30 comments
Walkabout is a new addon for Torque 3D that adds AI pathfinding using navmeshes automatically generated by the Recast/Detour library. Basically, it's the Recast resource, but with more features and much easier to use.
What are some of these features, then?Below are the features planned for the initial release. And I've got many more up my sleeve for updates!
- Automatic navmesh generation (of course!)
- Automatic cover-point generation
- Fast A* pathfinding and cover-finding fully integrated with the AIPlayer class
- Realtime mesh updates
- Realtime path updates
- Fully-featured editor plugin
- Edit off-mesh links for jumping, teleports, etc.
- Test your mesh instantly!
Care to go into a bit more detail?Why, yes. The biggest feature, I think, is the new editor plugin for editing navmeshes. When I say 'editing', you don't actually push vertices around. Recast is still responsible for generating the mesh. The editor builds on top of Recast's generation, giving you access to more powerful ways to tune it for your level.
One of my favourite abilities is editing off-mesh links. They're great for teleporters, or gaps characters can jump over. Each link has several type flags, allowing you to annotate the way your characters should use it. AIPlayers themselves can be permitted or forbidden from different link types - stop those zombies using that teleporter!
Yes, this has been on my list for ages, and I finally got around to it. Walkabout can generate cover points based on the geometry around your navmesh automatically. AIPlayers can then take cover using several criteria, such as distance to cover, the size of the cover point, etc. Cover points can be tweaked in the World Editor in case the automatic placement isn't to your liking!
I wanted to make sure Walkabout was super easy to use. To this end, I've added a lot off features to the AIPlayer class, which makes pathfinding basically a single-method-call process. In addition, AIPlayers automatically jump when they come to a jump link in their path. Similarly, making an AIPlayer take cover is a single-line process.
Walkabout uses a different navmesh model to the Recast resource, which allows you to actually rebuild pieces of the mesh near-instantly. This is great for obstacles that can be destroyed - when the object is removed, the navmesh can be automatically updated. And, when a navmesh is updated, all paths using it can be updated as well - so your characters don't look like fools trying to run across bridges that have been blown up!
While you're working on your navmesh, there's nothing that beats actually seeing a character running around and using it. One of the first features I had to have was a 'test mode', which turns the editor into a mini-RTS, allowing you to spawn AIPlayers and order them around. It's great for making sure your navmesh is all working he way you expect - not too tight around the corners, links flagged correctly, etc.
The boring stuff
Debug views. Hurrah!
When will it be released?Well, haha, that's for me to know and you to find out! Given that I'm not a great one to stick to any sort of date or time that I imagine might be accurate, I'm going to say hopefully by the end of the month. If not this month, then next month! And before you ask about price - I'm thinking around $40 USD, but don't quote me on that!
And how do you feel about that?This is pretty exciting for me. After writing the Recast resource, I stopped to take stock of where I was at - both in terms of the game I'm trying to make, and my life right now! I had the option to forge ahead with other areas of AI for my game, or sit and polish the pathfinding somewhat. A proper editor mode was something I'd been thinking of for a while.
Combined with that, I realised that for all the time I spend programming, I didn't recoup an awful lot of that effort in a tangible way. So I decided this was finally the time to get off my backside and put out a product. I'm a huge believer in free resources, so it was an odd conclusion to come to. I'd really love to release everything I make for free. But without the incentive of getting paid, I don't think I would have gone half as far with Walkabout, or polished it as much as I have. It has meant better stuff for everyone.