Game Development Community

Plan for Justin Mette

by Justin Mette · 06/15/2004 (4:23 am) · 55 comments

There's been a lot of .plans lately from the Torque AI team talking about all the gory details of our progress. I thought I would take a moment to recap how we got to this point because it's kind of a fun story.

The whole thing started back in August (or so) when 21-6 was working on a now defunct project called Incursion which was a pretty traditional FPS using the whole alien vs marine theme. As part of the project, we needed to add some more intelligent AI so that the bots could do more than run from point A to point B and hope the enemy was within range.

I started expanding the AI in Torque to follow the path between a series of waypoints defined by the level designer using a few updates to the Torque editor for placing and linking waypoints. The bot would choose a nearby enemy and follow the path to get as close as possible, firing its weapon when within range.

www.21-6.com/images/torqueai/boteditor1_small.jpg
This worked pretty well at first, however after jumping in and fighting the bots for a while, I realized rather quickly that manually placing and linking these waypoints was going to be a major pain in the butt for a level designer especially on more complex levels. I also realized that it was way too easy for the bot to get off the waypoint path from explosions, collisions with other players, etc. Once off the path, the bots really couldn't reliably get back on it. For example falling off a bridge or having a large tree in its path caused the bot to be hopelessly lost.

Then one morning I had the idea to automatically generate a graph of connected nodes around the terrain that the bots could use to navigate back on to the pre-defined routes. I started with brute force, shooting raycasts from the sky down to the terrain at regular intervals and linking them together with a quick distance check algorithm.

www.21-6.com/images/torqueai/botnav2_small.jpg
Ah yes, this was working out nicely as the bots were able to find their way back to the route with a light-weight path finding algorithm I snagged off the net. We were cooking with gas and loving it ... until Chris came up with a sweet multi-level interior complete with stairs, ramps, bridges, etc. Although it was cool to watch the bots patrol through the new interior the NavGraph was a total mess inside the interior and bots were getting stuck everywhere.

Back to the drawing board I went trying to improve the NavGraph generation process to handle complex, multi-level interiors. Using the basic raycast algorithm described earlier, I extended it to find the ceilings and floors of every level in the interior.

www.21-6.com/images/torqueai/botnav1_small.jpg
I was so very proud of my fancy new NavGraph (how geeky) that I quickly started fighting our beloved bots yet again only to find that they continued to get stuck on crates, stairs, and pretty much any obstacle in their path whenever they strayed from the pre-defined routes.

Talk about doing this the hard way. We really didn't have the intention of building this complex AI system but at each evolution it became more and more evident that quick answers weren't going to cut it. We needed to bring in the big guns namingly A* path finding. Now that we had a pretty decent graph of connected nodes, we really didn't need those pre-defined waypoint routes to get around if we had a good path finding system.

So off I went to go learn A*. This was a fun little project and I learned a lot like how expensive it was to do A* with complex navigation graphs. The first implementations were extremely memory intensive and slow as hell. That's when I got all warm and fuzzy with the Torque Profiler which pointed me in the direction of the bottlenecks. More reading and weeks of optimizations later the A* algorithm ended up being pretty fast and even distributed over multiple "think ticks" to help balance the load of many bots path finding at once.

www.21-6.com/images/torqueai/pathfinding_small.jpg
Ah finally, a good solid path finding foundation. Now it was finally time to fight that damn Orc and show him who is boss! But alas, the bots were still getting stuck and couldn't handle getting in and out of interiors very well especially for those that were rotated or scaled in the mission environment. "You have to be kidding me..." I said as I stared at the problem areas of the FPS Starter Kit mission.

The next few weeks were spent refining (yet again) the generation of the NavGraph. Improvements included generating nodes for interiors in local space so that regardless of their rotation in the mission, the nodes were always in the same place. Also, a more dense series of nodes needed to be placed around the interiors to help the bots find their way in and out of the doors.

www.21-6.com/images/torqueai/navgraph1_small.jpg
These improvements and others actually resulted in a pretty solid experience. I implemented a quick "follow mode" for the bots and armed them with weapons. They actually were chasing me in and out of the interiors, up stairs, cutting me off on the opposite side of bridges, etc in other words, the bots were starting to give me a challenge.

It was about this time that Stefan "Beffy" Moises and Phil Carlisle started posting more about their work on AI for Torque. They were coming at the problem from a different angle dealing with real-time steering (obstacle avoidance) and behaviors (patrolling, chasing, fleeing, etc). I knew I had a good path finding foundation but had not really even started on the higher level functions. It was a perfect match of code, skills, and vision between the three of us.

