Believable Stupidity In Game AI
Gamasutra is running a feature written by Mick West, co-founder of Neversoft, about creating game AI that is dumb enough to defeat, yet intelligent enough that its "mistakes" are similar to those a real player would make, thus preserving the illusion that the AI is not just throwing the game.
"The simplest way to introduce stupidity into AI is to reduce the amount of computation that it's allowed to perform. Chess AI generally performs billions of calculations when deciding what move to make. ... The problem with this approach is that it decreases the realism of the AI player. When you reduce the amount of computation, the AI will begin to make incredibly stupid mistakes — mistakes that are so stupid, no human would ever make them. The artificial nature of the game will then become apparent, which destroys the illusion of playing against a real opponent. ... By reducing the amount of computation, we create an AI opponent that is trying to win, but has been crippled in a way that leads to unrealistic gameplay."
Actually I don't have much issue with the quality of AI's used in games, but I don't like that so many of them cheat. A few games of gotten it right, but many AI's can track my movements through walls. In order to defeat the AI, I have to figure out how it works and so I'm constantly aware it has superhuman abilities and I find that very distracting from the realism.
Dont confuse it with Artificial Ignorance
So, basically, we have to determine how many "calculations per second" equivalent an average human can manage. Then we have to allow a range on either side of that since not everyone has the same capacity. Once we manage that, game AI would start being more realistic, huh?
Somehow I doubt it's that simplistic but still sort of interesting.
You know the thing about UDP jokes? I don't care if you get it or not.
What I've always wanted to see is more scripted realism in games. For example, the Medal of Honor games worked much in the same way as a Disney theme ride with certain prescripted actions occuring when you passed by. Run across the field to the house, then the soldiers there will go through a scripted sequence of planning the next move, then they do so. You walk past the far side, a German tank triggers and comes crashing through at you. These are all nice starts. The original Aliens V. Predator game would have the human opponents freak out at random. You tear the head off of someone beside the soldier, he might drop his weapon and run screaming or start spraying the walls at random. And the most unsettling of all were the civilians who would run, cower and cringe away from you, the alien monster.
All of the above are tricks, not real intelligence but things that provide the illusion of intelligent agents engaging in realistic behavior. Critics will say the heavy scripting ruins the replay value because there's not as much room for variation and surprise but I think that it makes the games more interesting. Unfortunately, not many people go to the effort here.
I for one would love to see a shooter where I burst in on the room of baddies playing cards and see them fumble for their weapons, someone drops his, etc. It would be very realistic to have an enemy get the drop on you but his gun jams and he's left trying to clear it when you engage. As mentioned before, AVP created a sense of realism when the humans freaked out and started firing randomly.
When we get right down to it, players aren't looking to get their asses mercilessly beaten every time they play. Neither do they want a pushover opponent. Gamers want to win but they want to feel like they had to earn it. It's rarer to find gamers who want to push the working for it to masochistic levels but they do exist. They would be typified by Rogue fans. For those who don't know, Rogue is a dungeon crawler where you really should save your game except you can't except as a bookmark -- you can save it to come back later but if you die the previous save point is deliberately deleted. You have to beat the game in one go through.
The only other game I've encountered that masochistic is Escape Velocity Nova, a space exploration and trading game with a realism mode. You die in the game, you die for keeps, you have to start over. To its credit, it does offer a vastly different play style. For example, you want to hit a big pirate ship for max profits, you pick a world near where they spawn and land. Each time you launch local space reloads and a pirate might respawn nearby. You have maybe a one in ten chance of taking him as a lowly player but it's fun. You keep reloading and rolling the dice until you win and you get a nice haul. If you play it in hardcore mode, you have a vastly different approach to this sort of thing. For starters, you lose your ship and it's gone, you have to buy a new one. If you lose your escape pod, you're dead. You will take a vastly different approach tackling a monster like that when you risk losing hours of progress. This seems too much like work to me but some people love it. I think they're the same ones drawn to high-risk PVP games like EVE Online. I think it's a form of gambling addiction, the risk of possibly losing a lot of stuff and the thrill of making it through.
Kwisatz Haderach
Sell the spice to CHOAM
This Mahdi took Shaddam's Throne
Year after year, I read these kind of articles that report how game AI increases in leaps and bounds...and I still don't see it. Bad guys in GTA still seem to rush towards grenades, Halo/Gears of War enemies are either completely impulsive or avoidant. I'm not knocking the programmers...I think game AI must be very difficult to achieve, and even harder to detect for the layman (such as myself).
Does anyone have an example of really good AI in action games (or any non-RPG, non-RTS games)?
(-1, Raw and Uncut is the only way to read)
Fritz has a sparring mode which does a little better than that. It will find a route that sets up a position where the player can force a win of a piece or a pawn. Essentially it sets up a tactical middle game puzzle live in the middle of a game.
The player doesn't know when it will do this or even if it will happen at all. But it is most likely to happen when the player puts the computer under pressure. This is great because it teaches the player to press the computer and coordinate pieces while also constantly keeping an eye out for the wins.
The whole chessmaster series features near-perfect play alternating with just flat out dropping pieces.
Even with Fritz though, "easy" mode is still well above beginner.
t
My first rule of game AI is that the computer should have access to the same information and controls as a human player. I hate games where the computer knows about your units and buildings that it hasn't scouted.
The big advantage that computers have is that they can micromanage every unit with 100% efficiency. One way to reduce skill could be to limit the amount of attention the computer can spend, maybe in the form of "actions per minute". For a game like poker that could be a limit on how precisely the computer player calculates odds. A more experienced human player has a better feel for the game, so a more skillful computer player could dig deeper into the nooks and crannies of probability.
A way that computers often act too stupid is not accounting for how their interactions with one player will influence other players who aren't directly involved. For example, in a three-way game the computer player might throw everything against the strongest player, weakening them both and letting the third player win. Humans have millions of years of instincts for dealing with such situations. So the game AI might need to precompute some game theory and adapt to opponent reactions over a series of many games. Then it could be dumbed down by reducing its use of that experience and acting more like a newbie human player.
If you want an AI to make human like mistakes, you have to have at least a roughly human cognitive model. The simplest way to do this, it seems to me, is to give the AI competing goals. Rather than just have the AI "try to win", and then cripple its ability to do that effectively, you could give it multiple goals to strive toward, and then give it some degree of randomness in which goal it chooses to pursue. Victory vs. pain-avoidance, attack vs. finding time to recover, etc.
If this were a karate match, this would be the equivalent of the master having to fight someone he's never met before, but that person has studied the master's every move. Then, after the master wins the fight, he has to fight someone else who has studied his every move and acts differently. Not a fair fight.
Not exactly, the GP seems to be discussing a probabilistic system weighted against success. You'd only get dramatically stupid moves on a regular basis if all possible moves were weighted equally, if you weight the best moves the most and the worst moves the least then you will not get "dramatically stupid" outcomes very often.
Having played many fighting games, and hundreds upon hundreds of hours of the Guilty Gear series in particular, I can safely state that this guy has no idea how people are trying to think in high-level gaming. Let me explain.
In high-level gameplay of things such as Guilty Gear, there are theoretically a huge number of choices that one could make at any given time. However, several of them are stupid as hell. Of those which aren't stupid as hell, there's a sort of weighted rock-paper-scissors game where you weigh the advantages and disadvantages of each move, along with whether or not your opponent should expect each move, given your previous gameplay.
Computer AI almost always chooses the safest move. Either that, or it deliberately chooses a bad move. Sure, this emulates bad play at lower levels of play, but that's when you can't even do a hadouken with 99.9% accuracy. People like that are bad at the game, and as you rise higher in skill you will stop making those mistakes.
For more information and better explanations than I could ever come up with, check out David Sirlin's website.
I think that to act more human, AI characters behavior needs to be multilayered. Include modes such as:
-Transitional deer-in-headlights mode
-Panicky fight-or-flight mode
-Tactical aggressive
-Strategic defensive
-Ambush/Camping behavior
-Random/unexplainable/opportunistic urges
In the AI research community, Deep Blue isn't even seen as interesting. It was all about "beat Kasparov", and contributed little (if anything) to the field of AI.
It just showed that if you had deep enough pockets you could buy hardware to do enough conventional AI calculations to compete on a search problem.
A fullback's running assignment is one of the most conceptually easy AIs to write. Run in front of the RB and knock as many people down as possible before they get to the RB (or until the RB passes you). If they can make a reasonably sane QB AI, they should have no problem with a decent FB.
As far as monopoly, the Madden fullback AI was a Rhodes Scholar compared to the fullback logic in the 2K games. At least the Madden FB doesn't go running off to the other side of the field based on how the D is stacked. And don't get me started on NCAA 2K2's misuse of the word "flex." Flex is not a damn blitz! Flex LBs are supposed to sit back and plug holes, not free-for-all the QB. And that's coming from someone who preferred the 2k series.
It's interesting that they say this actually. I'm a terrible chess player not because I don't 'get' the game, but because I'm not very patient. So I tend to do fairly well playing speed chess, but doing very, very poorly in a normal game. I tend to just get tired of evaluating the possible moves after a while and just make whatever one was the most promising out of the few that I did think about.
Isn't that sort of the same thing as limiting the number of calculations? In this case limiting the calculations would replicate the stupid moves that I (as a human/meat popsicle) would make, assuming that the order in which the computer evaluated possible moves was decided using more or less the same set or priorities that I would use (which are also probably stupid).
So the trick to coming up with a "realistic" AI opponent for chess might be more about figuring out how a human surveys the board and in what order they evaluate the moves. You can replicate the behaviour of dumb humans (like me) just by cutting off the evaluation at some very early point and scale up the difficulty by extending it.
It used to have hilarious consequences as AI cars behind the spinning-out-of-control AI car would crash into it, deflecting and causing a complete pile up.
This gameplay felt realistic because this is what happens when cars are travelling at high speed in close formation.
Newer versions of Gran Turismo on the Playstation 3 - have way more computation cycles and so the AI cars now drive a whole lot better and never seem to crash. Sure they take different lines into corners and so on - but they don't completely bollox it up like the human drivers often do. It has made the game pretty infuriating because it has taken a randomness factor out of the game.
i'm not involved into any of these activities, but i know Kasparov as a great mind and chess player because big blue won against him.
and thats probably what the history will remind us.
Eventually, a human would have been beaten anyway.
Once you have that, you could start giving games meaningful measures of difficulty: such as "This game is suited to players with a GI greater than 80"
It would then be interesting, if not useful, to see how people's G.I. varied, and if their GIs correlated (or negatively correlated) to any other metric, such as SAT scores. Even better, you could determine people's personalities by how their GI changed with different types of game.
You never know, this might put the social "sciences" on the brink of coming up with objective, measurable and relevant data
politicians are like babies' nappies: they should both be changed regularly and for the same reasons
There are many variables that determine how successful someone is in taking a shot. I could see a game having a simple database with records for each AI character. It could hold values ranging from the very basic and universal (avg # hours this character spends in target practice/week, how much sleep did they get last night, how long have they been awake, etc.) to more "fringe" variables (excessive coffee drinker, drug user, hangover from last night, laser-targeted sights in use, etc.). All of those could count toward their base accuracy/reaction time.
Add into that more variables based upon the current situation. There was a spy RPG many years ago (can't remember the name)that took into account how you were positioned when you took the shot. Your accuracy started at a base number and then dropped as you went from prone to kneeling to standing to running. +acc for steadying yourself against a structure was also a factor.
From there you could get use the db to get into the "personalities" of each AI opponent. A coffee drinker who didn't get his cup that morning might be in a nastier mood and walk over and shoot you in the face once your down. A timid variable might mean a bot who hides behind a wall waiting until you pass to put a bullet through your head than one who runs out of a darkened doorway, guns blazing. Ammo count and readily available supplies could also be taken into account.
I'm really a low 5-digit Slashdotter, but this ID is where I am now.
I guess so, maybe in a way, but it's not like people are saying, "Kasparov, what an idiot!" It only looked bad for the humans-will-always-be-better PoV, without really reflecting on Kasparov individually. The man didn't lose any esteem over this, or at least shouldn't have.
Oh, and perhaps a motivation in his favor would be curiosity. It's just plain interesting that a computer was eventually able to win.
I read about in college. Kasparov did ask for the transcripts. However the Big Blue team told him no. Basically saying it would give Kasparov an unfair advantage because he could study Big Blue's moves and deconstruct the algorithm it used.
Bah. It depresses me how bad the AI still is in FPS games after I made my own bots for CS years ago (when I didn't have a decent internet connection - when I got broadband I stopped making the bots). My bots had different personalities, can't remember if you specifically had to specify rusher/camper/whatever or if it was just a certain courage level, but you could specify obedience level (for responding to radio commands), weapon preferences, ability to use grenades, aiming skill (higher skill levels would use more controllerd fire and be more likely to HS you on the first shot, while lower ones would start at about chest level then just spray and pray), whether they were able to look sideways to check for enemies down side alleys as they were running along a path etc, all per bot so you could create awesome bots (modelled on myself and my friends :P), and noobs, etc. In the last incarnation they were starting to pick up knowledge of stuff like where they had killed enemies or died themselves which affected their 'courage' and how likely they were to start sneaking around or rushing (made a big difference because you can't hear walking enemies in CS and the bots respected that). Those were the days.. AI is fun, at least for games like Counter-Strike.. it's not quite so much fun for stuff like board games..
If anyone still has CS 1.5 and wants to try them out they're called TEAMbot and one of the last releases is still up at http://www.planethalflife.com/teambot . I probably still have the latest version of the source on one of my old HDs..
which is totally what she said
he computer *always* knows exactly where you are and can make a perfect shot if it wants to
Not all games behave this way. It's certainly the easiest way to do it, but some games will look at each mob and try to determine what actions they will take based on realistically available conditions. This is tricky to do well because it's hard to code in the ability to act sensibly when searching for you, or to try to guess where you are based on previous information. (he ran around that corner. Maybe he's waiting just around the corner, or maybe he's flanking me, or maybe he's heading toward the objective while trying to stay out of my sight?
it's annoying to be playing a game and see on the radar all the mobs are taking the most direct route to your position. And then when something happens that blocks their route, (you hit a switch to close a door, or climb a ladder they can't climb, etc) they all as a group instantly head in a new direction, the new shortest possible path to get to you, without having any chance of seeing what happened to block their prior path.
I work for the Department of Redundancy Department.
Why did Kasparov agree to compete under those circumstances?
Money. $500,000 just for playing, with an additional $200,000 for loosing or $300,000 for winning.
My suggestion: An AI should be coded as a bot, within the constraints given to the player. If the player can only see a part of the battlefield (like in Starcraft) then the AI should have the same limit and need adjust its own viewport to gain awareness of an area. It should also be limited by the fog of war, and lack the ability to see out of the back of its head. To put in another way, a fair Starcraft AI would be one implemented with a camera pointed at the screen, controlling only the keyboard and mouse inputs.
While this is a very good idea, it's very difficult to implement well, and it's been tried plenty of times. I've played games that attempted that, but as a result were very easy to beat. For example, you could start an attack on three fronts, and the AI would ignore all but the top two threats, and the third front would just walk all over them. Every single time.
The fog of war is usually done by a simple radius check. if you are running from something and you are faster, once you get more than 1.5 screens away, you can see on your radar they immediately break off the attack and go regroup. Or you know the exact limit of how far away you can build your forward base that they won't "see" it and come maul you while you're digging in.
Though I 100% agree that the computer's unlimited ability to micromanage is the one reason I can't stand playing RTS against computers. I can't micromanage anyway, so I still get tooled by real players, but against the computer it's totally futile. I think the computer should be limited in where it can make changes. As in, it can change its "focus" every 20 seconds, and during that time can only make changes within that screen-size area. That's how humans are restricted for the most part. If they want to know where other units are, they have two choices: rely on memory of thins they've seen or they need to invest one of their 20 second slots in "reviewing" things before they can pick a new area to focus on.
I work for the Department of Redundancy Department.
Take poker for example. We have a standard bias of "unknown = 50%". This actually works pretty well for cases where information is not known. To make the winning software programs, they basically program in the rules that a human expert knows to be true. It is NOT that hard to instead program in a bunch of rules that a human FOOL 'knows' to be true. Just find some bad poker players and ask them what they do in certain circumstances.
-------------- Similarly, the pool game could be made more realistic. I noticed the first thing he did was have the computer select the highest possible point scorign shot, ignoring banking a shot unless it is set to super-expert. That is NOT what humans do. Bad pool players pick the EASIEST shot - i.e. the one that is most straight on and least distance. (I know, I am a bad pool player). As you get better, you raise your standards about what you think you can hit. So a moderate player looks among all the shots he thinks he can hit and takes the highest point one of that.
excitingthingstodo.blogspot.com
it's like once your cover is broken it's broken
I hate that. Some are better than others - the original Far Cry wasn't too bad, you could hide out for a while and watch the soldiers beat the bushes fruitlessly, but they were always jumpy after that, especially the sniper in a guard tower two miles away who could see you no matter where you were in the bushes.
I have also found STALKER: Shadows of Chernobyl with the Oblivion Lost mod running has pretty believable AI patterns, the enemies usually can't see you if you can't see them and you can evade them, sneak around them and set traps for them. Enemy factions fight each other, mutants fight soldiers and you can sit back and watch and loot corpses afterwards. But once again, every once in a while you get a supernatural sharpshooter who can hit you with that pistol from two blocks away. The mod also introduces some really strange spawning issues - getting killed by a horde of mutants the second you load a new area really sucks.
On the flip side, games programmed for stealth can result in a hilarious breakdown in NPC programming patterns when you don't sneak. I really enjoyed Thief: Deadly Shadows but the game is just awful if you're not playing as a hardcore thief. Once your cover is blown, it's blown. And if you defend yourself, God help you. They can see you in the dark, people freak out in the streets when they see any dead bodies and sometimes they start fighting each other or humping the wall. And sometimes the enemies had Daredevil hearing, other times you could jump on their heads and they wouldn't even notice you.
That's just a bad implementation. There's no reason why an AI couldn't ocassionally spend a while to look at its territory. Also, the human player usually has a map, and notifications (like an unit popping up to report "We're under attack!"). It's fair to have the AI have access to that as well.
That's not fog of war, it's just a limit on how far they'll pursue you. And it makes perfect sense too. Otherwise it's trivial to exploit. Take a fast unit, drive it to the enemy base, get a tank or two to pursue you to your base, where they get pummeled by the base defense. Do that a few times, and the enemy is 10 tanks down.
The game that came closest to my ideal of what a RTS should be like is Total Annihilation (haven't tried Supreme Commander, so can't compare). The sheer amount of automation you have access to (waypoints, automated production, patrolling aircraft, automatic base repair) and long range defense means that achieving parity with the AI is perfectly possible.
The only problem is that the AI turns out to be too weak. Once you've got a good base going, finding ways to gain advantage is easy. But it seemed to be a step in the right direction.
As far as Thief goes, you have to admit at least that it was very good for the time. Making it hard to win in a fair fight made sense for the game, especially since it was one of the first sneaker games, and they kind of had to smack you over the head to let you know that you weren't supposed to run-and-gun through the game. If you didn't want to sneak, then you simply picked the wrong game.
Also, I was remembering Thief as a game that rightly didn't follow the "once your cover is broken, it's broken" thing. It was more like, if they saw you, you couldn't simply run into the nearest shadow and be safe. You had to evade them first, sufficiently that they wouldn't particularly know where you were, and then hide in the shadow. The effect wasn't perfect, but certainly you could get back into hiding after being discovered without killing the person who saw you.
I don't know what I'd think of Thief if I played it now, but at the time, it did seem to be some of the most interesting AI in a FPS, if only for how limited the enemies' knowledge was.
Human behavior is naturally variable, for example, a pro basketballer can still and will miss a hoop. Likewise this variability allows amateurs to have some luck. Indeed an elite gamer will occasionally have their ass handed to them by a complete noobcakes. We don't see this in game AI, which is ruthlessly consistent.
It's interesting that in order to create better AI, we need to create Artificial Stupidity. Some would argue that is already all around us.
After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
I totally agree with you, for the time the first Thief was great. I think the AI was actually better than the one I was referring to, Thief Deadly Shadows, third in the series (which used some form of the Unreal engine, probably a reason for some of its AI issues).
In fact, the first game is still good, even if the graphics are on the ugly side, the play quality makes up for it. It consistently follows its own rules, and like you say, it is possible to elude guards chasing you without killing them. In Thief 3 this is also possible, but there was far more glitchy behaviour than in the first two games.
I'll try to keep this on topic.
That would be great if the folks from Looking Glass Studios could get back together for another Thief game. The team was great at creating an atmosphere and NPCs and enemies that responded in believable ways, I'm sure if you looked closely at the programming and responses in Thief 1 they would be more primitive than, say, Far Cry, but they hold up even now because their responses were consistent and believable. Shoot out a candle you'd get "hmm, that's odd" but start doing too much at once and they would start getting suspicious. At least, that's the way it appeared while I was playing it, so they succeeded in making a believable "stupid" AI. The enemies in System Shock 2 (another Looking Glass game) were just as good, it freaked me out listening to the service droid blabbing away while it stalked me in the storage room, looking for an opening to run at me and explode. And who can forget the ninjabots. Scary, sneaky dudes.
I admit I liked Thief 3 (come on, shooting guys in the face with moss arrows was cool), it was great as long as you played it on the hardest setting (so the missions and sub-missions and crap you would find and NPC comments would actually make sense) and as long as you didn't start fights in the street. That's when the AI would break down.
One of the best AI examples I've played against was a quakeC bot written to learn just as a player would. The bots had no knowledge of the map nor any information beyond what a human player could garner, but they learned everything they were exposed to. So the first encounter was an easy kill. Later encounters became progressively more difficult as they learned to avoid your fire and learned to anticipate your dodges. In the end, they would memorize all ammo and health spawn points and times such that you could never defeat them as they would starve you out if you were good enough to go toe-to-toe in a firefight.
The same AI applied to the enemies in the regular quake game resulted in the best (and least fair) enemy ever. The first guy I failed to kill ran away and got help. I didn't see any enemies again until they had me surrounded by all of the enemies on the level. It was brilliant. And unfair, and undefeatable. Still, watching them learn how to defeat me was pretty interesting.
That also points out the problem with FPS AI. If they really had any degree of intelligence, they'd duck for cover and call in backup and you'd get pinned down pretty quick.
He probably enjoys a real challenge? Also the reason why he went into politics and placed his life on the line against thugs?
Starbucks, Harbuckle of Breath.
What I didn't see discussed in the article is the alternative of not increasing the AI and exploring deeper paths in order to choose a weaker move, but to, you know, actually change the algorithm to match how a human would arrive at an action.
For example, in the case of a FPS, instead of having perfect accuracy and omniscient awareness of every opponent, the computer could use search algorithms to look in front, up to a reasonably human visual range, taking into consideration any obstacles in the way which will affect the computation. This way, the AI player is not artificially ignoring opponents behind walls and bushes (while tracking every single one of them), but is instead realistically not even aware of them--just like a human would not be aware of opponents hiding in the environment.
As for the accuracy, it could certainly be affected by random probabilities (like occurs in real life), but also by other environmental and stress factors. For instance, if the AI player is a sniper in hiding, and it seems apparent that the opponent hasn't become aware of them, then they have a natural advantage. But if they are in the open, and running, their accuracy should be affected negatively. Also, if the opponent happens to be farther away, or slightly masked by environmental obstacles, or moving fast, this should decrease the accuracy.
I know that I get very frustrated when I play games that give the appearance of perfect awareness of the environment, even when they don't really. As the article mentions, even when the computer opponent gains an advantage by pure chance, any previous appearance of omniscience adds up and distracts from the illusion of "humanity" or fallibility. It just does not seem like a fair challenge. It also feels rather stupid when the AI has been artificially crippled and then compensated by pure brute force; like when you get attacked by a few gazillion zombies at once, any one of which being insanely boneheaded in its individual moves, but all of them running towards you simultenously, giving you little chance to aim or escape.
-dZ.
Carol vs. Ghost