Excellent question! It's a classic game with a lot of technical depth.
SimCity 4 was primarily written in C++.
Here's a more detailed breakdown of the languages involved:
1. C++ (The Core Engine)
The vast majority of the game's core engine—the part that handles graphics, the simulation itself, memory management, and all the heavy lifting—was written in C++.
- Why C++? In the late 1990s and early 2000s, C++ was the undisputed industry standard for developing high-performance PC games. It provided the necessary speed and low-level control over system hardware (like memory and the graphics card) that a complex simulation like SimCity 4 demanded.
2. Lua (The Scripting and Game Logic)
While the engine was C++, much of the game's actual content and logic was handled by a scripting language called Lua.
- Why Lua? This is a very common practice in game development. Separating the "engine" (C++) from the "game logic" (Lua) allows developers and designers to easily tweak, modify, and add content without having to recompile the entire engine. They could change a building's stats, write a new mission, or adjust advisor logic just by editing a Lua script. For the modding community, many of the game's
.dat files contain compiled Lua scripts that can be modified to change game behavior.
3. Assembly Language (For Optimization)
It is almost certain that small, highly-optimized, performance-critical routines were written directly in Assembly language. This was a common practice at the time for tasks where every single CPU cycle counted, such as in the graphics rendering pipeline or core simulation loops.
Summary Table
| Role | Language | Purpose |
|---|
| Core Engine | C++ | The main program, simulation, graphics, and performance-critical code. |
| Game Logic/Scripting | Lua | Defining building properties, missions, UI behavior, and advisor logic. |
| Low-Level Optimization | Assembly (likely) | Small, ultra-fast routines to maximize performance. |
So, while the simple answer is C++, a more complete answer is that it was a combination of C++ for the engine and Lua for the game's logic and data.