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."
F.E.A.R. , short for First Encounter Assault Recon .... University of Alberta GAMES (Game-playing, Analytical methods, Minimax search and Empirical Studies) .... called STRIPS (for STanford Research Institute Problem Solver)
Combine that with such gems as:
players view the virtual world from the perspective of the characters they manipulate, making Counter-Strike an example of what's known as a first-person-shooter game.
and I'm not sure that belongs here.
Then again, maybe I'm just bitter that I still can't beat GNU chess.
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.
-
...that chess-playing programs are also brute force.
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"
If modern games are an indication of AI, then they're obviously smarter then we can hope.
Just today, the AI in Far Cry 2 spotted me at long range after 1 shot with a sniper rifle, proceeded directly to me, despite heavy foliage for cover.
Color me impressed. Even Sherlock Holmes would be proud of how quickly they deduced where I was.
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)
So what they're saying is simplify and use heuristics? Hasn't this been done for years now. One some level every single game out there does it because you can't model the real world 100% and the state you're considering is therefore simplified. What they're saying is simplify further by considering a subset or creating a model of the model that makes up the full game.
In the case of simplifying further, isn't this exactly how a chess engine works?
In the case of making a simplified model, I'd be surprised if lots of simulators didn't already do this - the trouble with this approach is that your simplified model may not behave well (ie. as expected) under certain conditions and even corner cases can break the illusion pretty badly.
These posts express my own personal views, not those of my employer
If you're deciding between "intelligent" and "beatable" then you're not talking about AI. An average person far outclasses, in any sufficiently complex game, a computer in the area of general intelligence. Knowing the physics equasions for a certain hit, being able to throw a hundred commands per second at your unit, having 100 percent perfect aim, these things don't involve intelligence. A game that can, without cheating beat a person on equal footing will be intelligent. I don't think there are any.
If video games influenced behavior the Pac Man generation would be eating pills and running away from their problems.
http://ca.youtube.com/watch?v=F7pjw8vs6Ug
I guess I would spend my time babbling about AI at conferences instead of actually getting my shit working if I had Microsoft spending ten million bucks buying reviews and saturating the press with marketing.
more boring weighted graph walking. Stuff displayed by games are incremental technological improvements but not actual AI/cognitive science that will lead to strong AI. e.g. the game developers (whether that's chess, go or FPSs) don't have any motive to solve the symbol binding problem, so the machine doesn't even know it's playing a game. /want/ to pull off a clever flanking maneuver, or understand what it's doing any more than your computer "wants" a DVD when the drive opens.
There was a primate intelligence documentary on PBS a while back which paraphrased concluded with "perhaps they're intelligent. or perhaps our interpretation of their behavior says more about us humans as social creatures perpetually seeking to ascribe intent to actions than it does about them" The machine didn't
Let's hope they don't take their research from game AI too literally. Most game AI i've seen is programmed to hunt and kill the player.
Use silver instead of copper. Silver is an excellent conductor, better than copper in fact. That will surely baffle all those copper thieves.
Rome taught me patience and assiduous application to detail. Virtues which temper the boldness of great, general views.
The difficult part of AI design is that is has to be tailored to the game type you're playing, or even the specific game if it has some unusual elements (trying making an AI that could play Portal, for instance). A* and other algorithms have got pathing down, but one of the major flaws is we are still using nav-pathing (where you basically draw lines on the ground that tell the AI where it can go) even in newer games like Crysis. This leads to fairly flat movements. So one of the challenges is getting bots to "see" the surroundings, since I've also seen them shoot through stuff like thick foliage in Far Cry 2 since they don't actually see it.
On the coordination end, I think multiple algorithms can be applied. If we want to look at a military simulation of some sort, let's have a fireteam. The fireteam has a sergeant leader, of course. As long as he is alive, his AI calls the shots and is pretty controlling with it. However, if he's killed, then the remaining soldiers might become confused or each start trying to control the situation. Just like in a real fight, it might devolve into chaos. That is one option. The other is that there is a second-in-command or something else who takes command, but his AI isn't as good since he's not as good of a leader.
And by "good" I mean tactically sound. That's one thing that's rarely mentioned in AI: mistakes. AI as it stands doesn't make mistakes. Obviously at the level we were at with chess we just wanted it to make the best choice and prove it could do it. now, we want realism. And realism is that we, as humans, make mistakes. We run out when we should be under cover, spray bullets when we get surrounded, and do a lot of other behaviors that can be hard coded into each AI construct. This is more than movement orders: it's how they respond to the state of the game. If you can simulate the emotions behind the player, you'll get a better, more realistic AI.
Let's take L4D for example there (and I realize this is a long post, but I'm a CS major going into AI Game Design so it's kind of my passion lol). The Survivor AI is terrible, not because it's a bad shot or doesn't move well (it just follows you around like a good teammate I guess) it's that, when I get pinned by a hunter away from the group, they IMMEDIATELY come get me, no matter how pressed they are with zombies. That's not how I see other players react. They tend to take care of their zombie problems then come help me. In a case like that, you have to playtest and watch your players. Code their methods of approaching the game into your AI.
It's not a matter of just being "smart", it has to be realistic to feel like a good challenge. That's why a lot of people prefer multiplayer so much: the opponents are humans. Make an AI that acts like that and you'll see people turn back to single player games a bit.
Must'nt the purpose of this be to develop a computer AI that will emulate a human player perfectly enough that you can not tell whether you are playing against a human or a machine?
Like a multiplayer game turing-test?
if human player is sneaking up behind computer player.
If so I have a very simple solution.
ALGORITHM:
1, Computer player can see any human players and automatically headshot them
1.a, across the entire map
1.b, when human is completely behind computer player and siltent/sneaky
1.c, hidden behind a wall or other obstacle, in which case computer bot can shoot just straight through any onstacle or wall.
2, If, unlikely, computer bot health drops below 50%, computer bot will get automatic insta-health-boost back to 100%.
2.a, Computer bot by design can never drop below 50% health. Not even by multiple rocketlauncher hits straight in the face. Computer bot can however take out 90% of your health from the other side of the map, even with 10+ walls separating you.
Any player that invokes this rule and temporarily drops computer bot below 50% is immediately headshot killed. Even if on the other side of the map.
3, Computer bot has a loop of 5-10 different curses a 12 year old thinks cool and uses this to continously spam any and all voice channesl. Repetably. Forever.
Using a sub-teenage voice.
Would just be exacly like playing against real humans on xbox-liv^H^H^Hcrap.
If you cant tell the difference between man and machine, thats kind of the definition of the turi ng test...
I finished your research to perfect online-gaming turing-test. Please send nobel-Prize here >.
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
AI in games is approached the wrong way: instead of finding all the game states and choosing the best path, a far better approach is to apply statistics and do pattern matching. In fact, brains work with the latter method, not the former.
The problem with game AI isn't that we can't make better AI, it is that we don't make it a priority. Todays machines are powerful enough to give us good visuals but not powerful or memory spacious enough to really devote resources to too much beyond that. In Mass Effect I want to say we devoted something like 75% of the memory budget to textures, and we still had to downgrade the textures before the final ship. I don't know what the final stats were, but I wouldn't be surprised if about 90% of the budget was allocated to textures and polygons.
That's not to say if you were to quadruple the memory on today's machines that AI would suddenly improve drastically, though. Many teams don't have the resources to devote to programming, so they need to take whatever is in the package. There's room for some entrepenureal spirits to create snap in AI programs, like what Havoc does for physics. Get started now, and you may have a refined product ready for the next generation of consoles.
As an animator, I just want to point out that most anything smart you see in a game is a scripted sequence. An AI marine flipping a table and taking cover is mostly animation work. The only real code there is is a simple set of conditions that determine if the animation should be played and then some state changes to coincide with the animation. The measure of an AI isn't what kind of cool things it can do, because that's animator work, it's how quickly it figures out what it should do, and how well it figures out the quickest way to do it. When you see AI running out in the open, taking the long route to cover, getting hung up on corners or doing circles, that's bad AI.
To give credit (and blame) where credit (and blame) is due, designers choose what kind of behaviors that are possible, so they too are highly responsible for the final appearance of the AI. If a designer neglects a cover system, then it can make even an intelligent AI look stupid by just having enemies stand in harms way. If a designer includes a visceral chainsaw attack, even a poor AI that gets a kill can still seem impressive.
Back in High School, I had all of the latest games. You name it, I had it. They used to call me "Modern Game Al."
Lo and behold, years later I see an article named "A Look At Modern Game Al" I felt so special.
"Modern Game" Al Perkonkey
It neve ceases to amaze me that that while science is fiercly opposed to God or Theology infiltrating science as a process, in AI development they almost "assume" that intelligence was crafted by a God.
COMPLEX BEHAVIOR IS EMERGENT, NOT DESIGNED.
In AI development they seem to assume that the proper development of AI to to be a God and design a system or method of AI that accomplished a specfic set of goals or objectives.
Day after day evolution is a truth in science, and thats fine; but when it comes to AI development I swear they have never heard of evolution.
Your behavior is a result from a wide and largely independent array of inputs.
Your eyes don't make any decisions and aren't designed for decision making, they're input.
Your feet, lungs, and regions of your brain operate as a COMPLEX INTEGRATED SYSTEMS OF INDEPENDENT FACULTIES.
This is a much larger problem then the specifics of the task at hand. We are talking an organic development model for AI rather then a deterministic method. That is the largest flaw of Computer Science. Computers are largely deterministic devices, intelligence, isn't deterministic. A determinstic method of AI development is doomed.
You have to evolve the AI. The AI needs to know the limitations of it's organism for proper development.
Light, Dark ...
Up, Down
Here, There
Friend, Foe
Move from A to B
Find A Weapon
Assess Threat
Attack or Flee
etc...
The very process of evolving the AI api in an organic model give the model itself the ability to ignore irrelevant data by feeding abstract and generalized data up the cognitive food chain with irrelevant data dying off early in the process. If the general data is insufficent then the AI simply asks it faculties for more specific input.
OUT - I WANT TO READ HAMLET
IN - BOOK SHELF NEAR, OBJECTS FOUND ON BOOKSHELF, ASSUME RECTAGLE OBJECTS ARE BOOKS
IN - BOOKS OVER THERE ON THE BOOK SHELF (RECTANGLE OBJECTS CONFIRMED AS BOOK)
IN - BOOK ON TOP SHELF IS ABEL (Binary Search fo the book shelf)
IN - BOOK ON BOTTOM SHELF IS ZEUS
OUT - LOOK IN THE MIDDLE OF THE BOOK SHELF
IN - FIRST BOOK IS HOUSE OF M
OUT - GO BACK A FEW BOOKS TO THE LEFT
IN - FOUND BOOK HAMLET
OUT - GET BOOK
IN - TOO FAR AWAY
OUT - MOVE CLOSER
IN - I AM NEAR THE BOOK
OUT - GRAB BOOK
IN - LEFT ARM WON'T MOVE
OUT - USE RIGHT ARM
IN - I HAVE THE BOOK IN HAND
Additionally AI evolves with the organism itself (physical charactersitics influence mental development).
The reality of an AI is they need to be compiled or GROWN to fit the organism (say a terrorist or counter-terrorist in Counter-Strike)
BASE FACULTIES + ORGANISM DEFINITION + CIRCUMSTANTIAL OVERIDES + GAME PLAY OVERIDES = Source Code for AI
AI Complier then builds out an organic, almost B-Tree like info passing\storing pipelines based on the limitations.
A creature with no eyes would never have to process visual data. In that case distant objects are irrelivant except for memory storage.
My Prediction: AI isn't something that is developed, it's something that is Grown.
You define it then compile it.
-=[ Who Is John Galt? ]=-
By the way... modern chess engines have an effective branching factor of about 2 (certainly less than 3)
There may be 36 moves available in a typical position, but the engine will almost always have enough information to examine the best move first or second, and then rapidly refute all of the others by proving that they are inferior to the fully-examined first move (i.e. a beta cutoff).
The effect is that it only takes about 2 full plies of extra depth to get a decent strength improvement (50-100 ELO).
Here are two great examples of using evolving neural networks to drive game AI:
Nero:
http://nerogame.org/
Galactic Arms Race
http://gar.eecs.ucf.edu/
They're both the brainchild of Kenneth Stanley.
His current research can be seen here:
http://eplex.cs.ucf.edu/
wooosh at mods
That was a line from clerks 2
Instead they use R.C., Real Cheating.
Did you know 80 to 90% of the moderators on slashdot wouldn't recognize a troll even if one dragged them under a bridge.
I have pragmatically programmed predator behavior, based on a instinctive behavior matrix which considered creature energy level, anger, hunger, time of day, proximity of food, proximity of other predators, success of prior encounters, etc. Predators could also sense the environment over a limited range. This produced a composite behavior probability which translated into the energy put into prey acquisition and tracking. Available pathways to food (links in the game network) also applied difficulty levels. It' not quite AI, but it did provide a degree of uncertainty as to how often and vigorously the predators attacked.