Slashdot Mirror


Artificial Intelligence for Computer Games

Craig Maloney writes "Artificial Intelligence (AI) is a very hot topic today in computer circles because of the interest in modeling behaviors on machines that we find in nature. Many books have been dedicated to studying and expanding the field of AI, but generally fall into two categories: those that concentrate on AI as a research topic, and those that concentrate on AI in the field of game development. Artificial Intelligence for Computer Games (AI for Computer Games) is unique in how it takes classical AI and merges that knowledge into AI for game development. It's an approach that will be fascinating to those currently studying AI, but the approach limits the usefulness of this book to a select audience of AI researchers interested in game development." Read on for the rest of Maloney's review. Artificial Intelligence for Computer Games author John David Funge pages 127 publisher A K Peters, td. rating 6 reviewer Craig Maloney ISBN 1568812086 summary An introduction to Gaming Artifical Intelligence

AI for Computer Games begins with a brief introduction to the historic roles that AI has played in games such as Pac Man and Mario, and how these Non-Playable Characters (NPCs) achieved fame through their roles as NPCs. The NPCs play important roles in games, and their behavior can ultimately determine if the game is entertaining or frustrating. The author then describes the differences between the field of Artificial Intelligence as compared with Gaming Artificial Intelligence. Later he shows how these two fields can intertwine with each other, and how Gaming Artificial Intelligence can be useful to AI researchers via game-playing robots and other similar experiments. The author also introduces the architecture of the components of a game. They are:
  • Game State: The current state of the world
  • Simulator: Encodes the rules for how the game state changes, and the rules for the game (physics, etc.)
  • Renderer: The display of the game
  • Controllers: The player and NPC methods for interacting with the game.
The book then focuses on simulating a gaming environment for the NPCs and player to operate in. The author uses a game of Tag as the game framework for the rest of the book, with the player and the NPCs playing the classic game of chasing and hiding. The roles of the game state, simulator, renderer and controllers are explored in depth in this section.

Next, AI for Computer Games discusses NPC perception. Players in a gaming environment are hindered by what the renderer will display to them, so likewise, the NPCs should not have omniscience in the game. The author recommends a strategy for handling this for NPCs: use the render engine for determining the perception of the NPCs as well. This allows the players and NPCs to work from the same rules. The author also describes how NPCs can handle partial observability, as well as prediction.

The rest of the book deals with the NPCs' abilities to react, remember, search, and learn to the game environment. This is the heart of the book, and provides a good analysis of the various methods available to the developer to model complex behaviors. The section on learning is especially interesting, as the idea of rewarding the algorithm when it performs correctly seems both strange and obvious at the same time (although the author points out that sometimes the algorithm can do undesirable things in order to obtain that reward). There are many ideas in these sections for perfecting the AI of the game, and the author expertly describes each one and where each would best be used.

AI for Computer Games was both enlightening and frustrating at the same time. The author obviously possesses a lot of knowledge in the AI field; the frustration is in his telling of that knowledge. The book reads much like an academic paper on AI applications in games, and could put off many potential readers with its rather dense descriptions of complicated material. The book also suffers from being rather short. The book is 127 pages in total length with code snippets, diagrams, and other page artwork. The brevity makes the book easy to pick up and read for a bit, but the density ensures you'll be re-reading several chapters in order to catch what the author is trying to convey. The code snippets also suffer from brevity. The code snippets are in C++, but are primarily constructors, with precious few methods defined. The author has excellent ideas; using an environment where the player and the NPCs are equals removes much of the complexity for the example AI to handle. Unfortunately the execution in this book leaves me wanting more.

You can purchase Artificial Intelligence for Computer Games from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

