Latest News
spacer View All spacer
 
March 11, 2010
 
GDC: Refenes' & Saltsman's Baffling $350 App Store Success [6]
 
GDC: Q&A - Sony Studios' Yoshida On Move Development [4]
 
GDC: Sony's Motion Controller Is 'PlayStation Move' [27]
spacer
Latest Features
spacer View All spacer
 
March 11, 2010
 
arrow Your (Brief) Guide To GDC 2010 [4]
 
arrow Battlefield Logistics: A Bad Company 2 Interview [6]
 
arrow The State of Agile in the Game Industry [16]
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
March 11, 2010
 
Pole To Win America
Test Lead (English / Japanese Bilingual)
 
Blizzard Entertainment
Senior Software Engineer, Gameplay, Next-Gen MMO
 
Blizzard Entertainment
FX Animator, Next-Gen MMO
 
Blizzard Entertainment
Dungeon Artist, World of Warcraft
 
Sledgehammer Games / Activision
Development Director - Environment Art
 
Blizzard Entertainment
Senior Graphics Programmer, Next-Gen MMO
 
LucasArts
Senior Multiplayer Programmer
 
Blizzard Entertainment
Software Engineer, Server, World of Warcraft
spacer
Blogs

  7 Ways to Make Your AI Smarter
by Robert Hale on 06/24/09 05:18:00 am   Expert Blogs   Featured Blogs
5 comments
Share RSS
 
 
  Posted 06/24/09 05:18:00 am
 
halflife2351Prompted by this article over at Bit-Tech on How AI in Games works it made me want to blog about some of the ways you can make your enemy AI appear smarter without having to re-write your AI back end or invest in expensive middleware.

SCRIPTING

A huge amount of what convinces us a game has good AI is often completely scripted. Nothing ruins the illusion of AI like the Level Designers treating them purely like cardboard cutouts or filler. What the AI is doing before they start fighting is just as important as what happens during the fight.

My favorite reference for believable AI scripting are the No-One Lives Forever games. Yes you couldn't go more than ten yards without stumbling on a pair of AI guards having a conversation but it adds so much to their characters that you become far more forgiving towards them.

The arrival of an enemy is a great opportunity to make them seem smarter than they really are. AI that Rapel down a wall before fighting you or who shout for backup when they see you causing two more enemies to sprint around the corner. These are almost always scripted events but most Players will attribute it all to the AI.

Even just adding Patrol routes or some good ambient animations can make a very simple AI character appear more inteligent.

FEEDBACK

AI that don't tell the Player what they are going to do before they do it look stupid.

In Half Life the Soldiers would always shout "GRENADE!" before they threw a Grenade at you. When they shouted "Flank Left!" an AI would always run out of cover moments later.

You are making your enemies appear as if they have goals and that they are trying to fulfill them. If the player doesn't know what the AI was trying to do then alot of their actions won't make any sense. If a Soldier just ran out of cover then the Player would assume the AI is stupid for leaving cover. By preceeding it with the command "Flank Left!" the enemies behavior is given a context that makes a stupid suicidal manouvre appear inteligent. Your enemies don't have to actually Flank anybody. They just need to say that they are before they move somewhere else. The Player will assume the AI is trying to do something very clever when they are really doing something immensely stupid. It's all about context.

Above all else AI that are talking to each other and the player appear more Human. The Grunts in Halo would have seemed very stupid if they had never said anything. Instead you always knew what was going through their tiny minds as a result of your actions.

ACCURACY

If your enemies carry guns then don't turn them into Storm Troopers (unless they ARE Storm Troopers in which case it's OK). While the Player should have an advantage ov er the AI in terms of accuracy making the AI too inaccurate will just result in them looking stupid. If the player realises that they can just stand still in the open while they pick off the bad guys with a single headshot each then their sense of immersion will be completely broken.

Below is a video I made when we were making Wheelman to indicate just how "Stupid" AI can appear when they are inaccurate. The good stuff is at about 1:50.

Playing Half Life 2 Unsympathetically (YouTube)  

If you want your AI to miss then put some effort into making them miss believably. If they are using automatic weapons then have them group their shots in a burst and have the entire burst miss. Don't just spread the shots out in a cone around the player because it's much more noticable.

If the Player is standing still in the open looking at the enemy then the AI should tear the Player a new one.

LIFETIME

You can have the most inteligent goal-oriented perfect-pathfinding AI enemies in the world but it doesn't count for anything if the Player is killing them before they get to do any of that clever stuff.

The biggest difference in Halo between the AI in Easy mode and Legendary mode is that in legendary the AI has more health. This meant they lived longer and as a result did more cool clever things making them appear more inteligent. They were also more accurate and did more damage which supports my previous point.

