Drift City,
rebuilt in Unity

A from-scratch rebuild of the online racing game Drift City, written by reverse-engineering the original DriftCity.exe function by function, with its own game server. It runs on your own installed copy of the client: the cities, the cars, the screens, the sounds and every game table are read from your game folder while it plays.

You need your own copy of the Drift City client. This project contains no game content: no models, textures, sounds, music, interface art, data tables or executable. It reads them from your installation at runtime and never modifies them.
Driving through Cras at sunset with the original HUD, minimap and chat

Status

Coverage is measured against the original executable: all 18,647 functions of DriftCity.exe were sorted into subsystems, and each subsystem is compared with what the Unity client and the server do.

94%of the game's own code converted (estimate, by code size)
3,032functions studied one by one and cited in the reverse-engineering notes
295 / 384of the interface dialogs the exe drives are rebuilt from the original layout
85 + 125automated Unity play tests and server tests

By subsystem

Share converted, largest subsystems first (size of the original code in brackets). Libraries and platform code the rebuild replaces on purpose (C runtime, ODE physics, the original network protocol, anti-cheat and login services) are left out.

What is left is mostly what can't be rebuilt one to one: the original company's services (the cash shop, PC-room bonuses, portal friend invites), GM-only and debug replies, and rules the original server held, for which the rebuild documents its own. See the code map.

Screenshots

The rebuild running on the original data. Everything you see is drawn from the game's own files.

What it can do

Offline on your own, or online on a server you host. A selection; the client README lists everything.

The open cities

Moon Palace, Koinonia, Cras and Oros from the game's own terrain, blocks and props, with traffic on the original lanes, pedestrians, trains, the weather clock, the sky domes and baked ground shadows.

Driving

The client's car model recovered from the exe: drifting, the booster and its Mittron fuel, jumps, skill items, durability, and every car of the vehicle list with its grades and parts.

HUV chases

The HUVs drive the client's routes; bosses run their recorded paths with their escorts. Party chases share one HUV, and Rush Time and the Virtual HUV run with real players.

The Battle Zone

Lobby, 16-slot wait rooms, team and wager rooms, Real Match, lap-time battles, the GT Championship, the ladder, spectating, ghost battles, replays and crew Channel Battles.

The Undercity

The underground party mode with its HUB phase, the Main HUB behind its shield, the HUV waves and the boss, solo with AI partners or with a real party online.

Missions

The main quests, the step quests of the stations, deliveries, patrols, instant missions, the Team ROO / OMD storyline split and its ending, and the apprentice tutorial for new drivers.

Shops and items

The car show room, the custom shop with period prices, parts shop, manufacturing, licences, the inventory with set parts and quick slots, trade and the Auction House.

Social

Parties, friends, notes, crews, private chat channels, the chat modes and the word filter, driver info cards and recommendations.

Events

Gacha, lotto, coupons, the token book, lucky bags and the seasonal city events (Christmas trees, the harvest, Halloween), switched by date or for testing.

How it works

Reading the game

The client mounts the game's NayaPack archives (.agt and the patches) and parses its formats directly: Gamebryo NIF 20 models and animations, DDS textures, the city block and terrain files, the road and traffic networks, the XLT/TDF tables and the game.nui interface layouts.

Reverse engineering

Every system was studied in the exe with Ghidra, function by function. The notes in DriftCity_RE give the addresses, mark what is exact and what is inferred, and document the rebuild's own rule wherever the original server decided.

The interface

All of the client's dialogs are drawn from game.nui with their original images, state rules and hotkeys, so the screens are the game's own rather than look-alikes.

The server

The original server is gone, so the rebuild has its own (Node.js, JSON over WebSocket, SQLite). It is authoritative for money, rewards and items and runs the online modes.

Set it up with your game

You need the installed Drift City client: the folder that contains DriftCity.exe and Data (with Init.agt, World.agt ...). The rebuild finds it in this order:

  1. -gameRoot "C:\Games\Drift City" on the command line
  2. the DRIFTCITY_ROOT environment variable
  3. a file named gameroot.txt next to the player exe (or next to Assets in the editor) holding that path

It only reads the folder; it never writes to it.

Download and play

  1. Get DriftCityRebuild-Client-win64.zip from the latest release and unzip it anywhere.
  2. Create gameroot.txt next to DriftCityOffline.exe with your game path.
  3. Run DriftCityOffline.exe.

Build and run the client

  1. Install Unity 6000.4.2f1 (Unity Hub).
  2. Clone the repository and open DriftCityOffline in Unity.
  3. Create DriftCityOffline/gameroot.txt with your game path.
  4. Open Assets/Scenes/DriftCityGame.unity and press Play, or build with Drift City > Build Windows Player (no game data). Put a gameroot.txt next to the built DriftCityOffline.exe too.
git clone https://github.com/MagicIbrar/driftcity-unity.git
echo C:\Games\Drift City> driftcity-unity\DriftCityOffline\gameroot.txt

Host the server

Only needed to play online. The client plays offline without it.

  1. Install Node.js 22.5 or newer and get DriftCityRebuild-Server.zip from the latest release (or use the DriftCityServer folder of the source).
  2. In the server folder (from source: run npm install first), put your game path in gameroot.txt (or set DRIFTCITY_ROOT).
  3. Start it with npm start (or start-server.bat). On the first start it reads the tables it needs from your game's archives into a local gamedata folder, then listens on TCP port 7860.
  4. Players pick "This PC" on the server list, or add Name|ws://HOST:7860 to servers.txt next to the client.

Admins can type players, say, announce, kick, mute, ban and more in the server window; node tools/bot.js 3 starts test drivers.

The game

Drift City is an online racing game built on the Gamebryo engine and run through the Hangame portal: players drive freely through open cities, take missions from the stations, chase HUVs, race each other in the Battle Zone, form crews to fight over channels, and team up underground in the Undercity. Its official servers have been closed for years. This rebuild keeps the game playable from the client files its players still have, and documents how it worked.

Credits

Team Vanilla

Thank you for your help with this project and the GitHub repository.

TY

Thank you for your help with this project.

And thank you to everyone who kept their Drift City client and helped test the rebuild.