9 of 259 comments (clear)

  1. Re: Spore (corrected links) by FnH · · Score: 3, Informative

    I just finished reading a preview of Spore, a new game from the creator of the sims, and it seems like AI in games is about to take another leap :) (messed up my previous post a bit)

  2. Another good one... by tcopeland · · Score: 4, Informative

    ...is M. Tim Jones' AI Application Programming. It's got all sorts of predator/prey and pathfinding stuff in there.

    The code examples are in C, although I ported some of them from the 1st edition of the book to Ruby.

  3. Re:Spore by Vaevictis666 · · Score: 2, Informative
    It's not so much compression algorithms as it is generation algorithms.

    Spore doesn't store your current type of creature, it stores the parameters used to create (or 'evolve') your creature from scratch, which can indeed be quite small.

  4. Re: Spore (corrected links) by FnH · · Score: 3, Informative

    It can be argued that once we know something can be programmed we stop thinking of it AI. A few years ago many would have claimed that a computer really should have achieved something intelligent when it beats a grandmaster at chess. Now, after the fact, we only think of it as a clever search routine.

    It might just be clever programming, but figuring out how to move an as good as random combination of parts so as to make a believable imitation of locomotion has a ring of intelligence to it.

    And that's perhaps the most mundane part of the game. If you believe everything that's written about it (large parts of it are probably hype), they're trying to achieve some form of emergent behaviour in many aspects of the game.

    I bet you could fill another nice book or two, just describing all the AI algorithms they used, and I wouldn't be surprised if there would be a few clever things in there that haven't been published before.

  5. I did the game AI for a few games by MarkWatson · · Score: 1, Informative

    I did the game AI for a few games (cancelled Nintendo U64 game, hovercraft racing game) and for a VR prototype for Disney. It was probably the most fun job I ever had - I do mostly server side Java development now which is not quite as interesting :-)

    I started out trying to write complex control code (a multi-agent system with modules for different behaviors/situations with a simply control agent to choose which module to give control to and for how long). The problem with this approach was that the game NPCs acted in complex and unpredictable ways - interesting behavior, but not predictable. It turns out that gamers want to learn how to react to game AIs. Anyway, I eventually got it right :-)

    BTW: why did I quit such a fun job? My wife and I had bought a home in the mountains of Northern Arizona and we eventually wanted to move. The stuff that I work on now can be done remotely.

  6. Re:Enlightening and frustrating. by Anonymous Coward · · Score: 1, Informative

    Please remember that research in this area is in its infancy. I'm not a cognitive or neuro-scientist; however, I do have a friend doing research in the field. As I understand it, the problem with our current simulations of cognition is that our understanding of the genuine biological phenomena is still quite lacking. Unfortunately, many of the current approaches to implementing "AI" are "top-down"; rule-based, or symbolic in nature. These may be useful for certain applications (e.g. expert systems); however, I don't they'll ever amount to anything remotely sentient. Additionally, our imitations of biological neural networks are still very primative, and pale in comparison to the real thing. Until we have a better understanding of our own neurological processes, I think our chances of simulating genuine intelligence is minimal.

  7. Re:Employment of AI vs CS grads in game design by vaporakula · · Score: 3, Informative

    I'm an AI Designer for a major developer / publisher...

    I have a background in CS, but I'm not a coder - I'm a designer. One of the more technical designers out there; that's a big factor in why I'm doing AI design.

    My background definately helps. I can communicate with the coders using terms they are comfortable with - they don't have to "dumb down" their thoughts to make a concept work for me. However, being a Designer means I'm not actually doing the coding: I design the systems, the desired end results. As such I use a wide range of skills and knowledge, from psychology and sociology to modelling and HCI.

    I suspect your question is actually "how many of the people out there coding AI have a typical CS background..." The answer in my experience is most, although I've worked with people with specific degrees in AI as well. Mostly people end up doing AI in games because it interests them, and they worked hard developing their skills in that area. Actually, that answers your second question as well - if you want to work for an "actual organization doing AI" then you can, if you want to make games, go for that instead. Depends what path you choose to pusue, assuming you can push yourself far enough to succede.

    But, if I've got you wrong and you actually want to do the design side of AI... you're aiming to be a games designer. There have been a few stories here about how to break into the industry, and I remember seeing lots of cogent advice - go check them out. Once you're established as a designer, specializing is only a few titles away...

  8. Re:Employment of AI vs CS grads in game design by vaporakula · · Score: 2, Informative

    Kind of. It's not just working out the individual behaviors that characters exhibit, but also coming to the programming team with a system of how the decisions can be made to chose these behaviors appropriately. Game design of any kind is a negotiation as much as anything though, so I'm not there to force solutions on people.

    So, while I do effectively storyboard character behaviors I also head into more technical design as well. It definately helps to have a technical background, and I studied (lightly) AI topics at university so I have a decent grounding to work from. I also make an effort to constantly communicate with my programmers, as they are experts at what they do as well. My overarching aim is to make sure the AI is fun, not force a particular implementation.

    As to creative freedom, there's plenty. I'm expected to stay true to the franchise (yes, it's a sequel... i know, i know...) but more importantly I'm expected to make a fun game. So, as long as I can convince people my plan is going to produce something awesome, they go for it :)

  9. Re:Obligatory complaint by larry+bagina · · Score: 3, Informative
    According to the book review guidelines...

    Speaking of links, please do not include links in your reviews to online bookstores. Slashdot has an linking arrangement with Barnes & Noble; that's why when bn.com carries a particular book, you'll see a link to it at the bottom of the review.

    PS - "an linking arrangement"?

    --
    Do you even lift?

    These aren't the 'roids you're looking for.