Rollercoaster Tycoon wasnât the most fashionable computer game out there in 1999. But if you took a look beneath the pixelsâthe rickety rides, the crowds of hungry, thirsty, barfing people (and the janitors mopping in their wake)âdeep down at the level of the code, you saw craftsmanship so obsessive that it bordered on insane. Chris Sawyer, the gameâs sole developer, wrote the whole thing in assembly.
Certain programming languages, like Python or Go or C++, are called âhigh-levelâ because they work sort of like human language, written in commands and idioms that might fit in at a poetry slam. Generally speaking, a piece of software like a compiler transforms this into what the machine really reads: blocks of 1s and 0s (or maybe hex) that tell actual transistors how to behave. Assembly, the lowest of the âlow-levelâ languages, has a near one-to-one correspondence with the machineâs native tongue. Itâs coding straight to metal. To build a complex computer game from assembly is like weaving a tapestry from shedded cat fur.
Why would anyone do this? I recently asked Sawyer, who lives in his native Scotland. He told me that efficiency was one reason. In the 1990s, the tools for high-level programming werenât all there. Compilers were terribly slow. Debuggers sucked. Sawyer could avoid them by doing his own thing in x86 assembly, the lingua franca of Intel chips.
We both knew that wasnât the real reason, though. The real reason was love. Before turning to roller coasters, Sawyer had written another game in assembly, Transport Tycoon. It puts players in charge of a cityâs roads, rail stations, runways, and ports. I imagined Sawyer as a model-train hobbyistâlaying each stretch of track, hand-sewing artificial turf, each detail a choice and a chore. To move these carefully crafted pixels from bitmaps to display, Sawyer had to coax out the chipâs full potential. âRollerCoaster Tycoon only came about because I was familiar with the limits of what was possible,â he told me.
Working within the limits? A foreign idea, perhaps, in this age of digital abundance, when calling a single function in an AI training algorithm can engage a million GPUs. With assembly, you get one thing and one thing only, and it is the thing you ask forâeven, as many a coder has learned the hard way, if it is wrong. Assembly is brutal and beautiful that way. It requires you to say exactly what you mean.
Iâve done assemblyâs creators a disservice. They wanted things to be easier, not harder. I imagine they were tired of loading up punchcards and flipping switches on their steampunk leviathans. Perhaps they dreamed of a world like ours, where computers can do so much with such minimal guidance.
