Decompiling Fast Food Tycoon 2
The computer game Fast Food Tycoon 2, a business simulator released in 2001, was decompiled by the author over the course of a few days. The game allows players to build a pizza empire within a living, isometric city, managing restaurants, warehouses, staff, and supply chains. Players compete with rival companies through advertising, political influence, and organized crime.
To decompile the game, the author set up an agentic loop on their computer using GPT-6.1 Sol Medium. They utilized Ghidra to decompile the 4,046 functions of fastfood2.exe into approximately 9.5MB of C-like text. This raw code was then loaded into SQLite and integrated with a script to facilitate finding related functions without the need to sift through extensive text.
The author employed Windows' ReadProcessMemory API to inspect the running game, comparing memory values with what appeared on screen. This allowed them to identify memory addresses for cash, camera position, and selected buildings, among other elements. The Windows message handler was subsequently patched to enable sending commands to the game's UI thread, enabling control over the game without altering the executable on disk.
The author discovered additional unknown controls through a crawler that navigated the game's interface. The city in the game is painted with a few hundred sprites, with the background rendered into a buffer in memory. The renderer visits map cells diagonally (isometrically) and draws the scene over the background, keeping hidden elements visible by marking them with temporary pixel values.
The renderer combines each pixel's color with its lighting value and writes to the final 16-bit display buffer, applying a repeating dither pattern to draw intermediate shades. The efficiency of the renderer is highlighted by displaying pixels that changed within the last 0.6 seconds, such as cars, walkers, swaying tree tops, and blinking signs. Daylight follows a table of 25 hourly brightness values, with lamps responding to the light level to switch on and off at specific times throughout the night.
The game's pizzeria stages have their own light masks, stored in .spr files, which the renderer uses to compare color values and brightness levels to ensure that windows and signs remain bright even when the rest of the building darkens. Each pizzeria stage has its unique light mask, and the renderer draws window colors from a separate file before applying the light mask.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.