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
CS 1.6 remade in CS: Legacy.
A gorgeous ground-up remake of Counter-Strike 1.6 is on its way to Steam, and one of the game's original creators says 'it really gives me old vibes'
Metro Exodus
'I want to raise this glass to our fans, to our community': 4A Games celebrates Metro 2033's 15th anniversary and hints at next Metro game
Official artwork of Valorant showing the game's characters in a row
Valorant dev accepts there's too much random crap cluttering up the screen: 'The balance team generally agrees with this take'
Fragpunk FPS
Fragpunk review
Battlefield 1
The best Battlefield game of the last decade is 95% off until Thursday
Grab the brilliant Doom 2016 for its lowest price ever
Latest in News
CS 1.6 remade in CS: Legacy.
A gorgeous ground-up remake of Counter-Strike 1.6 is on its way to Steam, and one of the game's original creators says 'it really gives me old vibes'
Portal P3 pinball table
There's a new Portal game and it costs $12,500
MrBeast posing in front of a stack of cashing, promoting Beast Games season 2
Beast Games opens casting for season 2: MrBeast lost a ton of money on season 1 but apparently not enough that he won't do it again
Image for
Rise of the Ronin's PC troubles continue as players report disappearing saves on Steam
Former Treyarch studio co-head and Black Ops 3 director is heading up a new first-party PlayStation studio
Metro Exodus
'I want to raise this glass to our fans, to our community': 4A Games celebrates Metro 2033's 15th anniversary and hints at next Metro game