
The AI Systems of "Left 4 Dead" [pdf] - StylifyYourBlog
http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf
======
danso
I love this game, one of the last FPSes I still play other than Team Fortress
2...unfortunately, like TF2, it's not very playable unless everyone in the
round is amenable to being a team player. The multiplayer deathmatch allows
one team to take the role of monsters, who have the backing of the zombie
horde to make up for lack of guns. Playing it really provides some interesting
insights to how the AI effectively functions, by slowly getting the human
players to come unglued, either by targeting stragglers or letting the best
players get too overconfident and move ahead of the team. Of course, all
deathmatch games have this dynamic but it's very explicit in L4D, mostly
because it's impossible for one human or monster player to singlehandedly own
the opposing team in the way that an ace player can miraculously wipe out a
team in Counter-Strike.

edit: The AI controlled human players is extremely competent, maybe the best
bot players yet created. But they do show their limitations in
multiplayer...among their weaknesses: they're too willing to sacrifice their
healthpacks for an injured teammate, and will almost always try to help an
incapacitated player no matter how hopeless his/her cause. Real humans can be
total assholes, but in some situations its best for the team to leave a
straggler behind, especially if the enemy has set up an ambush for the
rescuers.

~~~
afreak
> like TF2, it's not very playable unless everyone in the round is amenable to
> being a team player

Amen. TF2 and L4D are two games that I consistently play years after the fact
which is unlike other games I have.

Unless you're playing with people you know, both games are equally
frustrating. Specifically in TF2, it's those who go and play support classes
when there are already enough of those in play on the map on your team that
makes it frustrating.

~~~
ahelwer
That only matters if you care about winning.

TF2 also has a huge accessibility problem which contributes to an
overabundance of support class players, but also makes it a brilliant game. As
opposed to the Battlefield series, where seeing the enemy first is most of the
battle, it's actually difficult to inflict any damage at all in TF2. For
instance, I'm at about the 200 hour mark and when I play demo I can only hit
ground-based targets with pipes maybe 20-30% of the time - and that's quite
good! For beginners, the only playable frontline classes are pyro and heavy.
Spy and sniper are also popular because it's easier to survive when playing
them, and maybe sneak a few insta-kills. Medic is easy to play, but can be
very boring.

tl;dr: Don't hate the player, hate the game. And don't hate the game, because
you'd be hating what makes TF2 such a wonderful game to play. Even at
professional levels getting an airshot is a remarkable feat.

~~~
lelandbatey
I want to bring this up because it's a point very often overlooked about why
TF2 is a fun game, and that is that it has a reliable and accessible in game
VOIP system.

I don't see this talked about much, but it really makes TF2 shine as a
straight up fun game. It allows players to communicate in any way they see
fit, from the user casual to the highly formal/competitive. That means players
can organize themselves to pull weird shenanigans or play very competitively
using communication to gain an edge. Also, since voice is such a uniquely
human attribute, it humanizes other players who would otherwise be anonymous
participants.

The end result of this is that you get highly cohesive communities that make
the game great!

------
TheMakeA
Valve is (was) very open with their publications. There are more available on
their website[1]. I definitely recommend taking a little time to look through
them.

[1] <http://www.valvesoftware.com/publications.html>

~~~
Brashman
Any idea why there hasn't been anything since 2009? Have they stopped
publishing/presenting or just not updated the site?

~~~
Caskman
That's just an old page

<http://www.valvesoftware.com/company/publications.html>

------
johnyzee
Adjusting enemy spawn and behavior by a calculated 'emotional intensity' of
the player - very nice.

------
solnyshok
If a SurvivorBot ever gets far out of place for any reason, it is teleported
near the team when no human is looking at it (AI cheating algoritm!!! Really
enjoyed that)

~~~
illicium
This works as long as the player doesn't notice. Counterexample: the Watson
NPC in the Sherlock Holmes Nemesis game, <http://youtu.be/13YlEPwOfmk>

------
adriancooney
The climbing sequence is particularly impressive but maybe a tad excessive in
my opinion but. I count six operations, two of which seem to computationally
intensive due to their trial-and-error approach. I can see the reasoning
behind it if the AI is climbing a physics props but surely map data could be
retrieved relative to position and save all that ray tracing (if that's the
correct term)?

~~~
supar
Not sure what you mean by "map data". You can certainly have a list of props
that are in the way and have them as a mesh. It's certainly easier if you have
only one prop, but you have to account for that they may stack together in any
way- and suddently the geometry configuration becomes non-trivial again.

------
vy8vWJlco
Google's PDF viewer works for reading in the browser (scribd isn't working on
this one):

