A Look At Modern Game AI
IEEE Spectrum is running a feature about the progress of game AI, and how it's helping to drive AI development in general. They explore several of the current avenues of research and look at potential solutions to some of the common problems.
"The trade-off between blind searching and employing specialized knowledge is a central topic in AI research. In video games, searching can be problematic because there are often vast sets of possible game states to consider and not much time and memory available to make the required calculations. One way to get around these hurdles is to work not on the actual game at hand but on a much-simplified version. Abstractions of this kind often make it practical to search far ahead through the many possible game states while assessing each of them according to some straightforward formula. If that can be done, a computer-operated character will appear as intelligent as a chess-playing program--although the bot's seemingly deft actions will, in fact, be guided by simple brute-force calculations."
Back in college I worked with a guy, Jeff, on an AI project. We were to play the game Freecell through to its finish.
(if you're reading this, jeff, I'm still sorry I didn't do more coding on that and I owe you one)
While I can understand the difficulties in doing a brute force search, and that a simplified "version" of the game could be helpful, OR even that parsed "states" or "instances" of situations in the game could be broken down and analyzed, wouldn't a simpler way be to use a fitness test on various actions? No, no... I lose points for not reading the article, perhaps.
We used a combination of fitness and searching to determine a way to win a Freecell setup. Admittedly this is VERY simplified, and done in a sort of static system as opposed to a (usually) dynamic one in games.
If there is less memory, the obvious answer seems to be to use a system to determine better ways of doing things. Rather than simplifying the game, couldn't the AI have a library of responses designed to fit certain situational profiles, then act in a (perhaps semi-random) manner that fits ? Perhaps the responses could be genetically determined, even.
Also, this use of situations versus individual actions could help lengthen the time the AI has to come up with a response.
Just some thoughts, though I'm sure others more experienced than me have these on the brain. I'm looking forward to the responses on this topic.
-
Article is pretty bang on. Adaptive AI is tough to do, as is balancing being a tunable-level of smart and being beatable. One thing I have not seen enough of in games is AI agents communicating with each other about intentions. More often it is simple a matter of saying, "I'm in this area, so don't try and go here." I've yet to really feel in a game that the enemies are working together. I saw a very nice presentation on Halo 3 high level AI at GDC 08 that kind of nailed some of these problems with a pretty simple solution - there should be some top level AI manager that handles requests from AI agents on what to do next when a high level goal becomes useless to attempt to achieve. Left4Dead sort of deals with this, not by talking to agents that are still alive, but by deciding when to introduce new agents, but the Halo 3 approach to me seemed very elegant. It was higher level AI than the article was talking about, but in effect it was a similar setup: AI achieves something, and says, "What's next?" Since the AI manager would know the state of the other enemies in its unit, it could decide that you might as well not start firing at the player since the two others were doing that. Maybe some other game vets could clue me in, but I havn't seen too many games like that where a module is advising the AI based on balancing attack/protect/advance ratios during gameplay. /framework/tools programmer //not AI programmer
"Old man yells at systemd"
The ACM Chapter that I preside over at Missouri S&T (Formerly the University of Missouri - Rolla) has been writing simple RTS games with AI APIs for the last two semesters. We're currently working on a third game to add to our repertoire. We host a tournament at the end of each semester and invite anyone that will come - the main site is at http://acm.mst.edu/~mstai. The API is easy enough to get a handle on that a C++ novice could pick it up and do something with it within a few hours. Competitors are given 24 hours to write their AI, then we pit them against each other. Generally speaking, for the RTS style games we have written, AIs that act on an individual unit level only perform the best (both in execution time and scoring). This is probably due to the 24 hour time limit imposed, but it does show that even simple/greedy algorithms can perform well in game AI situations. I believe the winning team of our first tournament had an algorithm that went like this: for each unit: doBestActionForUnit(unit)
It could if the AI decision tree were a genetic algorithm.... each entity gets its own decision tree, and the ones that survive mate. :P
Of course, that only really makes sense in an MMO 'verse.
You could do some AI juggling, so that after every map (or every time the AI loses), it runs its algorithms against all previous scenarios until it wins (or at least, gets better at not losing).
But then you end up with an AI that wins all the time, and a huge amount of CPU cycles.
Actually the EVE-Online community, including devs are really gonna try to make AI happen in NPC encounters: http://myeve.eve-online.com/ingameboard.asp?a=topic&threadID=917074
Of course you could (assuming enough processing power), just have all the AI team constantly spinning 360 degrees and performing pattern matching on the visual input , as soon as a potential match is made fire at it ( to stop friendly fire have all the AI team choose the 1337 outfit and match against colour ). Also the DARPA challenge has already been beaten using pattern matching and learning algorithms (http://www.darpa.mil/grandchallenge/index.asp).
I think you're under-optimistic regarding GAs.
They can, with training (just against themselves!) beat human opponents at simple turn based games (citation). That's the same level playing field you describe.
It's been 10 years of GA optimization and theory, and 10 years of Moore's law since then. Computers have much better reflexes than humans, and you're telling me that a GA couldn't beat a master at CS?
Tell you what: give me $50,000 in funding, six months to train the AI to general FPS rules (headshot, movement, general weapon effectiveness, etc.), and another six months for the GA to advance it for CS, and it will beat anything.
If I had to pick an approach to take right now, I'd partition up the tasks (defuse bomb/identify player/is friend or foe/aim for head/etc.) to various independent, co-evolving, ANNs. There might be a better way, but that approach seems have worked pretty well for these guys (albeit that's not real time).
The point is, games have rules. Once you've learned the rules, you're unstoppable.
Obligatory Soundbite Catchphrase