In 1991, DUX Software licensed the rights to port Maxis Software's SimCity to Unix. Don Hopkins, working then as a contractor for DUX, rewrote the Mac version of the game to run on numerous Unix platforms. More recently, John Gilmore, an advisor to the One Laptop Per Child (OLPC) initiative, suggested the idea to Hopkins of bringing the game to the OLPC's XO laptop. Hopkins told SimCity creator Will Wright, who was enthusiastic about the idea and got the ball rolling at Electronic Arts, the current owner of Maxis.
Hopkins has done the majority of the additional programming needed for the XO port. He started with the TCL/Tk version of the game that he originally created for the Unix platforms. Gilmore has been helping in debugging and sorting out intellectual property issues in order to have the game, under the name Micropolis, released under the GPL for the XO.
We spoke with Hopkins, who described for us the technical nature of the work involved in this port.
What have been the major challenges in porting SimCity to the OLPC's XO laptop?
Installing and building the early version of the OLPC development environment was a challenge, but the development process has gotten easier as more people have volunteered to work on the project, gone through the process, submitted bugs and fixed them.
The main programming tasks were converting SimCity to use one full-screen window, supporting sound, and integrating SimCity into the Sugar environment by making a Python adapter activity. The Etoys project provided a good example of how to do that.
Please describe what the porting process entailed.
Because the OLPC uses the X Window System, which SimCity already supported, the port was relatively easy. Most of the work involved re-designing the windows and dialogs to work with the full-screen window manager, making a splash screen, a new start-up screen, supporting sound, adjusting fonts, removing old dead code, fixing bugs, and making a simple Sugar wrapper written in Python that runs TCL/Tk SimCity in another process, and roughly integrates it with the OLPC Sugar user interface.
How would you describe the state of the SimCity code when you received it?
It had to be converted to ANSI C, reorganized and cleaned up a lot, in order to compile on the Sun C compiler. It was written with a lot of clever thought to simplification and efficient data representation. It doesn't use complex or dynamic data structures, except for the "modern" user interface, of course. But it's also very messy and informal in a lot of ways.
What's your opinion about the way it was originally written?
It was designed by exploring a vast possibility space, playing around, experimenting, measuring, accreting features, accumulating small changes, adding multiple layers, with lots of tweaking and tuning to make [game play] fun—but not necessarily "realistic."
It's brilliant code to read and learn from, which is why I'm so happy to get it released as GPL Open Source code. People don't usually write programs as simple and efficient as SimCity any more, but it's still important to write code for the OLPC as small and fast as possible because of its limited memory and CPU power. The OLPC is an amazingly powerful machine, compared to home computers at the time SimCity was originally released. It's several orders of magnitudes faster and more powerful than the Commodore 64 that SimCity was originally written on, so the OLPC [version of SimCity] can easily simulate more than a year [per] second.