After getting acquainted with each other's work, we decided that combining forces was the best way to get all this work done in a timely manner. So Stefan took over for me with the foundational aspects of automatic NavGraph generation, path finding, and obstacle avoidance. He has been extending that functionality in fantastic ways like node occlusion brushes, terrain material occlusion, and fixes for many of the problems that were yet to be solved when I worked on the code.

Stefan's Recent Related Plans
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5824
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5716
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5687
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5673

Knowing that we had a good foundation of path finding, Phil has been implementing the higher level brain functions for the bots using a task/action system giving the bot programmers complete script-level access to all functionality. In other words, the final piece to this long and winding road.

Phil's Recent Related Plans
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5842
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5814
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5727
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5699

We still had one area of the project that wasn't covered which is editor support for viewing and manipulating the NavGraph as well as defining the tasks and actions for each bot to obey. Thankfully, Nicolas Quijano jumped into IRC one day to ask if he could help with the project. Ah Nicolas, what timing indeed! Expect to see some .plans from Nic in the near future showing off his work on the project.

So what is my role on the project now? Basically to make sure that we keep the scope of the project reasonable, make sure everyone is moving forward without obstacles, and lending assistance to the technical brainstorming sessions on how to solve the problems we still face in reaching our goals (see recent .plans from Stefan and Phil for more details there).

All in all, we have a rock solid team of experienced Torque programmers working on this project and I am honored to be in such great company.

We meet every week, Thursday at 12PM EST in #torqueai on the irc.maxgaming.net servers. If anyone is interested in learning more about our progress, please don't hesitate to drop in and ask questions or lend some brain power to the effort.

What's next for the Torque AI team? Well, we are considering taking all these months of work and putting it into a "Bot Pack" for FPS style games that would be sold here on GG like other content packs. This won't be an end-all-be-all solution because most higher-level AI is very game specific. What it will provide is a foundation for an FPS game that can be built upon very quickly leaving the majority of the work to programming the game-specific intelligence for bots.

What do you all think would you buy a Bot Pack that had an automatically generated navigation graph, distributed and optimized A* path finding, a fully scriptable behavior framework, and editor support?
Page«First 1 2 3 Next»
#41
07/25/2005 (7:14 pm)
I am also curious as to any progress on this pack....

Tim
#42
11/08/2005 (6:34 pm)
Hi guys. I have been watching this one from it's beggining. Is there any news on this one?
#43
11/08/2005 (7:20 pm)
On Dec 08, 2004 Justin mentioned that they were just putting on the finishing touches to the project but alas I too have not seen anything a year later. I would LOVE to utilize this pack and would gladly fork over for it as well.
#44
11/09/2005 (4:07 pm)
Sorry it's taking so long guys. Our schedules really filled up this year with Orbz Xbox, Dimenxian (the education FPS), and TubeTwist. Phil Carlisle is starting to talk about coordinating with the others in the community working on AI to try and get this pack to a releasable point - so there is some energy being stirred into this project again slowly but surely.
#45
11/09/2005 (5:31 pm)
Thanks for the update Justin! Its a relief that the project isn't dead - I was getting worried for a little while there.
#46
11/11/2005 (10:47 am)
Glad that you are still working on this one :) :)

If you find some extra time drop us some info ocasionally ;)
#47
11/22/2005 (2:20 am)
Another customer for this pack is waiting.
#48
01/16/2006 (4:55 pm)
November! Well, we are into the new year, how is this project coming? No news here, perhaps I'm not looking in the right place? I'd love to use this within my game, let us know how it's coming, or if it really isn't coming at all? Cheers guys!
#50
09/01/2006 (3:51 pm)
so yeah, if this ai pack is comming out, could someone plz contact me,

seems like another purchase is in order ;)

truely awesome, good job u 2!
#51
11/15/2006 (3:10 pm)
desperately in need of this pack !
#52
04/02/2007 (5:36 am)
is this pack avaiable?

if so, does it have pathfinding, and collision working?

thanks in advance
#53
05/09/2007 (11:48 am)
hi
just a question !
how could you raycast in an interior ?
i am using radiussearch but in an interior always return the interior that within .
how can i get the position of point that near the wall .
#54
11/06/2007 (12:06 am)
this pack is ready? or are you waiting for christmast????
#55
10/21/2008 (7:27 pm)
What happened to this?
Where is the buy now link?
Page«First 1 2 3 Next»