miuradio
How It SpawnsThe tricks inside famous games, shown running.›

How It Spawns

Why does the bot always check the corner you're hiding in? It never even saw you.

Premieres Wed, Nov 11. Follow to see it first.

Story

Counter-Strike's official bot came with Condition Zero in 2004, built by Michael Booth at Turtle Rock Studios with Valve. It sees only what's in its own field of view, so it has to look around like a player. Without a map in its head a bot "just kind of wanders until he bumps into a wall", Booth said at GDC 2004, and waypoints, points you place down joined by lines, only work on the maps someone placed them on. Players had made thousands of their own.

So his bot learns any map by itself, for a minute or so before it plays. It steps out from a spawn point across the floor, joins the steps into rectangles, and every corner with walls on two sides becomes a hiding spot. Then, for every way through an area, it sorts those spots by when they come into view. Walking in, it glances at each one in turn. Your corner was simply next on its list. Valve's own navigation code has the same rules, and Counter-Strike 2 still ships a switch to "Draw the hiding spot the bot will check next."

It found corners players never think of. In testing, Booth said, "someone will get killed by a bot, and there'll be an outcry. It's like, nobody camps there. But it worked."

The yard, its steps, its nine hiding spots and the order on screen are our own simplified version of those rules, run in code.

Which game's bots should we open next?

Sources: Michael Booth, "The Official Counter-Strike Bot", GDC 2004 (slides and talk recording); Valve, Source SDK 2013 navigation code; Counter-Strike 1.6's bot code (ReGameDLL_CS); Counter-Strike 2's game files (SteamDB GameTracking-CS2).
Sounds and music: our own.
Unofficial. Not affiliated with or endorsed by Valve or Turtle Rock Studios. Counter-Strike is a trademark of Valve Corporation.

Link copied