Slashdot Log In
Artificial Intelligence for Computer Games
Posted by
timothy
on Wed Aug 10, 2005 02:35 PM
from the hey-any-intelligence-is-nice dept.
from the hey-any-intelligence-is-nice dept.
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.
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.
This discussion has been archived.
No new comments can be posted.
Artificial Intelligence for Computer Games
|
Log In/Create an Account
| Top
| 259 comments
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Obligatory complaint (Score:4, Insightful)
(Last Journal: Tuesday May 10 2005, @07:05AM)
Yeah, it's an obligatory complaint. Mod me down for it.
Spore (Score:2, Insightful)
Re: Spore (corrected links) (Score:4, Informative)
Re: Spore (corrected links) (Score:4, Informative)
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.
Natural stupidity (Score:5, Insightful)
(http://pages.sbcglobal.net/redelm)
Natural stupidity beats artificial intelligence every time
You cannot make something idiot-proof because idiots are too ingenious (variable). Unfortunately, I see much of AI as trying to impose order on chaos which cannot be done with deterministic methods. AI _can_ help with data reduction, but not understanding.
Ummm.. (Score:2, Insightful)
Employment of AI vs CS grads in game design (Score:3, Interesting)
Enlightening and frustrating. (Score:5, Insightful)
(http://slashdot.org/~GillBates0 | Last Journal: Tuesday July 10, @04:36PM)
Much like how AI is, atleast in it's current state.
Enlightening because even the most basic attempts at simulating intelligence in machines makes us realize how vastly superior Nature's machines are. And frustrating because of how difficult it is proving for us to reach an adequately satisfactory understanding of "real" intelligence/consciousness inspite of all the research/effort we've been putting in.
AI = Annoying Idiot -- Deserves To Die (Score:2)
(http://www.creimer.ws/ | Last Journal: Friday January 26 2007, @12:40PM)
I can see it now... (Score:3, Funny)
Person: "Shut up, I'm almost to the high score!"
Computer game: "I cannot allow you to "pull a Korean". "I am shutting you off."
Pong AI (Score:5, Funny)
(http://www.berkshirephotonics.com/)
Re:Pong AI (Score:5, Funny)
(http://itsbeenconfirmed.com/ | Last Journal: Sunday May 04 2003, @02:33AM)
natural computer? (Score:4, Funny)
(http://www.livejournal.com/users/k4_pacific | Last Journal: Tuesday May 25 2004, @10:16PM)
Does that mean you are going to run it on an abandoned 486 you found in the woods?
Game 'AI'... (Score:5, Insightful)
From the review, it seems this books touches on this a bit. Hopefully more game developers will start putting additional effort into making dynamic, learning Artificial Intelligence components to their games.
Of course, part of the problem is also building the AI to act Human. Humans make mistakes, and so should the computer. In warfare, there's always been that element of random chance where you can capitalize on an enemy's mistakes. Take in factos like morale, confidence, etc. It's no fun to play against a perfect oponent all the time
I think the first game company to get this careful balance right is going to be laughing all the way to the bank.
Genetic Algorithms (Score:5, Interesting)
Genetic Algorithms [wikipedia.org] will most definitely be involved in the way the gaming experience progresses.
To expand on the idea of rewarding, those genomes that are rewarded the most are then permitted to "mate" with other strong genomes, which will take into account inheritance, mutation, natural selection, and recombination (or crossover) resulting in the "smartest" population.
The fitness test could also be controlled by the player, keeping the game even more interesting, for a much longer period of time.
Re:Genetic Algorithms (Score:5, Insightful)
(http://www.pseudotheos.com/)
This is why I get so annoyed when scientists (and creationists) ask "what is this organ useful for?" expecting that every animal's every organ is entirely well-suited to its environment -- because either evolution or the hand of god made it perfect. That's not what the theory(!) of evolution predicts. Narwhals wound up with a long tooth, and sure, maybe they use it to impress the females now -- but is that why they have it in the first place, do they maybe only use it because they have it? Could it be that somewhere along the line, some freak just happened to survive an accident when others didn't, and passed on the freak gene causing this tooth to be a horn?
Weird results from genetic algorithms are even more likely in small-population scenarios like games. You can only send so many 'test' enemies at the player before he gets bored. Particularly considering that in most games, either the player surives or the computer survives, I'm not seeing at what point you can reward the AI by letting it reproduce except when the player loses (at least in an FPS setting.) In that case, the game only gets better if the player loses a lot -- and most games try to make sure the player doesn't lose too much, but is instead always on the brink of losing (to keep him hopeful but challenged.) On the other hand, if you train them in the studio, you'll have to be careful to not train them to be good only against the testers. You don't want to release a game in which the AI is really good -- so long as you don't lure it into getting stuck in a corner, just because no tester thought to do that often enough to breed it out.
But genetic algorithms are certainly not guaranteed to produce good results. They merely might.
Game AI (Score:2, Interesting)
(http://www.kcore.net/)
Settlers of Catan (Score:1)
http://www.infolab.northwestern.edu/infolab/ [northwestern.edu]
Thankfully all over the web now due to:
http://sourceforge.net/projects/jsettlers [sourceforge.net]
Some people have all the luck. (Score:1, Funny)
(http://geocities.com/nelstomlinson | Last Journal: Wednesday January 22 2003, @01:19AM)
Man! I never find any machines in Nature, except the occasional stripped car with the windshield shot out. Where is this guy finding his machines? It must be a great place to go hiking.
What I'd Like in AI (Score:3, Funny)
zerg (Score:2)
(http://www.omletteso...hp3?who=Lord+Omlette)
(I never read the 2nd "AI Game Programming Wisdom"... laziness on my part.)
Or forget about all that.. (Score:2)
AI today (Score:3, Funny)
(http://slashdot.org/~Quirk/journal/ | Last Journal: Monday October 03 2005, @04:07PM)
As I was saying about AI...oh, my Barbie XXX has just come in to bring me a drink, of course my Barbie has limited AI but is saturated with artificial sex hormones to pander to my every whim... but not now Barbie, daddy's busy...
Now about the promise fulfilled by AI proponents... oh damn look at the time...If I'm going to make the lightspeed shuttle to Mars I pretty much have to teleport out now, we're going white water rafting in the Valles Marineris.
Anyway good job on the AI.
Only Ten Years Away (Score:3, Insightful)
That's my 2 cents - flame away.
SMB AI (Score:2)
I actually got a copy of the original SMB source code. Hopefully Nintendo won't mind me revealing the algorithm for the koopa trooper's AI:
1. walk until wall is encountered
2. reverse direction
3. goto step 1
Another good one... (Score:5, Informative)
(http://tomcopeland.blogs.com/)
The code examples are in C, although I ported some of them [rubyforge.org] from the 1st edition of the book to Ruby.
1999? (Score:2)
AI for Computer Games and Animation: A Cognitive Modeling Approach (Hardcover) [amazon.com] - August 1999, 220 pages
Artificial Intelligence For Computer Games: An Introduction (Hardcover) [amazon.com] - July 2004, 160 pages
So is the same book twice (slightly shortened), or what?
AI varies from game to game (Score:2)
(Last Journal: Sunday November 06 2005, @10:30PM)
Normally AI involves a lot of cheating, like the Street Fighter 2 always block to the Warcraft3, everything costs 1 gold for the computer.
We've only just moved into the 3d era of video games recently, and we're not close to standardizing the 3d game development process, so we're even further away from writing effective AI. Sure you can write entirely complex AI that involves flocking and friendship, but if your game isn't designed to make use of it, people probably wouldn't even notice.
Anyone ran NERO? (Score:3, Interesting)
Why Games need AI (Score:1)
Why are there so many books about AI in games? (Score:2, Interesting)
hot topic?? (Score:2, Insightful)
AI is not a hot topic. It hasn't recovered from the 1970s snake oil peddling stage, and it is still looked down as an overpromiser and underdeliverer of goods, even though some real neat and exciting stuff is going on there.
They'll have to fight hard to get rid of that image and that starts by continuing the shift from shoddy-but-cool-sounding work towards more measurable science. Certain areas like theorem proving have fully made the shift, others like onthologies seems still mired in the promise-lots deliver-little stage.
Part of the problem (Score:3, Insightful)
I did the game AI for a few games (Score:2, Informative)
(http://www.markwatson.com/)
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.
not very good and been pimped here before (Score:2)
(http://www.positech.co.uk/)
after the first time I persuaded my boss to buy it. Several of us read it and thought:
meh
Im sick of books trying to ram ONE specific method for doing stuff down your throat. I dont need sample code, and I dont need to be told what to call my systems, I need IDEAS. Good AI is absed on good concepts, nothing mroe detailed. I recommend Steve Grands books if you want an AI book that actually makes you think.
Rubber-banding (Score:2)
(http://www.jasonhallphoto.com/ | Last Journal: Thursday October 02 2003, @08:39AM)
Quake AI (Score:1)
(http://www.superficial.net/)
I think the reason it struck a chord with me was that it was behaviour that I hadn't seen before. Prior to that every FPS I had played followed a very formulaic "monster sees player, monster attacks player, player or monster dies". Hardly intelligent behaviour.
Max Payne is also something that stuck out - again not really from AI in the strictest sense of the word, more the simulation of realistic behaviour - like Quake. Come across two baddies and they start talking about how badass you are, and how they really don't want to come across you.
All scripted of course, but wouldn't it be great if their fear and dialogue was based on how accurate/infamous you currently were? Maybe if you weren't that accurate or often got hit they could joke about you, or something.
I am of the opinion that AI in games is not just about improving how monsters attack you, but the perception of them as living entities with self-preservation, their own agendas, etc.
Pangea Soft Ultimate Game Programming Guide (Score:2, Interesting)
Note: This is not a plug, I'm not the author, and your offtopic mods don't scare me.
Just for games? (Score:1)
(Last Journal: Wednesday October 12 2005, @10:30PM)
Hell, maybe someday AI will replace telemarketers. Then you won't feel quite so bad about playing jokes or hanging up on them (I know some of you don't feel bad about it already, but you have to understand that some of the people are just desperate for money and that's the only job they have).
AI (Score:1)
(http://devedia.com/dosghost/)
AI wont be understood... (Score:3, Insightful)
My guesss is 'real' true AI, that see's the world like us and senses it like us wont be understood for a long time. Because lets face it, what AI really gives us is precise tools, to do all the jobs we cannot more precisely, but the fact is these greater functions were made by us, and are still reliant on our wetware brains for their superior formation and organization, and are only as good as we build them to be.
AI is supposed to do more and be more then just an automaton running algorithms, what I mean is, it has to self-aware environment like we are, when we are very young when we are first born we run algorithms that build some the foundation of the mind, none of us remember learning to walk or our first words within our first year or two, our self-awareness, 'we' as we experience ourselves don't wake up until between 2 and 4 year of age, this can vary somewhat depending on how fast the brain develops but the biology does most of the 'plumbing work' for us to build a foundation / mature the brain structures, to the point where enabling self-awareness makes sense.
Babies may seem alive and self-aware when they are very young but they are not, they do not experience the world at all like 6 year old, they are effectively asleep until the brain has matured to the point where self-awareness is achievable, we do not understand this process and until this is understood AI will be a wet dream if we truly want to create intelligences like human beings that are not merely machines not aware of their own existence responding in like a live human being in every respect, but not really alive. You can only really be said to be alive if you awake.
People in their sleep speak and move and do all sorts of 'living' things but they are not aware that they are doing so, it's all automatic, this is basically what most if not all AI will be like until we understand the threshold of what causes human self-awareness.
Rendering the environement for the AI? (Score:2)
Of course you don't have to do the full rendering, but for exemple light condition should have an impact on visibility so the rendering must be quite detailed..
Two categories? (Score:1)
IMHO the traditional subdivision of AI is between expert systems and automated learning. Games, is a field of applications, as are language technology, machine vision and machine operation optimization, for example. Games are really just a fringe.
The two categories categories proposed here are like saying: "there are 'basically' two categories for programming languages: LISP and non-functional languages." Here, 'basically' makes no sense outside the scope of LISP.
For a more accepted categorization of AI, look here [wikipedia.org]
AI doesn't have to be realistic to be good (Score:5, Interesting)
(http://ingles.homeunix.net/)
But when the first one found a path to you, they would mark the grid point just before you with a high (but not infinite) 'cost'. Then the next enemy to plot a path to you would naturally try to avoid that spot, but would use it if there were no other choice.
Presto, enemies naturally try to come at you from multiple directions, without having to spend a lot of expensive cycles on modelling 'intelligent' coordination and strategy.
Re:I just don't understand. (Score:1)
(slowly backs away)