Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Games Entertainment

Believable Stupidity In Game AI 378

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."
This discussion has been archived. No new comments can be posted.

Believable Stupidity In Game AI

Comments Filter:
  • by hal2814 ( 725639 ) on Wednesday March 18, 2009 @11:15AM (#27241877)

    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?!

    I'd love to see the difference in difficulty in Madden being the difference between playing a Jerry Glanville-coached team vs a Tom Landry-coached team. Instead, all increasing the difficulty does is make your opponents more talented but no smarter. Even on the highest difficulty, FBs don't understand their blocking assignments.

  • by rillopy ( 650792 ) on Wednesday March 18, 2009 @11:23AM (#27241985)
    Unfortunately, the AI generally only gets a tiny slice of the CPU time. If it were to use as much as the graphics, etc, then sure: the extra processing required to make the AI believably stupid would be easy. The innovations are there, it's just they are too slow or processor intensive to be implemented in most games.
  • by damnbunni ( 1215350 ) on Wednesday March 18, 2009 @11:27AM (#27242069) Journal

    How much of that is due to difficulty in writing a good AI for a fullback and how much is due to EA not needing to write a good AI for a fullback because there aren't any other football games left to compare it to?

    When you have a license monopoly, why try?

  • by hey! ( 33014 ) on Wednesday March 18, 2009 @11:32AM (#27242155) Homepage Journal

    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.

  • Re:Easy solution (Score:5, Insightful)

    by Aladrin ( 926209 ) on Wednesday March 18, 2009 @11:35AM (#27242199)

    You're joking, but having realistic actions like teabagging a defeated corpse brings a lot more illusion of reality than a lot of the other stuff they do.

    As for the article, I saw a lot of 'dumbing down' and 'intelligent mistakes' ... But I saw absolutely nothing about 'personality'. -That- is what makes an AI seem real.

    Take the poker example. If you just create 3 levels of players, bad, good, and perfect... There's no personality.

    Instead, you make different players: Cardsharp, timid bets, reckless bets, etc. In other words, you model the AIs after real player types.

    In other words, you're trying to pass the poker Turing test with this AI.

  • Re:Cheating AI (Score:3, Insightful)

    by TheRaven64 ( 641858 ) on Wednesday March 18, 2009 @11:37AM (#27242233) Journal

    A lot of these things are hacks to make the AI fast enough to run on the kind of machine that the game targets. For each enemy to have proper vision, you need to do ray casting from each enemy to the player (quite expensive, and very expensive with lots of enemies) and you also need to program them to model human behaviour when the person is occluded so that they guess where the person is. Alternatively, you can just do a distance check, which takes a dozen cycles, and have them able to track the person anywhere inside a sphere of a certain size.

    Red Alert did something similar. Rather that produce complex AI that monitored the entire map, each structure had a very simple rule-based AI which tried to make sure that the fighting force was composed of a certain percentage of each unit type (with the total over 100% so it was always short of at least one kind of unit). This cheated - being able to manufacture a different unit in each factory - but only to simplify the AI.

  • F.E.A.R. (Score:5, Insightful)

    by A. B3ttik ( 1344591 ) on Wednesday March 18, 2009 @11:41AM (#27242287)
    F.E.A.R. is the only game to date that I've played and honestly felt like I was playing against human opponents. Honestly, they were as smart as or even smarter than playing against people online.

    They did this through heavy use of waypoints and scripted events. If that's what you have to do to make it realistic, then by all means, do it.
  • by vadim_t ( 324782 ) on Wednesday March 18, 2009 @11:49AM (#27242431) Homepage

    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.

  • Re:Cheating AI (Score:4, Insightful)

    by Hurricane78 ( 562437 ) <deleted @ s l a s h dot.org> on Wednesday March 18, 2009 @11:53AM (#27242525)

    No. What should humiliate you, is the fact, that there is no "machine" "winning". There is only a machine blindly and incredibly stupidly processing a giant set of rules, created by programmers, out of a giant amount of knowledge of many many persons.

    So in fact you play a whole expert comitee that can every minuscule detail down to the stangest exception, in advance.

    Now if you win that, you win against them all, and are truly a genius!

    So how about that fixing your self-confidence issues? ;)

  • Re:Cheating AI (Score:4, Insightful)

    by snowraver1 ( 1052510 ) on Wednesday March 18, 2009 @12:15PM (#27242899)
    Civilization Revolution is terrible for this. If you play at the higher difficulties, they will spawn armies and keep sending them your way. The enemy players rarely attack each other. My G/F was playing this yesterday and one of the enemy cities would spawn close to 10 cannon armies in a single turn, then send them at the hevily fortified city to die. Next turn they did the same thing. There is no way that they should be able to build that fast.
  • Re:Deep Blue (Score:4, Insightful)

    by Swizec ( 978239 ) on Wednesday March 18, 2009 @12:26PM (#27243081) Homepage
    Kasparov had immortality to gain. In fact I'm fairly certain most people today remember him only as The First Person To Lose Against A Computer In Chess and have no idea who deep blue is.
  • by grodzix ( 1235802 ) on Wednesday March 18, 2009 @12:29PM (#27243141)
    Scripted behavior is a grand thing if used properly. Take for example Half Life 2 which has quite a lot of scripted scenes but it just makes ai characters come alive and pushes the whole game experience to a higher level.
  • by Animats ( 122034 ) on Wednesday March 18, 2009 @12:51PM (#27243471) Homepage

    That particular game programmer happens to have worked on games where perfect execution is possible. In chess, "execution" is moving the pieces; in poker, it's moving the cards. The game engine is expected to perform those operations perfectly. There's no "friction" (in the sense that Clausewitz used the term) in such games.

    That's not true of a combat game. Weapons have finite accuracy, as do humans; sometimes there will be a miss even if the shooter, human or AI, did everything right. Weapons can jam (America's Army simulates this.) Running characters don't necessarily follow their planned path; bumps on the ground and slippery spots can interfere. The AI has to face those limitations, too.

    Of course, if you make it too real, some kinds of games are unplayable. You can't really drive a car very well with a game pad or joystick. (Watch people driving R/C cars that way. They crash every few minutes.) In most console driving games, the CG of the vehicle is below the ground, to make the thing unreasonable stable.

    In my ragdoll-physics days, we'd made enough progress that a two-person martial-arts fighting game with real physics looked feasible. Then we realized it would be unplayable. "Your throw failed because your left foot was out of position. Further to the left. Again!" "Yes, sensi." Real physics in a fighting game would make gaming feel like a bad day at the dojo, although without the bruises. Most of your moves wouldn't work. A game with a learning curve like real martial arts, where you train a few times a week for a few years before you're any good, would never sell.

  • Re:Money (Score:5, Insightful)

    by fooslacker ( 961470 ) on Wednesday March 18, 2009 @12:53PM (#27243497)
    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.
  • Paradigm shift... (Score:2, Insightful)

    by mad flyer ( 589291 ) on Wednesday March 18, 2009 @12:53PM (#27243501)

    Maybe the problem lies in the fact that AI are programmed just to be opponents. While they should be conceived as game masters in charge 'also' of managing the opponent team but with consideration of the overall gameplay.

  • by skorch ( 906936 ) on Wednesday March 18, 2009 @01:04PM (#27243655)
    Sorry, but as you say I must almost completely disagree with your sentiment on scripted events in games. Scripted events are not good example of AI because there is no decision making, which makes them predictable and exploitable. So the only way to scale difficulty in a scripted scenario is to just pump up the AI's accuracy, damage, and health, which are not very interesting. Scripted events work fine for fairly linear narratives and setting up big cinematic set-pieces, but they don't make for interesting gameplay (mind you I did not say they don't make for "fun" gameplay).

    The events you describe in AvP are not necessarily examples of scripted scenarios, but sound more like a scripted set of responses to stimuli the player provides (would the AI react differently if you didn't rip off a soldier's head?). The trick for interesting yet realistic decision making is to allow the AI a range of responses that it can make, and then every time you present the same scenario to the computer you may get a different response. So when the AI is actually making decisions, rather than just following a pre-scripted path, this allows the player to make actual decisions in response, rather than just following their own memorized trial-and-error derived path to success.

    The key to a good scaling AI doesn't have to be that tricky, it can just be a matter of what range of choices you allow any given AI to make and what sorts of "mistakes" you throw in that pool of choices.

    When I face "easy" opponents in an FPS, I want them to use simple tactics (not just be unable to hit the broadside of a barn) like charging forwards blindly, or getting scared easily and retreating or even panicking, and being easily suppressed by heavy fire. When I face more advanced opponents, I want the range of their choices to move up the tactical scale to include flanking maneuvers, suppression fire, use of cover, and tactical retreats. A good mistake for an advanced AI would be to assume you're in the wrong position if you duck out of view and to attack that wrong position vigorously (as opposed to the omniscience a lot of AI's seem to have). They don't have to be any more accurate or need any more bullets to kill than an easy bot, but at least they could present more of a real challenge without artificially increasing their stats. Granted this is harder to do and would require actual programming rather than just increasing a few numbers, but that's the price for good AI in your game.
  • Re:Deep Blue (Score:4, Insightful)

    by Lord Ender ( 156273 ) on Wednesday March 18, 2009 @01:11PM (#27243775) Homepage

    Many people in the tech world only know Kasparov's name because of his battle with Deep Blue. His name will likely be in history books for this reason. I would say he did indeed have something to gain by competing with the machine.

  • Re:Cheating AI (Score:3, Insightful)

    by Cornflake917 ( 515940 ) on Wednesday March 18, 2009 @01:29PM (#27244081) Homepage

    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:

    I'm not necessarily saying that this is truly desirable from and FPS AI, but the top Counter-Strike players can do this and do this all the time. I played in a top-tier CS for a while and we learned where all good spots for shooting through walls were. The map "de_nuke" was notorious for having these spots. As CT'S we just listen for the T's, and if they were dumb and didn't walk, a spotter would announce their position, we shoot through the walls and we would generally get a kill or two and then get subsequently accused of hacking. If I were playing an FPS and I had good positional audio, I would probably do the same thing the AI did (without the perfect accuracy, but most FPS AI have randomized aiming too). Then again, you would be probably still be pissed, so maybe in this scenario the AI should have more random aiming when they use sound to determine your position.

  • Re:Deep Blue (Score:4, Insightful)

    by Kell Bengal ( 711123 ) on Wednesday March 18, 2009 @02:11PM (#27244665)
    You make a valid point. In 100 years, will people remember the name of a particular human chess player from year X? Maybe. In 100 years, everyone involved in AI and computer history will remember deep blue and Kasparov. By 'losing' he has written himself into history.
  • Re:Competing goals (Score:5, Insightful)

    by tnk1 ( 899206 ) on Wednesday March 18, 2009 @03:07PM (#27245637)

    I agree with this totally. One of the bigger reasons some players fail at a game is that they aren't actually playing the same game as everyone else.

    What I mean is illustrated by some post I read once where some jerk, who was also a rather good player, laid it out bare:

    Many people don't play the game. They invent their own little rules for what is "fair" or "better" or "morally right". This handicaps them. You win by playing the game and using all of your abilities and all of your assets to do so, no matter how "cheap" or "skill-less" they seem to you.

    If the game makes it so that some skill does more damage for less effort, but you prefer to use another skill because it seems "cool" to you, or you liked the animation or whatever, you deserve to lose.

    The one thing that this illustrates is that a computer also tends to have clarity of purpose. They are programmed to kill you. That is what they do. They aren't there to smirk or taunt you (unless that's in the script). They will not dance around or try and add finesse to their moves to look cool. They use the most efficient moves or actions to kill you. Or, sometimes, they only get a certain set of moves, but they are scripted to execute them in a certain manner.

    So, basically, by giving your NPCs a "personality" where their goals aren't to strictly kill you with Terminator-like focus, but perhaps to simply make you look bad, or use some moves that *they* think are cool, which really aren't all that useful, you can make them a bit more "human".

    The problem with most mobs is that you already know their motivation, so knowing what they will do next is actually rather easy to figure out. So, if you "cheat" with their AI, it becomes apparent to players that you either buffed or nerfed them artificially.

    If your mobs act in a manner where they are believably foolish, its a lot easier to handicap them and have a player believe that the handicapping is their lack of "skill", rather than you simply giving them less hit points or some absurd lack of resistance to one damage-type.

  • Re:Deep Blue (Score:2, Insightful)

    by bhagwad ( 1426855 ) on Wednesday March 18, 2009 @03:07PM (#27245639) Homepage

    Kasparov had immortality to gain. In fact I'm fairly certain most people today remember him only as The First Person To Lose Against A Computer In Chess and have no idea who deep blue is.

    Kasparov was the first World Champion to lose to a computer in a full fledged match with standard time controls.

  • by acohen1 ( 1454445 ) on Wednesday March 18, 2009 @03:37PM (#27246137)
    Agreed. Single player focused games (where AI is important) should be able to take advantage of modern multi-core cpus to let AI shine without interfering with graphics and physics. That and give me the option to set the AI the same way I set graphics options for performance or detect optimal configurations like many games do today on PC.
  • Re:Cheating AI (Score:3, Insightful)

    by bFusion ( 1433853 ) on Wednesday March 18, 2009 @04:26PM (#27246981) Homepage

    My problem with Crysis was that they had a specific limit to their "vision" I could stand outside that radius and shoot a guy until he died and he would simply stand there not moving. It was very disappointing for me.

    Maybe my game was bugged or something.

  • Re:Cheating AI (Score:3, Insightful)

    by LateArthurDent ( 1403947 ) on Wednesday March 18, 2009 @04:58PM (#27247497)

    No. What should humiliate you, is the fact, that there is no "machine" "winning". There is only a machine blindly and incredibly stupidly processing a giant set of rules, created by programmers, out of a giant amount of knowledge of many many persons.

    Well, to be fair, there's no "you" losing. There's only a biological machine blindly and incredibly stupidly processing electrical and chemical inputs, based on a set of rules created through years of evolution, and out of the stored memory and neural network training that you have accomplished up to date.

    Just because all of that has a high-order output display that looks like consciousness and thought is no more significant than the fact that the computer's display looks like a chess board. We're way more complex than the chess program, sure...it's probably not always going to stay that way.

  • Re:Cheating AI (Score:3, Insightful)

    by crossmr ( 957846 ) on Wednesday March 18, 2009 @10:31PM (#27251041) Journal

    Its not that fascinating. What makes human opponents bad is their inability to see the board and to think ahead more than 1-2 moves. The stronger a player is the more moves he can think ahead. If you want to make stupid AI, then you need to limit its depth, and give it a percent chance of missing things like pins, forks, skewers, etc. You could try to program some kind of tunnel vision. Like the beginner player who doesn't notice the bishop hiding down in the corner when he hangs his queen out to dry. You might also consider giving the AI a chance to "forget" to look ahead in some situations. Lower level players often get wrapped up in what they perceive as a good combination and when the opposing player does something unexpected with a non-obvious purpose they often ignore it and plow ahead. The same thing could be down for lower level AI in RTS games. Most bad players given time will build everything. Their problem is they don't have an optimized build structure, defense/offense strategy etc. They also get distracted and sometimes focus on something and forget about things. What they don't do is just stop at building mid-tier units. Which is often what lower levels of AI does. They make clicking mistakes where they click a wrong unit, or forget to select a unit in a group or things like that. they get wrapped up in attack or defending and forget to keep building/research. AI doesn't usually do this.

    These are the mistakes that AI needs to simulate. It shouldn't be hard. Just play a bunch of games against rank beginners and look at the kinds of mistakes they make then have the AI make similar mistakes. Anyone who wants to build a better AI for a game needs to spend some time observer real players of various levels and see what makes them that level. It wouldn't be perfect but using percentages to simulate real mistakes is much better than cheating AI or AI so ridiculously stupid your dead grandmother could beat it.

  • Re:Cheating AI (Score:3, Insightful)

    by nutshell42 ( 557890 ) on Thursday March 19, 2009 @06:58AM (#27253407) Journal
    The best shooter in this regard is Crysis.

    No, it's not.

    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.

    I only managed to play Crysis for a short time before the lack of immersion killed it for me and the enemy targeting AI was the main problem.

    • Patrol boats can see you through 20m of underbrush and will fire at you with gyro-stabilized sniper machine guns. It's ridiculous. Yes, they will only fire at you if they can "see" you but 1cm^2 of exposed suit is enough.

      Do a short test. You wear a black suit and sit in a dense forest. Your friend wears neon red and stands in the middle of an empty field. Even if there's a clear line of sight between you two, chances are you can see him and he can't see you.

    • The guards are even worse. They won't see you when they look at you while you stand in the middle of the road a few meters in front of them but fire an unsilenced gun and every guard within 5 miles suddenly has pinpoint accurate knowledge of your position.

    Crysis is a POS, it's pretty but the gameplay is grade A crap. MGS managed to have a believable AI for stealth gameplay more than 10 years ago. It's sad that Crytek burned through $30m for this joke.

There are two ways to write error-free programs; only the third one works.

Working...