The magic behind Half-Life 2 is laid bare in Valve's code comments

Joe Wintergreen is an Australian indie game developer who is currently working on “mostly a stealth FPS” under the Impromptu Games banner. He also recently delivered unto the internet a series of code snippets from the great FPS Half-Life 2 by way of his Twitter account. There's not much to see of the code, but that's not why we're here. What's really relevant are the code comments, and the light they shine on how the magic is made. 

The first tweet in Wintergreen's thread sets the tone for what's to come:

Striders will intentionally shoot things up even if you're not in their line of sight, just because it looks cool:

Charlie don't surf, and the Combine don't dance:

Zombies had to be toughened up after the shotgun's power was increased, to keep things in balance:

This is a stupid fix but it works, so whatever:

There's only one “fuck” in the entire codebase, according to Wintergreen, and this is it:

Alyx Vance: Nice girl, handy in a fight, terrible eyesight: 

Some of comments really give a sense of what goes into making a game and keeping it intact. One in particular is actually a multi-paragraph telling of how the Strider minigun was accidentally nerfed in the Orange Box because of a bug in the original Half-Life 2 that nobody noticed. There's also a bit about the “low violence” mode, and references to the Combine Advisors, “large sluglike aliens with creepy psychic powers” who ended up not being used in the game. [Correction, sort of: I've been reminded that they did appear in Half-Life 2: Episode 2, but you didn't actually fight them.]

It's a fun bit of videogame history, and there are quite a few more than just what's embedded here. If you've got a few minutes, you can catch the entire thread on Twitter.

TOPICS
Andy Chalk
US News Lead

Andy has been gaming on PCs from the very beginning, starting as a youngster with text adventures and primitive action games on a cassette-based TRS80. From there he graduated to the glory days of Sierra Online adventures and Microprose sims, ran a local BBS, learned how to build PCs, and developed a longstanding love of RPGs, immersive sims, and shooters. He began writing videogame news in 2007 for The Escapist and somehow managed to avoid getting fired until 2014, when he joined the storied ranks of PC Gamer. He covers all aspects of the industry, from new game announcements and patch notes to legal disputes, Twitch beefs, esports, and Henry Cavill. Lots of Henry Cavill.

Latest in FPS
Atomfall hidden cache locations - Blue fungus ravine
All Atomfall endings and how to get each one
A female druidic figure clutches a heart riven with thorns in Hunt: Showdown
'We want to increase the cost of silence': Hunt: Showdown 1896's latest update brings a new event, a massive list of bugfixes and a tougher challenge for stealthy players
Warhammer 40,000: Darktide Ogryn
Warhammer 40,000: Darktide adds a psychic horde murderzone mode and makes Ogryns even smashier
Starfield's companion robot giving a thumbs-up
Former Bethesda dev who quit Starfield to go solo says it's 'much less stressful as an indie' without daily meetings or 'office politics': it's 'very refreshing to just care about the game'
A crew of prospectors in Wildgate, featuring a robot, a rabbit man, and a small aquatic creature in a combination mech/aquarium.
Blizzard co-founder Mike Morhaime's new company is putting Sea of Thieves-style shenanigans in space with a new crew-based shooter
Team Fortress Spy being shocked
An FPS studio pulled its game from Steam after it got caught linking to malware disguised as a demo, but the dev insists it was actually the victim of a labyrinthine conspiracy
Latest in News
A screenshot from SaGa Frontier 2, showing one of the protagonists wandering through a quaint fantasy village
One of Square Enix' most underrated PlayStation-era JRPGs just shadow dropped on Steam
The titular character from Princess Mononoke is depicted riding the wolf goddess Moro and carrying a spear.
Studio Ghibli AI image trend floods social media, cheered on by OpenAI and denounced by critics as an insult to Hayao Miyazaki
Marvel Rivals tier list - Wolverine
Marvel Rivals director says a future patch will reduce the shooter's insatiable hunger for RAM: 'It's a very big problem'
Hogwarts Legacy potions professor holding a potion
An unannounced Hogwarts Legacy expansion and 'definitive edition' have reportedly been cancelled
Story of Seasons - A cahacter in a purple tuxedo stands outside in a town square talking to the player
Story of Seasons is doing another Harvest Moon remake and it might be the best the series has ever looked
Assassin's Creed Shadows change seasons - An upper-body shot of Yasuke looking cheerfully up into the distance.
Assassin's Creed Shadows puts up the 'second highest day-one sales revenue in Assassin's Creed franchise history'