[https://docs.google.com/viewer?embedded=true&url=http://...](https://docs.google.com/viewer?embedded=true&url=http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf)

~~~
fafner
pdf.js works as well.

------
TillE
scribd is "unable to display this document", and the download button doesn't
even work. Just link the original.

[http://www.valvesoftware.com/publications/2009/ai_systems_of...](http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf)

~~~
fafner
The link is to the original. The scribd link is to the side and is
automatically added by HN.

(I never really liked scribd and with pdf.js it's clearly obsolete)

~~~
jfb
For PDFs at least, scribd seems purely parasitic.

~~~
zdw
I believe the intention of having the scribd links is to mirror the content if
the original source goes down under the HN reader load, which has happened at
times.

~~~
alexatkeplar
Or, the intention of having Scribd links is to boost SEO for and awareness of
Scribd, thus increasing the value of Y Combinator's equity stake.

~~~
regularfry
This is news. _ycombinator_.com. I don't begrudge that.

~~~
jfb
It wouldn't bug me if it didn't decrease the utility of the PDF links.

EDIT: as pointed out below, it doesn't. Belay this comment.

~~~
corin_
It doesn't. If you don't want to see Scribd then don't click on the "[Scribd]"
- the rest of the title takes you straight to the PDF itself.

~~~
jfb
Well, blow me over. How did I miss _that_?

Thanks.

------
kriro
Question about the navigation mesh.

I'm assuming that represents an entire open area (otherwise the path
optimization makes no sense) and the dark stuff are the obstacles. In that
case I'm wondering how the arrive at the actual grids and arrows (slide 12)

~~~
gmaslov
This link explains fairly well how a navigation mesh may be automatically
generated from the level geometry:
<http://udn.epicgames.com/Three/NavigationMeshReference.html> . I believe it's
also a good practice for the level designer to examine it manually and make
any necessary corrections for sharp corners, narrow corridors, etc.

As for the path, A* search is usually the name of the game for any kind of 2D
pathfinding. With the usual Euclidean distance heuristic it always returns the
shortest path, but it's possible to use an "inadmissible" heuristic to make it
run faster (and produce sub-optimal paths). The arrows shown on the slides are
a little baffling; I can't imagine why those four vertically stacked boxes on
the right-hand side would create a jagged path, for instance. It may just be
exaggerated for effect.

~~~
kriro
Yeah I couldn't make sense of the arrows but I only know AI from 2d and have 0
clue about 3d game development.

Most toy examples I know use an even square grid so I was wondering if I might
be missing something there.

Either way thanks for the answer (same goes for the other posters who provided
links)

------
lazyjones
That's a very interesting read, even though in practice, the ingame AI still
feels lackluster. Survivor bots often ignore nearby players attacked by
special infected to move (slowly) towards some far away target (another
attacked/incapacitated player) and special infected bots could really use some
cooperation (as do many human players ...).

~~~
manmal
I always wished that I could tell the bot teammates "stick together", "fan
out" or "help me" via the chat. That would give them an actual sense of social
intelligence, and bring them closer to real players (to be 100% realistic they
would then have to ask "where r u??" :)).

~~~
Extigy
Oh man that would be so cool. I suppose if text based adventure games can
"understand" meaning within text, there's no reason it couldn't be remodelled
into a chat setting.

~~~
freehunter
There are plenty of FPS games with AI that you can control with commands. The
Rainbow Six games all have this, and if I'm not mistaken, I believe Counter
Strike's bots can be controlled with commands as well.

~~~
Fargren
Quake III's AI not only receives but also gives commands by chat. If you enter
a team full of bots, you can see them talk to each other and "plan" to a
certain extent.

~~~
qznc
"Daemia patrol from quad to bfg for 3 minutes" ;)

<http://www.angelfire.com/linux/vmerchand/quake.htm>

~~~
angersock
Hah! Quake 3 and UT99 both were helped immensely by having the ability to
command bots--that often would be the difference between a stalemate in a CTF
map and a flawless victory.

------
lucb1e
I never felt like playing this game until now. The AI sounds very interesting
to try for myself! Game producers should release such documents upon launching
the game, it makes it that much more interesting.

~~~
mwctahoe
but then some people will look through the docs, find the exploits and become
the top players. Wouldnt really be fair from a game play standpoint but I
agree this was one of the most interesting things i have read in weeks.

~~~
lucb1e
I don't think it's all that hard for many students (or others with no life) to
play the game enough to find flaws in the AI without releasing technical
documentation. You're right though, this is a concern... Perhaps if they
release the docs a few weeks delayed?

------
iam
Great stuff, have to disagree on the "replayability" section though. There
were only 2-3 tier 2 weapon spawns on the entire map, the crescendos were
pretty much always in the same spot (this was a bit better in L4D2), and so
on. After the first 10 times every map felt the exact same.

~~~
hpcorona
As a 3+ years of playing every night, i will have to disagree. The weapon
spots are not important... The replayability comes with everything it
provides. I have over 1 tb of dem files because i record every single match
since start, and i still enjoy it.

