AI in games
At work, our development cycle is coming to a close and I have lots of reflections on the development process to share; but that will wait until after release.
At home, I am very slowly working on a web-based game, but have changed direction with it quite significantly after not only did I hit a problem, but I stumbled upon a solution at about the same time. Unfortunately it left me questioning a fundamental approach to my game, which I'll come to shortly.
Earlier this year I started a couple of threads on an algorithm for grouping a set of actors together so that they could perform tasks, the idea being that they'd gather as many actors as necessary, but not too many (as the reward would be diluted), and that certain actors were better suited to some tasks than others.
As you might see from the threads, should you be bored enough to read them, finding a good algorithm for this is quite difficult, especially since my original specifications are not exactly fixed in stone. I just wanted something that looked right, and defining it was surprisingly tricky. It was easier to list situations that I didn't want to happen, than to specify precisely what I did want. Such is the nature of all AI problems really - the trick is in finding the correct representation of your problem. In the end, I got the feeling that this system was unworkable; I found ways of having the characters group up for tasks, but it was usually quite predictable, and trying to influence them through the size of the reward was too coarse a tool.
That was when I found the solution, in the form of the football (ie. soccer to North America) management game, Championship Manager. The problem you face there is much the same as my problem, in that you have tasks to perform (in this case, football matches), and you have a pool of characters of differing abilities which must be combined to achieve this goal. Instead of the AI grouping the characters for you, you pick the team yourself.
This removes my initial aim of the characters being largely autonomous entities that work together to achieve a goal. But it arguably makes for better gameplay, by moving more interesting choices into the human player's hands. And so I can now move the game design and prototype forward with some solid principles that have been tested in the field and have done well with players (over 85% on Metacritic for recent instalments in the series, ie. the Football Manager games). But now the AI component is no longer part of the game.
This leads me to think, just how useful is AI in games? Quite a few of us rue the fact that so many computer opponents are stupid, but that tends to be a feature of faster paced games where foes run into walls, or aim like Imperial stormtroopers instead of like real soldiers, or where monsters would rather stand still and be hacked to death than run away or call for help. When we ask for better AI, we could have all of these with virtually no code time at all. Is that really what we're asking for? Or is there something more? I have the first 3 AI Wisdom books, and although every single article in them impresses me in some way, virtually none of the games I play or consider making would make use of any of these. For example, listing 101 ways to generate pathfinding nodes is all well and good, but not terribly interesting unless reducing CPU usage for AI from 5% to 2% is of interest.
I'd like to hear what AI you'd like to see in games, and perhaps why you think it isn't there yet (eg. deliberate design decision, lack of raw computing power, difficult to represent well as an algorithm, etc).