Back
Half-Life 2 Now Runs in a Browser Thanks to a Fan-Made Web Port
SiTech AI Team3 წთ. საკითხავი

Half-Life 2 Now Runs in a Browser Thanks to a Fan-Made Web Port

A developer known as slqnt has published a browser port of Half-Life 2 that runs the 2004 classic through Emscripten and WebGL2, with assets packed per map and facial animation disabled for stability.

Half-Life 2, playable in a browser tab

A fan-made web port of Half-Life 2 is now playable directly in a browser. The project was published by a developer who goes by slqnt: the 2004 Valve shooter runs through Emscripten and WebGL2, and the author has also published a detailed write-up describing how the port was assembled and what had to be given up along the way.

A small group of contributors worked on the project alongside the author — 98006, weliveinhell, bread and bog. The first teaser appeared on 20 March 2026; at that stage the build was still buggy, missing voice lines and suffering from the facial animation problems that were later solved by disabling the system entirely.

Built on a chain of open-source work

The effort started from an existing browser port of Portal made by weliveinhell, itself a fork of nillerusr's source-engine repository — a modified version of the 2020 Team Fortress 2 Source engine leak. That codebase already implemented a ToGLES rendering mode: OpenGL ES calls are translated to WebGL2 by Emscripten, which meant almost no rendering work was needed for Half-Life 2.

Because that engine predates Half-Life 2's 20th anniversary release, its assets were not supported. The author switched to the steam_legacy branch on Steam to obtain compatible data. Asset loading required its own pipeline: the engine was modified to log every asset request, and a script parsed those logs and packed the files into .data archives — one per map. The existing chunking script was written for Linux, so it had to be adapted to Windows before every Half-Life 2 VPK could be unpacked.

What was cut, and what was fixed

Half-Life 2's facial animation system, one of the original release's landmark features, caused so many problems that it was disabled for stability. The list of fixes is long: saving and loading had to be wired into Emscripten's IDBFS; batteries, medkits and wall-mounted medkits did not work at all; the gravity gun was not added to the inventory when Alyx hands it over; lightmaps occasionally painted maps in random colours; the flashlight used a null texture; NPCs collapsed and died at random; headcrabs and zombies dealt no damage; and water rendered completely black. Several of those, including the medkits and the collapsing NPCs, were fixed by contributor 98.

Smaller quality-of-life changes followed, among them binding crouch to C because Ctrl triggers browser shortcuts that interrupt play.

What comes next

The author says work on the two Half-Life 2 episodes will follow after a break. There is no word yet on whether the same approach will extend to other Source engine titles.

SSiTech

SiTech — AI-powered web development

We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.