First Steps in Game AI: Your Own Bot

By ai-depot | June 30, 2002

Engines Available

All the games listed below are considered a landmark in their area, which implies great community support. Specifically, the editors to create some custom levels, the tools to compile your own bot data, myriads of third-party levels to test your bots on, and not to forget many tutorials to get you out of tricky spots!

Quake 2

Quake 2

Development

Despite now being a few years old, it is still one of the best AI development platforms you can get. Quake 2 is an incredibly well polished product, compact and efficient. The graphics won’t get into the way of your AI development, as they’re stylish but simple. Also, the number of custom levels available means you will not get bored while developing your bots. For testing purposes, this is also ideal. And best of all, if you don’t own it already, you can get it for less than $10! You can get it at Amazon.com among others.

Implementation

The game code is freely available, and written in Ansi C it provides an elegant and efficient base to expand upon. Additionally, there are more “amateur” bots for Q2 than for any other game. This will speed up your development task by an order of magnitude, as you can always dive into other implementations to solve your engine related problems. Finally, there’s also a few client based bots, which is good to know if you favoured the client-based approach in the previous page. We’ll discuss this in more detail below.

Settings

Quake 2 was sold as a single player game, and as such you can potentially train your bots to complete it. Together with this, the death-match environment is still amazing even by today’s standards. Granted, the graphics are starting to flake a bit, but the speed of the action and the weapon balance are top of the range. Your bots will be put to the ultimate test here. And finally, the “Capture the Flag” add-on will allow you to tackle multiplayer cooperation issues.

Half-Life

Half Life

Development

Half-life is also starting to show its age. The quality of the levels provided with the game seem to have a slight edge over those in Quake 2, but nothing major. The detail of the levels is good forimplementing bots: not to detailed, not too simple. The engine itself is not quite as polished as Quake 2’s, as it can get a bit twitchy for some configurations. Nothing major though. Once again, there are multitudes of custom levels available, so you can test your bots in more than one. If you don’t own the game, all this will cost you just under $30 at Amazon.com, which is a fair amount for such an old game.

Implementation

It is based on the code of the original Quake which was rewritten in C++. This is a great advantage if you don’t want the hassle of implementing an interface to standard Ansi C code. There’s a fair amount of third-party bots available, so you have many examples to look to for inspiration. Finally, there’s a bot-framework based on the game interface approach described in the previous page. We’ll look into that in the latter stages of this tutorial.

Settings

Although I personally prefer Q2’s death-match experience, HL will allow you to develop bots in such an environment too. Counter Strike and Team Fortress Classic form the most comprehensive online community of cooperative first person shooters. The tactical aspects of this approach are interesting and challenging to say the least! And finally, you also get the award winning single player experience tagged onto that.

Quake 3

Quake 3

Development

Just like any other Id product, Quake 3 is very polished. Once again, this is a development environment to dream for. The engine is stable and reliable. The levels are gorgeous, and extremely well designed. This comes in very handy for testing advanced death-match tactics. However, the graphics can get a bit heavy if your AI is very intense, but turning the visual settings down will fix that. Suprisingly, you can get it for less than $20 if you don’t own it, which I thought was pretty damn good!

Implementation

Since the game comes with bots by default, there aren’t as many amateur bots as for Q2 or HL. Still, there are some good ones, which is enough to give you a start. The default bots are in a separate library sadly, so you won’t be able to tweak them. The code is Ansi C again, and those of you that were expecting C++ will have to wait until the next Doom. The great thing about the code is that it does not come with extensive single player monster AI like in Q2 (which can be a bit overwhelming at first).

Settings

If you didn’t know this by now, Quake 3 is multiplayer only. You won’t be able to test your bots reasoning abilities in single player unless you code a game up yourself! The multiplayer is very good, well balanced and fast - as you’d expect. Best of all, you’ll be able to get your bots to compete against the default bots. This is a great reference if you want your bots to learn and adapt.

Summary

Personally, I use the server-side approach with Quake 2. I have a small interface in C to access my C++ AI code. This is a bit of a hassle, but the engine is by far the best choice for reliability, flexibility, and community support (levels, mods, editors andtools…) Quake 2 seems like the right choice for client-side implementations, as there are a few frameworks available. Half-life is a good choice if you want to use a game-interface approach, or if you want to tackle advanced multiplayer issues in Counter Strike (that Q2’s CTF doesn’t provide). Quake 3 is a good choice if you want more fancy graphics, or if you don’t want to deal with the wads of single player code in Q2’s source.

Pages: 1 2 3 4 5 6 7

Tags: none
Category: tutorial |

Comments