Slashdot Mirror


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."

20 of 378 comments (clear)

  1. Cheating AI by Anonymous Coward · · Score: 5, Interesting

    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.

    1. Re:Cheating AI by je+ne+sais+quoi · · Score: 5, Informative
      I ran into that problem just a few days ago playing Far Cry 2. I was sneaking into the airport to assassinate a character who was in a hanger... As I'm walking around the outside of the hanger towards the entrance, I hear pistol shots at the wall to my left. The AI detected me walked around outside the hanger while he was inside and with perfect accuracy, started trying to shoot through the wall at me. That's the sort of problem this article was about:

      In pool and in shooters, the computer AI is blessed with an omniscient accuracy. The shooter AI knows down to the billionth of an inch exactly where you are, and could shoot your hat off your head from five miles away. Similarly in pool, the AI knows the position of every ball and can calculate where every ball will end up before it takes a shot.

      The solution I found fascinating:

      The programmers of Fritz [a chess program] hit upon a solution that involved the AI deliberately setting up situations that the human player could exploit (with some thought) that would allow the human to gain a positional or piece advantage. Once the human player gained the advantage, the AI would resume trying to win. At no point here is the AI actually dumbed down. If anything, there is actually quite a bit more computation going on, and certainly more complexity.

      So the idea is that the AI needs to calculate precisely where you are, and then rather than hit you if the preferences are set to "hard" or miss you on the "easy" setting, probabilistically make a decision based on what a weaker or stronger human player would do. It's was a great read!

      --
      Gentlemen! You can't fight in here, this is the war room!
    2. Re:Cheating AI by Vectronic · · Score: 5, Interesting

      I think that's largely because AI is generally controlled as a group entity, so there is one main master pool of data that they get information from.

      When what should be done, is that each AI is IAI or something, individual artificial intelligence, which can be done with object masking, and an analysis of what the AI can see in it's perspective camera, or it's range to a sound, instead of all players and sounds being a dot on a grid, with no regard for obstructions and range.

      Little more on topic, I don't really mind figuring out how the AI is working, what I dislike, is like hard-coded faults, usually with waypointed bots in FPS type games, where they will always get stuck at the same spot on that same path. Because then I abuse it, i'll lead them there, wait for them to get stuck, and kill them... lotsa fun for 15 minutes, but the game gets really boring quickly, however I actually like the superhuman AI as long as they still have to abide by the rules I do (not shooting through walls I can't, etc), makes for great practice.

      I generally don't play games for realism, but rather for the lack of it, I can't go out collecting coins from trees, or shooting my neighbours "really"... excluding racing/flying simulators, but usually they don't have much problems with realistic AI because of how many variables there are to "fuck with", most, if not all of which can happen in reality, sudden gust of wind, punctured tire, blown engine, etc, perhaps thats what humanoid AI games need, is more variables to be more realistic. Different eyesights, hearing, reaction times, strength, etc, etc, then slightly randomized variations on them during the same match, so that even a hard-coded fault in the AI wouldn't come to the exact same result, humans don't play by constants, why should AI.

      Now that i'm rambling, I'll end with the fact that most games are multi-player now, so they spend more time working on the human interaction with the game, and the AI is just tossed in afterwards, probably carried over from v1.0, just so they can say it has that option, expecting people to want to play people. As a side note, maybe thats the logic behind some of them, make shitty AI, to try and force more people to buy+play the game so the game is useful.

    3. Re:Cheating AI by Nick+Ives · · Score: 5, Interesting

      FC2 was notorious for the enemies ability to see you through anything, they clearly didn't even attempt to solve the perfect aim / x-ray vision problem.

      The best shooter in this regard is Crysis. The enemy AI can only see you over long distances if they happen to look in your direction through either binoculars or a scope and if you can't see them they can't see you, even through bushes.

      --
      Nick
  2. This must be stopping Duke Nukem Forever by ndavis · · Score: 5, Funny

    This must be the problem facing the team creating Duke Nukem Forever.

    They needed the AI to be dumb enough so you could hear the comments all the time during the game.

  3. Re:So stupid no human would do that? by hey! · · Score: 5, Funny

    Hmmm. Possibly this is a sign that TFA was written by an AI agent. Asserting that there are mistakes that are too stupid for for any human to make is a mistake that is too stupid for any human to make.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  4. AI leaps and bounds? by Gizzmonic · · Score: 5, Interesting

    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)
  5. No Human? by chrispycreeme · · Score: 5, Funny

    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 author has obviously never played chess with me.

  6. Re:Interesting thought by MBCook · · Score: 5, Informative

    That's not what I got out of the article.

    What I took away was have your opponent play it's strongest, but make exploitable situations for the player. Make a pool shot so they human starts in a good position. Make a chess move that, while beneficial, opening a big possible hole for the player to exploit. Make the FPS bot run for cover at the wrong moment, but not randomly/suicidally.

    (those are all from the article)

    Basically make the AI make human like mistakes (mistakes in strategy) instead of "computer like" mistakes (just lowering their accuracy, not looking far ahead, etc).

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
  7. Re:Interesting thought by MobyDisk · · Score: 5, Informative

    Actually, he is saying the opposite. He is saying that by reducing the number of calculations per second, you create an unrealistic opponent. Instead, you must do additional calculations to model the mistakes that a human would make. Our problem is not that we don't do enough calculations, but that we make mistakes in our calculations. We are inaccurate, we jump to conclusions, we get excited, or calculate one branch of the tree very deeply while ignoring another one. Those types of things are tough for computers to do.

  8. Competing goals by olclops · · Score: 5, Interesting

    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.

  9. Stupidity is a component of intelligent behavior. by hey! · · Score: 5, Insightful

    And vice versa.

    One thing that is stupid: trying the same things that failed in the past.

    This is a component of smart behaviors as well. If you don't know what to do, try something and watch very carefully how it fails. If you are in a desperate situation and you are going to definitely fail through inaction, then try an action which failed in the past and hope you get lucky. Or vice versa, when the action that usually works looks like its going to fail, try doing nothing.

    Animals freezing in the face of danger is an example of this. It's not much of a defense, but you might get lucky. Maybe the prey a couple animals down the line will get itchy and draw the predator's attention.

    On the other hand, smart behavior can be a component of stupidity. If the red button gets you a treat 80% of the time and the green one gets you a treat 20% of the time, the intelligently stupid thing is to push the red button 100% of the time. The stupidly intelligent thing is to try to work out the pattern of red/green rewards.

    If you want realistic model of stupidity, provide the NPCs with a range of decision making strategies, all of which work to some degree, but the better of which take more effort (computation). The NPC can choose between the strategies with a random function weighted towards the better strategies, but as time and "stress" come into play the function can shift towards the easy but less effective strategies.

    That's a pretty good model of human performance "choking".

    Evolution did not produce human stupidity because it was useless, after all.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  10. Re:Deep Blue by Evanisincontrol · · Score: 5, Interesting
    This has been mentioned before, but I think it's worth bringing up that Kasparov wasn't facing Deep Blue under fair conditions. Even ignoring accusations of cheating and whatnot, there's two very important facts to consider:
    • Normally when a grandmaster plays in a chess tournament, they are givens months of advance warning. The grandmaster will study hundreds of game transcripts, studying their opponent's style and looking for weaknesses. (The opponent will also be given the grandmaster's game transcripts). Deep blue was given Kasparov's transcripts, but Kasparov was given nothing.
    • IBM modified Deep Blue after Kasparov won his first match. This meant that, after finally learning how Deep Blue played (on the fly!), Kasparov basically had to play a brand new opponent.

    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.

  11. NP-tard? by illegalcortex · · Score: 5, Funny

    Do we have programmers that are smart enough to program stupidity algorithms to be smart enough to be as stupid as humans?

  12. Here's what I'd like by vadim_t · · Score: 5, Insightful

    A computer that plays on equal terms.

    AIs often win in some games not by the virtue of being smarter, but by having an unfair advantage. Examples:

    • In RTSes, constant money injections. This pretty much nullifies attempts to attack resource collection -- they don't need it anyway.
    • Knowledge of the position of everything. In RTSes, they don't need to discover your position. It's useless to try to build an outpost and hide the real base somewhere behind it. In FPSes they know where you are, and can tell when you're sneaking from behind
    • Instant reaction time and all-encompassing awareness. In RTSes, the AI is capable of controlling every unit at once, and knows what's going on in the whole map at once. Meanwhile, the players are limited in the speed they can give orders, and only has a view of part of the world. Due to this, the AI can't be fooled by multiple attacks from different places, it will see all of them perfectly.

    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.

    The idea is that I want to be beaten because the AI is indeed smarter, not because it's got a superior access to the battlefield I can never gain.

    Chess probably comes closest to the sort of thing I want -- the AI and human are fighting on very equal terms. I don't see the calculating millions of positions a second as a problem, that's simply an implementation detail.

  13. Re:Deep Blue by Evanisincontrol · · Score: 5, Informative

    Why did Kasparov agree to compete under those circumstances? Did IBM pull something nasty on him at the last second or did he just want to play Deep Blue badly enough that he agreed anyway?

    Well, I don't know Kasparov and I'm not a history expert, but I'm willing to bet that because he beat Deep Blue in 1996, he just figured he could do it again with no problem. He probably underestimated how much Deep Blue had improved, but that's just my speculation.

    I don't know Kasparov's motivations for playing Deep Blue at all, honestly. Beating Deep Blue wouldn't have won him any fame ("Oh look, he beat a computer. Computers suck at chess anyway."), but losing would look bad for him. He had nothing to gain and plenty to lose. I know after he lost the match, he demanded a rematch, but IBM refused and put Deep Blue out of commission. IBM had nothing to gain by beating Kasparov again, and their stocks had already started going up when the news got out that they had beaten the grandmaster (to their great pleasure, history did indeed forget the shady details I mentioned before, just as they hoped).

  14. Re:Deep Blue by Anonymous Coward · · Score: 5, Informative

    At the time that Deep Blue was being used, there was more of a focus on brute force search than tricky AI game play. Deep blue searched an average of 130 million nodes a second using a iterative-deepening alpaha-beta search, sometimes able to look 40 moves ahead. IBM declined a rematch after that game, but thanks to improvements in AI, a standard desktop PC running improved search algorithms is now a suitable match for even a grandmaster.

    Deep blue also contained an 'opening book' of 4000 positions and 700,000 grandmaster games indexed.

    Source: Artificial Intelligence A Modern Approach: Russell, Norwig

  15. Re:No human would ever make them... by rickb928 · · Score: 5, Funny

    "Oh, the humanity! Football games drive me nuts when the AI does stupid things no real person would ever do. Why the hell did my fullback just brush by the linebacker that's right in my RB's way?! Why can't I get my linebacker to stay in his lane on running plays?!"

    Gee, you sound like a real life coach. Certainly like my High School coach.

    I'm thinking the AI is working like it should here. You got your disgruntled, not getting paid enough FB who isn't taking the hit, and your linebacker who thinks he's smarter then your Defensive Coordinator and is freelancing with visions of stardom in his head.

    Realistic this is, I think. Patience, padiwan. Trade you must. Draft you will. Beware of anger.

    --
    deleting the extra space after periods so i can stay relevant, yeah.
  16. Re:Money by fooslacker · · Score: 5, Insightful

    Why is this debasement? Playing against a machine even in unfair settings is still a challenge. The goal isn't to pick only fights you can win but to test yourself and do something new and experience something new.

    As for it being "unfair" it wasn't touted as fair it was a computer v grandmaster experiment not a ranking test.

    The only shady part in my opinion is the refusal for a rematch. If the man is willing to play on uneven ground and give his time (even if paid) to your stunt then you should have the courtesy to let him challenge/redeem himself.

  17. Re:Deep Blue by josh61980 · · Score: 5, Interesting

    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.