~~~
iam
Oh, I don't think the game is not replayable, I had a lot of fun playing it
and L4D2. I just don't think it was at all obvious accomplished their goals
with the director AI that they set out to. Hence "replayability section"
(directly referring to the PDF)

------
cateye
This is exactly the reason why I don't like playing computer games. The games
feel really scripted. Enemy character that wait until I cross a line before
they attack me etc.

I wished that instead of investing in graphics, the AI got more attention.

~~~
ddorian43
play multiplayer?

~~~
arethuza
I only ever play multiplayer (mostly Halo 4 these days) - any time I try
Campaign I find the AI rather boring and predictable. I don't know if the Halo
series are bad for this or not.

~~~
robotmay
Yeah, it's not anything amazing from my experience. I've heard the FEAR games
had decent AI, as well as Far Cry.

If we're not talking FPS then I've been impressed by the AI in XCOM. God damn
those bastards are hard work.

~~~
alan_cx
I have heard that about Far Cry too, but even as a fan of all of the FC games,
I really cant see why people say that. I'm not saying the AI is bad or sub
par, just that I'm ignorant!!! To be fair though, I don't play that many
games, so I don't really have much to compare to.

------
jnazario
in the past few months i started to learn a little bit about AI, including
algorithms in planning (like PDDL) and logic engines. the more i learned the
more i saw what the gaming companies, and that entire community, are doing and
how they are some of the biggest consumers of these technologies. i have to
say that it's impressed me, and it seems like the gaming companies are on the
forefront of multiple areas of technologies, not just graphics and specialized
CPUs.

no if only i could hire from that talent pool :)

~~~
kaoD
Woah, I've been doing the same thing for the past few months because I took an
AI branch for my last year in college. Unfortunately I feel they've been
teaching us mostly outdated and useless algorithms (with all due respect).

I wish I was taught more about neural networks, machine learning, data mining
techniques... and less about classic (and failed) AI algorithms. The most I
learnt about these techniques was from teaching myself, even for the last
year.

Perhaps we attend the same classes?

[sorry for the OT guys, no PMs in Hacker News!]

~~~
jnazario
no, i'm not a student.

presentations and papers like this are what i'm referring to:

[https://skatgame.net/mburo/icaps2010-pg/ICAPS-
PG.2010.1.bart...](https://skatgame.net/mburo/icaps2010-pg/ICAPS-
PG.2010.1.bartheye.pdf)

[http://www.plg.inf.uc3m.es/icaps-
pg2007/papers/Symbolic%20Ex...](http://www.plg.inf.uc3m.es/icaps-
pg2007/papers/Symbolic%20Exploration%20for%20Generalized%20Game%20Playing%20in%20PDDL.pdf)

[http://www.slideshare.net/StavrosVassos/the-simplefps-
planni...](http://www.slideshare.net/StavrosVassos/the-simplefps-planning-
domain-a-pddl-benchmark-for-proactive-npcs)

<http://abotea.rsise.anu.edu.au/data/offline-htn-planning.pdf>

[http://www.guerrilla-
games.com/presentations/VUA07_Verweij_H...](http://www.guerrilla-
games.com/presentations/VUA07_Verweij_Hierarchically-Layered-MP-
Bot_System.pdf)

etc etc etc. turns out a lot of these ideas people thought were failures are
getting a new lease on life in games, and they're working pretty well.

curious what classic AI algorithms you think are failing. from where i sit i'm
seeing them get a new lease on life. maybe it's just the natural cycle of
things: they get hot and invested in, they then fail to live up to their
assumed potential, they fall out of favor for a while, and when everyone who
was familiar with them - and their shortcomings - is gone a new generation
finds it again and starts the cycle over.

------
ccozan
That's hardly AI. It's just algorithms. Parametrized, using a probability
distribution to randomize the environment, user programmed algorithms.

EDIT: Well, if this AI in game development, then so be it. But it's still not
AI in the generic way, IMHO. To downvoters: I didn't contest the fact that
they don't work. I do enjoy this games a lot and I praise the programmers that
make such games work.

~~~
gmaslov
Ah, yes. The perennial curse of AI: as soon as it works, it's not called AI
anymore ;-)

~~~
setrofim_
Reminds me of this passage from Douglas Hofstadter's GEB:

Loocas the Thinker comes across an unknown object--a woman. ... "Behold! I can
look upon her face, which is something she cannot do--therefore women can
never be like me!"

And thus he proves man's superiority over women, much to his relief ... The
woman argues back: "Yes, you can see my face, which is something I can't do--
but I can see your face, which is something you can't do! We're even."

"I'm sorry, you're deluded if you think you can see my face. What you women do
is not the same as what we men do--it is, as I have already pointed out, of an
inferior caliber, and does not deserve to be called by the same name. You may
call it 'womanseeing'. Now the fact that you can womansee my face is of no
import, because the situation is not symmetric. You see?"

"I woman-see," womanreplies the woman, and womanwalks away . . .

