Windows 95 had dedicated code to nix an OG Sim City bug

The original SimCity.
(Image credit: EA)

The nature of the internet is that an amazing piece of information can be out there for decades, before the right person shares it and everyone's slightly gobsmacked we missed it for so long. This is hardly the most consequential of tales, but it was first shared by software engineer Joel Spolsky way back in the year 2000 in a post about the chicken and egg problem for platform and software developers.

A few days ago Kal Yoshika, a podcaster and game developer, read the blogpost and shared this story about Sim City (and the tweet was subsequently picked up by outlets including RPS) that's just been out there in the wilds for the past twenty years.

Spolsky is writing about how important backwards compatibility was for Microsoft, and how the success of Windows 3, in Spolsky's interpretation at least, could in part be put down to how well it ran older software. Thus we move onto Windows 95…

"Windows 95? No problem," writes Spolsky. "Nice new 32 bit API, but it still ran old 16 bit software perfectly. Microsoft obsessed about this, spending a big chunk of change testing every old program they could find with Windows 95.

"Jon Ross, who wrote the original version of SimCity for Windows 3.x, told me that he accidentally left a bug in SimCity where he read memory that he had just freed. Yep. It worked fine on Windows 3.x, because the memory never went anywhere."

On a different operating system, however, this bug could stop the game working altogether: and SimCity was a very popular game indeed.

"Here’s the amazing part," writes Spolsky. "On beta versions of Windows 95, SimCity wasn’t working in testing. Microsoft tracked down the bug and added specific code to Windows 95 that looks for SimCity. If it finds SimCity running, it runs the memory allocator in a special mode that doesn’t free memory right away. That’s the kind of obsession with backward compatibility that made people willing to upgrade to Windows 95."

These days every game receives post-launch support but, back then, whatever bugs a game shipped with would be a part of it forever. The industry as it was didn't have post-launch support as a high priority, and it was out of the question that the SimCity developers would fix this bug: so Microsoft built a whole little system that temporarily runs your PC in a new manner to countervent it. It's one of those heroic programmer moments where no-one would ever have known about this if not for Spolsky's post, because it did the job.

Yoshika's initial sharing of this led to some others chiming in with their favourites. The superbly named code_and_beer points out that the PC version of Final Fantasy VII "will outright die if it sees it's running on Win NT instead of Win95, so Windows lies based on the presence of some files." That is, NT tells FF7 it's running on Windows 95, even though it's not, just so Square Enix's magnum opus runs. Brilliant.

SimCity programmer Jon Ross would go on to work on the series for many years, and is responsible for one of the silliest game easter eggs ever. It will (probably) make you laugh though.

Joel Spolsky is now retired after a long and extraordinary career in software, during which he worked on world-famous products and founded multiple companies. His personal website is infrequently updated but absolutely rammed with his thoughts on technology and the wider issues the industry faces.

Rich Stanton

Rich is a games journalist with 15 years' experience, beginning his career on Edge magazine before working for a wide range of outlets, including Ars Technica, Eurogamer, GamesRadar+, Gamespot, the Guardian, IGN, the New Statesman, Polygon, and Vice. He was the editor of Kotaku UK, the UK arm of Kotaku, for three years before joining PC Gamer. He is the author of a Brief History of Video Games, a full history of the medium, which the Midwest Book Review described as "[a] must-read for serious minded game historians and curious video game connoisseurs alike."