Article
files/banana

What Are Your Biggest Mistakes Developing Game AI?

Alex J. Champandard on November 6, 2007

Everyone makes mistakes. From the seasoned veterans on big budget titles to the independent developers working on their first game, some slipups are more costly than others. In most cases though, there’s something to learn from!

Here’s your chance to share your wisdom to help others avoid the same pitfalls, or write down your insights for the sake of posterity.

  • Software development and architecture.

  • Methodology and team workflow.

  • Design and gameplay integration.

Of course, you’re welcome to share any other mistake relating to game AI! Click here to join the discussion.

Discussion 6 Comments

Ian Morrison on November 7th, 2007

From an amateur developer point of view: The biggest mistake I've made thus far has to do with modularity, or lack thereof. My initial implementations were a pain in the ass to work with after a while, since they made assumptions about what the AI would need to do that just didn't hold true over time. They were fun to fight and watch, for sure, and did some neat stuff like flanking opponents. In fact, when I created my new AIs I set them up to fight each other as a test of their individual decision making abilities. However, getting them to respond in new ways outside their original design (such as properly handling various projectiles being thrown at them, responding to unique objects, and retreating) was a huge pain. My new implementation seperated the decision making into seperately defined behaviours, and it became an issue of plugging behaviours into actors, and tagging objects to specify which actions could be used on them. It's been much easier to add new behaviours and alter AIs since.

Andrew on November 8th, 2007

Biggest mistakes while modding AI is doing too much, with little testing - back when Neverwinter Nights 1 was released, I couldn't run the game *and* the toolset, so loading the changes I made to the AI in the toolset took ages, meaning I'd do several changes, and of course introduce bug after bug. Was a bit funny some of the errors but all in all a pain in the ass to fix stuff later :) I also had no idea about algorithms (big O and such) at the time either, so have implemented some really slow things in the past which made my PC choke running my changes to some games. Alex; surely [I]you[/I] must have had made a mistake before too? :)

alexjc on November 8th, 2007

Hehe. Yes, I've made loads of mistakes too... My biggest mistake is assuming that all I needed was [TT]Lua[/TT] to keep my designers happy. The fact is, amidst all this talk about data-driven engines that make things easier for designers, scripting languages often just cloud the issue. I spend more time supporting the designers and writing the scripts myself that it just wasn't worth it. Then, after managing to set aside two weeks to make a bare bones behavior tree editor, things turned around 180 degrees. I found myself only supporting the engine and editor and letting the designers fix most scripts themselves... My second biggest mistake was not working very closely with the designers soon enough. I mean more than just meetings; I had lots of those... I mean that they should have been sitting right next to me from the start of the project. I wonder how much money these mistakes cost on AAA titles? ;-) Alex

Jare on November 9th, 2007

I believe that writing that behaviour editor may have been part of the solution, but I refuse to believe that relying on Lua was the problem. Maybe all the designers needed were some clear patterns for structuring their scripts, and the tool forced that to happen, but (as you mention) working side-by-side with them might have had the same effect. :) The biggest mistake I've been involved with was probably in the first Commandos. We had a system for concurrent behaviours, sensors and memory communicating via messages, and we expected collisions to work via dynamic priorities that each behaviour could adjust. When the number and complexity of behaviours increased, the system wasn't really good for dealing with the need for sequencing and coordinating, and it became a mess of magic priority numbers and undocumented assumptions about the effects of state changes within each behaviour. Spaghetti code without the gotos.

Andrew on November 10th, 2007

Interesting how LUA was perceived to be the problem too, since so many games have AI scripted in it, seemingly "manually". Good stories guys too, very insightful :) much better then mine.

alexjc on November 10th, 2007

Well, the Lua scripts had structure already, which the editor emphasized. The designers just had trouble with basic syntax errors low-level language semantics which they shouldn't have to care about. Lua wasn't the problem, it just wasn't the right solution. It's no coincidence that Lua is mostly used by programmers at EA; except as a configuration file language, I wouldn't consider it a good choice for game designers — especially now I've seen and worked with better approaches for game AI. See also: [URL=http://aigamedev.com/methodology/avoid-scripting-nightmares]3 Ways to Avoid Scripting Nightmares in Your Game[/URL]

If you'd like to add a comment or question on this page, simply log-in to the site. You can create an account from the sign-up page if necessary... It takes less than a minute!