Adding health isn't the only way to increase your AI's Lifetime (and you may not be able to get away with it contextually) but there are other ways to make your enemies live longer.

  • Enemies that can Blind-Fire are harder to kill while still presenting a threat to the Player.
  • Make the Players weapons less accurate meaning they have to work harder. Too much aim-assist is a bad thing.
  • Allow enemies to break-out of Hit-Reactions quickly. If your Hit-Reactions are too long then you often only need to land one hit to neutralise the enemy. The remaining hits are a formality.
  • More Enemies at once mean that even though Individuals die quickly the others are showing off in the meantime.

ROBUST

If I had to choose between Very Clever buggy AI and Very Simple Bug-Free AI I will always pick the Simpler choice.

Every time an AI gets a Path wrong or does something slightly unpredictable (in a bad way) is another notch against your AI appearing smart.

Half Life 2's Combine AI is really simple but also very effective. Their basic behavior is to move towards their target shooting at them if they have line of sight. When they need to Reload they will move to a position where they can break line of sight.

That's roughly 80% of the Combine AI right there. It's incredibly simple and copes with just about anything you can throw at it. Because it's so robust it rarely goes horribly wrong and the Player can build a mental model of that enemies behavior very quickly that is always right.

When the AI behaves how the Player predicts then the AI is perceived as being smart because they have fulfilled the Players expectations of them. When the AI exceeds these expectations it's even better. However the most important part to nail first is that the AI never falls short of them.

MANAGE EXPECTATIONS

Human shaped AI are the hardest to get right because as Humans we have very high expectations of their behaviour. We interact with other Humans everyday so Human AI in games needs to fit into an existing Mental Model informed by our life experiences, TV, Films and all sorts of other crap.

Aliens, Animals, Robots. All of these are far easier to make appear inteligent because our Expectations of their behaviour aren't preconceived or at worst much lower. Nobody knows how a Strider is supposed to act before they start fighting one. You can infer a bit from the way they look and move but they are essentially a blank slate. A Strider can behave however Valve wants them to and so long as they are Robust they will appear inteligent.

If Halo's Grunts had been Human shaped then their AI wouldn't have seemed as clever as they wouldn't have matched our preconceived expectations of how Humans behave. Don't underestimate just how much leeway using non-Humans will buy you.

LEVEL DESIGN

Bad Level Design can make good AI look terrible. It is the job of the Level Designers and AI Programmers to ensure that everything in the game is working together to create the best experience possible. If you spend six months crafting cautious cover using AI and all the Levels in your game are empty warehouse deathmatch levels then your AI isn't going to look good.

Make sure that Levels are playing to the AI's strengths and vice-versa.

 

The above article was originally published on http://www.agamesdesignblog.com on March 9th 2009.

 
 
Comments

Michael Kowalski
profile image
Great read and with some great pointers. Defiantly going to use these from now on!

Blake Nicholas
profile image
"Feedback" I think is your best point, the rest are common sense or just not good. Your worst point is probably "Lifetime", I think more enemies extending lifetime is the way to go with that one. There comes an annoyance point if the player continuously shoots an enemy and they don't die or the enemy just barely dodges bullets continuously. A single shot to an enemy should be enough given that they are humans. A shot to the leg or arm should set them up for failure instead of them being able to "break-out" of it and carry on fighting as normal.

Increasing the number of enemies is the best way to add lifetime in my opinion because each death is like a win for the player, and cluster deaths with explosives are just that much more rewarding (especially if explosive weapons are limited). So allowing them to manipulate the battlefield in such a way where what they do matters is a lot better than having an enemy "break-out" of a burst of fire and continue running to their cover so that they can hide there for 10 seconds while you shoot at his buddy that again breaks out of your fire and goes and hides for 10 seconds while the first enemy pops his head up for .5 seconds to tease you and just as you put your crosshair on them the second enemy pops up from his cover, so you say "fine I'll just leave my crosshair where your head pops up" and they just sit there for 30 seconds doing nothing. Finally the player realizes that the AI is cheating and they aren't going to pop their head out while the crosshair is even remotely near where they pop out so they take the crosshair and put it nowhere near either enemy and suddenly both enemies run out at the player at which point the player shoots them again, but of course they "break-out" of the hail of bullets and run back to their cover to repeat the cycle all over again.

Now as you said I'm willing to look past that kind of AI if the enemy is an alien or something, but for human opponents or even humanoid opponents to do that is annoying. If they're soft skin and bullet penetration doesn't affect them the way it should then my expectations aren't met.

Justin Heyes-Jones
profile image
I did some more in my blog.

http://justinsboringpage.blogspot.com/2007/10/avoiding-ten-common-game-ai-mistak
es.html


Luis Guimarães
profile image
To my player eyes, Bioshock seems to have the best* AI off any game, cause the enemies are just such... they dont "know" they're NPCs of a game, they speak, they have nice scripting sequences, they know how to balance offensive/defensive behavior, and they run to the healthpacks :D

André Martins
profile image
Nice article!

Makes me think about how the level design could affect the AI and abour the feebacks we have to put on the game to make the player aware of the things that will happen.


none
 
Comment:
 


Submit Comment