Skip to main content

Making friends

Eurogamer investigates the complex world of companion AI.

Games used to be such hostile places. Dropped behind enemy lines or sneaking through monster-infested caverns, everyone you'd meet on your journey seemed to want to kill you. Over the last ten years or so, there's been a gentle rebalancing, however. From Pey'j to Yorda to Al Vance, designers have started giving you friends as well as enemies.

Friends - and I'm talking about AI friends here rather than good ol' co-op buddies - are hard to get right. One glitch, one twitch or one short jog against a wall, and you cease to believe in them. That's why for every game that throws in an NPC you'll remember for all the right reasons, there's another where things don't go quite as planned.

You don't need to look far to see just how tricky this sort of design can be. I'm reading between the lines, obviously, but from The Last Guardian to Spielberg's mysterious LMNO project and perhaps even Irrational's forthcoming BioShock Infinite, games that feature strong, story-supporting AI characters seem to face some fascinating challenges.

This isn't surprising, of course. It's hard enough for designers to create enemies that prioritise targets and flank properly for the minute or two in which they remain alive. Chucking in characters who stick with you for an entire game - and can, you know, act while they're at it - must be orders of magnitude more difficult.

Beyond Good & Evil proved that a huge part of building a decent companion character is nailing the catchphrase. 'Say when, Jade!' 'Carlson and Peeeeeters!'

To find out a little more about the fascinating world of companion AI, I had a chat with two practitioners of this mysterious art: Neil Wallace, a senior AI programmer from Lionhead, who's worked on everything from the creatures of Black & White 2 to Albion's villagers in the Fable series, and Ninja Theory's Tom McKeown, the senior programmer who helped make Trip and Pigsy such memorable parts of Enslaved: Odyssey to the West. I wanted to know what differentiates companion AI from the rest of games AI, and what kind of hurdles teams are up against when creating such complex characters.

