If you've used this site, you know that GTA Vice City runs inside a browser tab with no installation. But how is that actually possible? A game from 2002 — originally a Windows executable using DirectX — running seamlessly inside Chrome? The answer involves several layers of modern web technology working together. Here's how it works, explained in plain English.
GTA Vice City's source code was never released by Rockstar Games. But over the years, a group of dedicated reverse engineers painstakingly disassembled the original Windows executable and reconstructed the game's source code from scratch — a project called reVC.
The reVC team didn't guess how the code worked. They analysed the compiled binary instruction by instruction, figured out what each function did, and rewrote it in readable C++ that produces identical behaviour to the original. After years of work, they had a fully functional open-source reimplementation of the Vice City engine that could be compiled on any platform — not just Windows.
That platform portability is the crucial first step. Once the engine runs on Linux and macOS, it can run anywhere a C++ compiler can target.
WebAssembly (WASM) is a binary instruction format that modern browsers can execute at near-native speed. Think of it as a compact, efficient version of machine code that all browsers know how to run — regardless of whether you're on Windows, macOS, Android or iOS.
Compiling reVC to WebAssembly uses a tool called Emscripten. Emscripten takes C++ source code and compiles it to WASM instead of native machine code. The result is a .wasm file that the browser can load and execute.
WASM runs at 60–80% of native C++ speed in most benchmarks. For a 2002 game, that's more than enough. Modern CPUs can run GTA Vice City's 2002-era rendering at full speed inside a browser without breaking a sweat.
The key insight is this: the browser is now a universal runtime. Any program that can be compiled to C or C++ can theoretically be compiled to WASM and run in a browser. Vice City is just one example of what this enables.
GTA Vice City has about 880 MB of game assets — textures, 3D models, audio files, scripts. The browser can't store 880 MB in a cookie or localStorage. Those are tiny, limited storage mechanisms for small data.
Instead, the browser version uses Origin Private File System (OPFS) — a modern browser API that gives web applications access to a private file system stored locally on your device. Each website that uses OPFS gets its own isolated storage area that only that website can access.
On first visit, the game downloads a compressed archive of all the game assets (~700 MB compressed) and extracts them into OPFS. After extraction, ~880 MB of game files live in your browser's private storage. On every subsequent visit, those files are already there — the game loads from local storage instantly, with no internet connection required.
OPFS is supported in Chrome, Firefox, Edge and Safari 16.4+. It's a genuine file system — not a database or cache — so files can be read and written at speeds comparable to a local hard drive. This is what makes storing a full game's worth of assets practical.
The WASM game engine needs to read game files the same way a native application would — by opening file paths and reading bytes. But WASM running in a browser can't directly access the file system in the traditional sense; it uses a virtual file system that's mapped to real storage behind the scenes.
This is where Service Workers come in. A Service Worker is a background script that sits between the browser and network requests. When the game engine requests a file (say, /vcbr/models/generic.img), the Service Worker intercepts that request and returns the file's contents from OPFS instead of making a network request.
The result: from the game engine's perspective, it's reading files from a local file server. From the browser's perspective, it's intercepting URL requests. From your perspective, the game just works.
Modern games use multiple threads — one for rendering, one for audio, one for physics, one for AI. GTA Vice City was designed this way. WebAssembly supports multi-threading through a browser API called SharedArrayBuffer, which lets multiple threads share memory safely.
SharedArrayBuffer requires the page to be served with specific security headers:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corpThese headers tell the browser that the page is isolated from other origins, which is a prerequisite for enabling shared memory between threads. The Vite development server and any production deployment must set these headers for the game to run. Without them, the WASM threads can't communicate and the game fails to start.
Put it all together and this is how Vice City runs in your browser:
This is genuinely impressive engineering, and it opens the door to far more ambitious browser ports in the future. If Vice City can run this way, so can thousands of other classic games.
Play GTA Vice City free in your browser — the full game, running in a tab.
▶ Play Vice City Free