Artificial Intelligence for Computer Games 259
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.
Obligatory complaint (Score:4, Insightful)
Yeah, it's an obligatory complaint. Mod me down for it.
Re:Obligatory complaint (Score:2)
Re:Obligatory complaint (Score:2)
Re:Obligatory complaint (Score:3, Informative)
PS - "an linking arrangement"?
Spore (Score:2, Insightful)
Re: Spore (corrected links) (Score:4, Informative)
Re: Spore (corrected links) (Score:2)
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.
Re: Spore (corrected links) (Score:3, Insightful)
There's some truth to that, but I think people want AI to be done the "right" way, like a chess program that was an outgrowth of a general purpose intelligence rather than a specialized one-trick-wonder.
If Deep
Re:Spore (Score:3, Interesting)
Re:Spore (Score:3, Informative)
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.
Natural stupidity (Score:5, Insightful)
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.
Re:Natural stupidity (Score:3, Interesting)
after making any intelligent weighted decision, the random number is chosen, if the number is 10 (or some arbitrary number in that range) the AI will then disregard the intelligent choice and choose some other descision with a higher weight (this could be random as well) and introduce a bit more unpredictability into the AI, and make them a bit more human, just as humans do random idiotic th
Re:Natural stupidity (Score:2)
Re:Natural stupidity (Score:2)
Re:Natural stupidity (Score:2, Insightful)
Pgms have indeed seen strange input. Worse since the invention of cut'n'paste.
But I don't think AI need handle all input, so long as it fails gracefully when out-of-bounds. I mostly object to ungraceful failure, especially failure disguised-as-success.
Ummm.. (Score:2, Insightful)
And... (Score:3)
AI a hot topic? (Score:2)
Employment of AI vs CS grads in game design (Score:3, Interesting)
Re:Employment of AI vs CS grads in game design (Score:2)
AI is probably the largest area of shortages for game programmers in the UK.
Re:Employment of AI vs CS grads in game design (Score:3, Informative)
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. A
Re:Employment of AI vs CS grads in game design (Score:2, Informative)
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
Re:Employment of AI vs CS grads in game design (Score:2)
Most of the AI people in the games industry I know were general CS background, and much like any task, read some books and some research before diving into the work. Same for the 3d programmers: not specialists in 3d in school, but instead something you learn when you need to/want to for a game project you're working on.
Nearly everybody in t
Enlightening and frustrating. (Score:5, Insightful)
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.
Re:Enlightening and frustrating. (Score:3, Interesting)
Screen resolution is a good example. The resolution of text on a computer screen is lousy compared to a printed page, but people spend so much time reading text off of their computers that they seem shocked that reading low
Re:Enlightening and frustrating. (Score:2)
Depends on the task at hand. We are the only species we know of that can reliably do arithmetic, yet a computer chip that literally costs cents can do it faster and more accurately. A relatively complex (only by today's standards) computer can regularly defeat grandmasters in chess, nevermind the rest of us. Machines also don't get tired or bored, and can remember many things more
Re:Enlightening and frustrating. (Score:2)
Sure, but when you compare the complexity of the completed machines with that of the human brain, it's clear that the machine is more efficient (same work in less time using fewer "parts"). That doesn't take away anything from the human brain, because as you say we created it. I see it as akin to creating hydraulic equipment that can lift far more weight than we ever can.
Re:Enlightening and frustrating. (Score:2)
Re: (Score:2)
Re:Enlightening and frustrating. (Score:2)
But you can't look them up quickly enough for practical purposes, just as a massive book of chess moves will not help you when faced with Kasparov in a real (timed) game.
That's very impressive of a computer.
Stop anthropomorphizing. Whatever is cool about a computer is better attributed to its creators: us. But yes, it is impressive how a chea
Mother Nature's not perfect, either (Score:2, Insightful)
Not really. People just keep raising the bar for what counts as "intelligence", redefining it to mean: "what people can do, and machines can't".
People who co
Natural machines: better because they are simpler (Score:2)
There are currently two approaches for AI, both wrong.
The first approach is to program the rules of the problem in a hierrarchical manner, through a series of 'if this then do that'. Of course that does not work, bec
Re:Natural machines: better because they are simpl (Score:3, Insightful)
For instance, in a racing game, the AI of the other drivers only should know how to drive the car. You don't need to give the driver a fullblown consciousness.
So you have to scale your AI approach to the game.
AI = Annoying Idiot -- Deserves To Die (Score:2)
Re:AI = Annoying Idiot -- Deserves To Die (Score:2, Funny)
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."
Comment removed (Score:5, Funny)
Re:Pong AI (Score:5, Funny)
Re:Pong AI (Score:2)
Re:Pong AI (Score:2)
Re:Pong AI (Score:2)
It's easy to shoot yourself in these languages, since you can have things like:
int x = 4;
if (x && !x) {
printf("This code will get executed.");
}
Re:Pong AI (Score:2)
are you insane!?!?
an AI like this could conquer the Earth!!!!!
Re:Pong AI (Score:2)
Re:Pong AI (Score:2)
And that's the reason AI is a tough subject today.
natural computer? (Score:4, Funny)
Does that mean you are going to run it on an abandoned 486 you found in the woods?
Re:natural computer? (Score:2)
Probably would have been better to say something like "...interest in modeling on machines those behaviors that we find in nature."
But then, what do geeks know about english grammar?
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.
Re:Game 'AI'... (Score:3, Interesting)
Re:Game 'AI'... (Score:3, Insightful)
I can imagine one great benefit of learning for games: the AI should determine when a player is using a single tactic over and over, and come up with a counter-tactic. That would fix one of the biggest reasons games get boring, which is you find some silly hole that makes winning too easy.
Re:Game 'AI'... (Score:2, Funny)
Yeah, I think we all know a lot of people like that.
KFG
Still AI (Score:3, Insightful)
Maybe we need some modifiers for games, Active or Static AI.
Re:Game 'AI'... (Score:2)
I disagree that learning is required if you have this: 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 :p
with *enough* human like characteristics I think the interaction would be more interesting and be "artificial inte
Re:Game 'AI'... - Farcry (Score:2)
IMHO there's two kinds of mistakes, coded or planned. The coded ones are like the bot who gets stuck running into a wall or messed up by a door. Not may games can allow you to purposely trick the AI. That's one of the things that I liked about Farcry. The guards were not super human. The guards could be tricked with a rock or some silence. They didn't make uber shot you in the head from the otherside of the map kills. They had to hear or see you to act.
The
Re:Game 'AI'... (Score:2)
I cannot imagine how much of a pain that would be to QA, or support.
Re:Game 'AI'... (Score:2, Insightful)
Similarly, it's difficult to make bots in FPS games that aren't completely stupid, but also don't headshot the player 100% of the time. Computer players will not miss unless you make them.
The problem isn't that it's hard to make computers sm
Re:Game 'AI'... (Score:2)
Similarly, it's difficult to make bots in FPS games that aren't completely stupid, but also don't headshot the player 100% of the time. Computer players will not miss unless you make them."
The "never miss" problem can be dealt with by making the b
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:2)
Simply turn loose the creatures in an environment, set an amount of time before they become able to mate, and then set loose predators to them (aka the player). As the player kills off the weaker of the
Re:Genetic Algorithms (Score:5, Insightful)
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.
Re:Genetic Algorithms (Score:2)
That's why mutations are introduced.
Re:Genetic Algorithms (Score:2)
Re:Genetic Algorithms (Score:2)
Consider a multiplayer game.
What you reward can be 'time-spent-alive-after-attack' or 'hps-of-opponent-dropped'
What you are optimizing for is the actions the NPC does in combat.
With the sheer amount of NPCs slaughtered, you have a large amount of test cases. (You could also do simulated NPC vs PC battles, by duplicating PCs and running AIs for both the dupped PC and the NPCs and letting the most successful reproduce).
Remember, computer worlds aren't the real world. In the RW, an organism must
Re:Genetic Algorithms (Score:2)
Point is, yeah, genetic algorithms are fantastic, but only with problems that are easily definable.
Re:Genetic Algorithms (Score:2)
Game AI (Score:2, Interesting)
What I'd Like in AI (Score:3, Funny)
Re:What I'd Like in AI (Score:2)
Benevolent?!?!?!?
zerg (Score:2)
(I never read the 2nd "AI Game Programming Wisdom"... laziness on my part.)
Or forget about all that.. (Score:2)
Re:Single vs Multi player (Score:2)
I have nothing against you getting great single player games, but I want my games to focus on MP goodness.
Where's the fun in pulling off a knife throw to the neck instakill against your computer? AI nev
AI today (Score:3, Funny)
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.
Re:Only Ten Years Away (Score:2)
> not very impressive mimicing
So true. I remember watching a video of the "Lord of the Rings" game and hearing the game producer saying "Look at this! The characters have actual feelings and personalities - they're actually happy about winning this battle!"
Come on, fellas. Don't mistake state tables and switch statements for feelings and personalities and intelligence. It's OK to be enthusiastic, but don't believe your own marketing materials.
Re:Only Ten Years Away (Score:3, Insightful)
http://scholar.google.com/url?sa=U&q=http://www.cs
The
Re:Only Ten Years Away (Score:2)
Consider the checkers playing program. How small, in terms of bytes, can the description of the AI that plays a game such as checkers possibly be? The AI for checkers uses n-square in the number of tiles on the board (64x64 = 4096), and uses more than one byte per node. It took an enormous amount of computing power to train those nodes. Suppose you could get it down to linear, so only 64 nodes,
Re:Only Ten Years Away (Score:2)
I mean, how well have we defined "real" intelligence, to be able to differentiate "Artificial"?
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
Re:SMB AI (Score:2)
Re:SMB AI (Score:2)
Another good one... (Score:5, Informative)
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)
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
Re:AI varies from game to game (Score:2)
No, it only costs one gold for the faction. And even then, it's only used to help campaign AI player (which is not capable of expanding beyond it's initial borders, among having other limitations.)
If this were true with a standard skirmish AI, then it wouldn't be possible to choke the AI from well-needed resources.
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'r
Re:AI varies from game to game (Score:2)
Anyone ran NERO? (Score:3, Interesting)
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 towa
Part of the problem (Score:3, Insightful)
Re:Part of the problem (Score:2)
I did the game AI for a few games (Score:2, Informative)
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 NP
not very good and been pimped here before (Score:2)
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)
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.
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.
Re:AI wont be understood... (Score:2)
Computers are not parallel enough to be able to simulate the brain. They would take a lot longer to complete a full "thought" than an equivalent human. They are only good at solving static problems in a tight inner loop (think chess) rather than open-ended consciousness.
However, I do think that the brain can ultimately be emulated just as any machine can.
AI doesn't have to be realistic to be good (Score:5, Interesting)
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:3, Funny)
Re:I just don't understand. (Score:2)
Re:Just for games? (Score:2)
The main reasons is because regular AI programming has higher standards - and generally requires a Masters to even consider doing anything serious. Placing a focus on a more advanced AI system world therefore need more Masters, which in turn requires a focus placed on education.
Game AI programming is much easier, since you just have to write an AI that always makes the best actions (e