"I think there's actually a spectrum of what could be classed as companion AI," suggests Wallace, when asked about how broad the field can be (and whether I'd gotten the terminology right). "You've got your guys in shooter games who are just there as back up, and then where it gets really interesting is games where the companions have more of their own personality, and more of their own agenda." Do both of these present very different challenges to, say, traditional enemy AI? "Absolutely," he says. "Enemy AI has a lot less of a thought process going on inside it. It's just thinking about the tactics of the situation. It's not thinking about how it's feeling or what it thinks of you. With companion AIs, that's what they're all about: having some sort of thoughts about the player, and thoughts about their own internal state. I guess that's what makes it difficult, and that's what makes companion AI so susceptible to going slightly awry."

The sheer range of Wallace's companion AI work has shown just how wide the spectrum is - and how tricky it can be to get even the simplest of relationships working between players and NPCs. Take the Fable series, for example: Albion's approach to interaction might lean heavily on pantomime tactics, but there are still some astonishing things ticking away in the code. "Certainly in Fable 2 and 3, the NPCs all had quite a complex system of opinions of the player on various axes," he explains (and he means axes as in the plural of axis, thankfully). "Whether they find him funny or are afraid of him, whether they loved him or hated him, whether they thought he was attractive or unattractive. These things would be based on things the player did, but then filtered through the NPC's personalities. Some of them, if you threatened them, they'd be more attracted to you - although I think that was an issue we actually chose to remove. A better example would be that some people find you being funny attractive, while other people find it unattractive."

That's AI for a relatively linear action game. Enter a sandbox and the complexity only increases. Wallace knows about this sort of thing, too, as it happens, due to his work on Black & White 2. Compared to Fable, Lionhead's god game is a far more open-ended experience, and its AI had to support that sense of playfulness. The end result was creatures that were fascinating - but often rather confusing as well.

God or no god, you'd want these weirdoes on your side.

"They were very much at the they-have-their-own-agenda end of the AI spectrum," laughs Wallace, "and it did make them unpredictable in some ways. I think that's actually what made them charming, though: they were unpredictable, so you were never quite sure which way they were going to go.

"They tried to look at how the player was playing, and they based some of their learning on those things rather than explicit feedback," he explains. "They'd look at what the player was doing, in other words, and try to base their own behaviour on that. They also had quite a complex internal state of desires that they'd try to satisfy: everything from physical desires like hunger, thirst, tiredness, to emotional things like anger, happiness, sadness. It can definitely be confusing, but a player's willingness to put up with confusion very much depends on what that character's role is within that game. Because the creature in Black & White 2 was a part of that sandbox, just finding it interesting was much more of an acceptable outcome. Whereas if that character was your partner in a first-person shooter, that would be disastrous. You want predictability and something that will support you, rather than something that's off just eating villagers and that sort of thing."

Good point. Contemporary games frequently aren't that interested in the emergent possibilities of interacting with AI, by the looks of it. They're far more concerned with allowing their audience to play through a story alongside a character that feels like a kind of virtual co-star. You don't want Elizabeth in BioShock Infinite to learn from your actions and begin looting corpses for stray cash, for example. You want her to hit her marks and help in fights and start contextually appropriate conversations. You want her to blur the lines between in-game action and cut-scenes. She's an AI actor - and this brings with it its own difficulties.

McKeown's spent a lot of time thinking about just this sort of thing. During his work on Enslaved, he was responsible for creating AI characters like Trip and Pigsy, who would be standing right alongside the player through cinematics, puzzles, and battles alike. No pressure, then.

Pigsy and Trip may look fairly different, but their AI routines had an awful lot in common, apparently.

"Trip could have been an escort mission for the entire game, and we knew people would find that hugely frustrating," he says. "In response to that, we didn't try to do anything too cutting edge with AI. We wanted everything to just be really robust, and then you wouldn't end up creating situations where you couldn't get Trip to do the things that were required and so you ended up getting annoyed with her. That was the key to it, really."

McKeown raises another interesting issue: getting an AI character to feel right seems to be something of a balancing act. Make them too weak, and the game turns into that dreaded escort mission. Make them too powerful, and you risk reducing them to the status of a chatty kind of smart-bomb - a hero lurking down on the D-Pad for when times get tough. "That's a big part of the challenge," he says. "Trip was always intended to be a weaker character that you would have to help through the game, and we didn't want to put too much into her abilities for that exact reason. The powers we gave her in the end were more to prevent player frustration - that's where her EMP weapon came from. It's a last ditch effort if you do make a mistake."

"Trip could have been an escort mission for the entire game, and we knew people would find that hugely frustrating."

Tom McKeown

Beyond that, and even with the studio reining itself in, Trip still highlights the challenges inherent in having an NPC around for so much of a game. "There are long sections where AI characters are playing without any enemies around," explains McKeown, "and you want to have different behaviours to make them more believable in those situations. Then, in situations where there are enemies around, self-preservation should take over. There are certainly more behaviours with this type of AI, and it's crucial to get each and every one of them robust so that you can avoid that frustration.

"For me one of the most important things that we spent a lot of time trying to get right was character movement alongside the player," he continues. "In some games you kind of see a shuffle: the player moves and then everyone follows that exact line in single-file. That was something we really tried to avoid. As much as possible, Trip's trying to run alongside Monkey and actually be on camera. That was something that was quite important for us, and perhaps not what you see in a lot of games with a buddy character."

Elizabeth promises to be one of the most fascinating aspects of BioShock Infinite. That only raises the stakes for the coders and animators, though.

Complicating matters, of course, is the fact that AI frequently needs to be blended with scripting - with moments where the designers drop in and take more direct control of companion characters. This is particularly crucial for games that involve complex storytelling and set-pieces - and with sophisticated AI, everything can become a set-piece if you're not careful.

"This moment's always difficult," admits Wallace. "What happens is that you generally almost turn off the AI completely as they go up their script control path and do what they need to do, and then they're released back to their AI.

"Sometimes it's more complex, though," he adds. "In Fable, you might say, "this guy isn't able to fight, but he is able to flee," and offer some quite high-level controls over the AI when necessary. In general, though, when you need that level of control, it's best to shut down AI completely. Otherwise the two systems will just be fighting each other for control."

These changeovers often become moments where the cracks start to show, and they raise a question that strikes at the heart of the problems that AI designers face. Is there an uncanny valley for AI? Is there a moment where you get so close to seeing an AI as a convincing character that even tiny glitches become disproportionately jarring?

"Absolutely," sighs Wallace. "And I think the big issue in AI is that there's a general lack of fluidity when moving from one action to another: they'll walk to a point, they'll turn to face an object, they'll do something with that object, and it's all very robotic and very staccato. I think moving forward one of the big challenges is going to be getting some of that really nice fluid movement, where they look like they're going to do something with a particular purpose in mind, rather than it being a case of every time they walk somewhere, they walk there in the same sort of manner." So the big leaps need to be in performance as well as behaviours? "Yes! One of the things I didn't really appreciate about AI before I worked in the field was that I didn't realise how involved animators are in the process, and how inspiring they are in terms of the way they look at the world. Just walking to a point isn't just walking to a point. It should be telling you something about how that character is feeling, and what they're intending to do."

"I think the big issue in AI is that there's a general lack of fluidity when moving from one action to another."

Neil Wallace

"Animation is really crucial to getting the characters right," agrees McKeown. "There's no point putting any AI systems in if there isn't some feedback to the player regarding what's happening, You've always got to have something going back to the player to let them know what Trip or Pigsy are actually thinking in a way. In terms of making characters believable for us, a lot of the work for that was actually done with the mo-cap and with getting the cut-scenes right. Then it was just following through and having the same style of character in everything Trip does."

So how close are we to the point where AI characters will be truly convincing on a regular basis? "It's difficult to say," says Wallace. "We're definitely moving in the right direction, and there's a lot of really interesting work being done on the animation system side of things to support that. There seems to be a real uptick in design interest at the minute, too. It's really hard to predict which way things are going to go, though. It's definitely an area I'm interested in pushing forward, but it is tricky. The more you get pure AI, the more there's an inherent unpredictability in that."

And as a designer, do you want to preserve a bit of that? "Absolutely," Wallace laughs. "When you're dealing with a human being, part of the fun is that you can't tell 100 per cent what they're going to do or what they're thinking. I guess it can be unpredictable, but you still need to be able to understand in the end why it's chosen the thing it's chosen."

Great mo-cap helped Ninja Theory bring Trip to life.

I ask both Wallace and McKeown if there's one AI issue they'd really like to be able to solve, or one aspect of the craft that is still holding everything back. "For me, I guess it's the subtle things," says McKeown. "We can get the behaviours right that are needed for the gameplay right now, but if we can add subtle features to it that you would get from a real person, that's where the believability comes from. Trip has quite a nice thing where - if she's completely safe with no enemies around - she'll look at interesting parts of the environment. Then, in a feature that had to be cut towards the end of development for robustness, we had a feature where she would wander off and just sit on bits of scenery. We had to drop that, but things like that are really nice when you see them working. I wanted her to back off if the player got too close, and respond to the player in that kind of subtle way rather than just responding to commands from the player."

Wallace, meanwhile, is more interested in the deeper processes taking place inside the AI character's head. "It's less of an absolute problem and more of a sliding scale," he says. "I guess what separates interesting AI from uninteresting AI for me is that uninteresting AI is very reactive. It doesn't think ahead very far. Interesting AI is where you get more to the planning of a sequence of actions, rather than each action being a reaction. It's just something that's deliberative. Something that has more of a long-term goal, rather than just instinctual behaviours. Imagine an AI that has a goal that may take days, weeks, months to get to, but where it's constantly trying to move in that direction.

"Added depth, I guess, is how I'd summarise it."

Read this next

seductrice.net
universo-virtual.com
buytrendz.net
thisforall.net
benchpressgains.com
qthzb.com
mindhunter9.com
dwjqp1.com
secure-signup.net
ahaayy.com
tressesindia.com
puresybian.com
krpano-chs.com
cre8workshop.com
hdkino.org
peixun021.com
qz786.com
utahperformingartscenter.org
worldqrmconference.com
shangyuwh.com
eejssdfsdfdfjsd.com
playminecraftfreeonline.com
trekvietnamtour.com
your-business-articles.com
essaywritingservice10.com
hindusamaaj.com
joggingvideo.com
wandercoups.com
wormblaster.net
tongchengchuyange0004.com
internetknowing.com
breachurch.com
peachesnginburlesque.com
dataarchitectoo.com
clientfunnelformula.com
30pps.com
cherylroll.com
ks2252.com
prowp.net
webmanicura.com
sofietsshotel.com
facetorch.com
nylawyerreview.com
apapromotions.com
shareparelli.com
goeaglepointe.com
thegreenmanpubphuket.com
karotorossian.com
publicsensor.com
taiwandefence.com
epcsur.com
mfhoudan.com
southstills.com
tvtv98.com
thewellington-hotel.com
bccaipiao.com
colectoresindustrialesgs.com
shenanddcg.com
capriartfilmfestival.com
replicabreitlingsale.com
thaiamarinnewtoncorner.com
gkmcww.com
mbnkbj.com
andrewbrennandesign.com
cod54.com
luobinzhang.com
faithfirst.net
zjyc28.com
tongchengjinyeyouyue0004.com
nhuan6.com
kftz5k.com
oldgardensflowers.com
lightupthefloor.com
bahamamamas-stjohns.com
ly2818.com
905onthebay.com
fonemenu.com
notanothermovie.com
ukrainehighclassescort.com
meincmagazine.com
av-5858.com
yallerdawg.com
donkeythemovie.com
corporatehospitalitygroup.com
boboyy88.com
miteinander-lernen.com
dannayconsulting.com
officialtomsshoesoutletstore.com
forsale-amoxil-amoxicillin.net
generictadalafil-canada.net
guitarlessonseastlondon.com
lesliesrestaurants.com
mattyno9.com
nri-homeloans.com
rtgvisas-qatar.com
salbutamolventolinonline.net
sportsinjuries.info
wedsna.com
rgkntk.com
bkkmarketplace.com
zxqcwx.com
breakupprogram.com
boxcardc.com
unblockyoutubeindonesia.com
fabulousbookmark.com
beat-the.com
guatemala-sailfishing-vacations-charters.com
magie-marketing.com
kingstonliteracy.com
guitaraffinity.com
eurelookinggoodapparel.com
howtolosecheekfat.net
marioncma.org
oliviadavismusic.com
shantelcampbellrealestate.com
shopleborn13.com
topindiafree.com
v-visitors.net
djjky.com
053hh.com
originbluei.com
baucishotel.com
33kkn.com
intrinsiqresearch.com
mariaescort-kiev.com
mymaguk.com
sponsored4u.com
crimsonclass.com
bataillenavale.com
searchtile.com
ze-stribrnych-struh.com
zenithalhype.com
modalpkv.com
bouisset-lafforgue.com
useupload.com
37r.net
autoankauf-muenster.com
bantinbongda.net
bilgius.com
brabustermagazine.com
indigrow.org
miicrosofts.net
mysmiletravel.com
selinasims.com
spellcubesapp.com
usa-faction.com
hypoallergenicdogsnames.com
dailyupdatez.com
foodphotographyreviews.com
cricutcom-setup.com
chprowebdesign.com
katyrealty-kanepa.com
tasramar.com
bilgipinari.org
four-am.com
indiarepublicday.com
inquick-enbooks.com
iracmpi.com
kakaschoenen.com
lsm99flash.com
nana1255.com
ngen-niagara.com
technwzs.com
virtualonlinecasino1345.com
wallpapertop.net
casino-natali.com
iprofit-internet.com
denochemexicana.com
eventhalfkg.com
medcon-taiwan.com
life-himawari.com
myriamshomes.com
nightmarevue.com
healthandfitnesslives.com
androidnews-jp.com
allstarsru.com
bestofthebuckeyestate.com
bestofthefirststate.com
bestwireless7.com
britsmile.com
declarationintermittent.com
findhereall.com
jingyou888.com
lsm99deal.com
lsm99galaxy.com
moozatech.com
nuagh.com
patliyo.com
philomenamagikz.net
rckouba.net
saturnunipessoallda.com
tallahasseefrolics.com
thematurehardcore.net
totalenvironment-inthatquietearth.com
velislavakaymakanova.com
vermontenergetic.com
kakakpintar.com
jerusalemdispatch.com
begorgeouslady.com
1800birks4u.com
2wheelstogo.com
6strip4you.com
bigdata-world.net
emailandco.net
gacapal.com
jharpost.com
krishnaastro.com
lsm99credit.com
mascalzonicampani.com
sitemapxml.org
thecityslums.net
topagh.com
flairnetwebdesign.com
rajasthancarservices.com
bangkaeair.com
beneventocoupon.com
noternet.org
oqtive.com
smilebrightrx.com
decollage-etiquette.com
1millionbestdownloads.com
7658.info
bidbass.com
devlopworldtech.com
digitalmarketingrajkot.com
fluginfo.net
naqlafshk.com
passion-decouverte.com
playsirius.com
spacceleratorintl.com
stikyballs.com
top10way.com
yokidsyogurt.com
zszyhl.com
16firthcrescent.com
abogadolaboralistamd.com
apk2wap.com
aromacremeria.com
banparacard.com
bosmanraws.com
businessproviderblog.com
caltonosa.com
calvaryrevivalchurch.org
chastenedsoulwithabrokenheart.com
cheminotsgardcevennes.com
cooksspot.com
cqxzpt.com
deesywig.com
deltacartoonmaps.com
despixelsetdeshommes.com
duocoracaobrasileiro.com
fareshopbd.com
goodpainspills.com
hemendekor.com
kobisitecdn.com
makaigoods.com
mgs1454.com
piccadillyresidences.com
radiolaondafresca.com
rubendorf.com
searchengineimprov.com
sellmyhrvahome.com
shugahouseessentials.com
sonihullquad.com
subtractkilos.com
valeriekelmansky.com
vipasdigitalmarketing.com
voolivrerj.com
worldhealthstory.com
zeelonggroup.com
1015southrockhill.com
10x10b.com
111-online-casinos.com
191cb.com
3665arpentunitd.com
aitesonics.com
bag-shokunin.com
brightotech.com
communication-digitale-services.com
covoakland.org
dariaprimapack.com
freefortniteaccountss.com
gatebizglobal.com
global1entertainmentnews.com
greatytene.com
hiroshiwakita.com
iktodaypk.com
jahatsakong.com
meadowbrookgolfgroup.com
newsbharati.net
platinumstudiosdesign.com
slotxogamesplay.com
strikestaruk.com
techguroh.com
trucosdefortnite.com
ufabetrune.com
weddedtowhitmore.com
12940brycecanyonunitb.com
1311dietrichoaks.com
2monarchtraceunit303.com
601legendhill.com
850elaine.com
adieusolasomade.com
andora-ke.com
bestslotxogames.com
cannagomcallen.com
endlesslyhot.com
iestpjva.com
ouqprint.com
pwmaplefest.com
qtylmr.com
rb88betting.com
buscadogues.com
1007macfm.com
born-wild.com
growthinvests.com
promocode-casino.com
proyectogalgoargentina.com
wbthompson-art.com
whitemountainwheels.com
7thavehvl.com
developmethis.com
funkydogbowties.com
travelodgegrandjunction.com
gao-town.com
globalmarketsuite.com
blogshippo.com
hdbka.com
proboards67.com
outletonline-michaelkors.com
kalkis-research.com
thuthuatit.net
buckcash.com
hollistercanada.com
docterror.com
asadart.com
vmayke.org
erwincomputers.com
dirimart.org
okkii.com
loteriasdecehegin.com
mountanalog.com
healingtaobritain.com
ttxmonitor.com
nwordpress.com
11bolabonanza.com