Micropolis

From OLPC
Jump to: navigation, search
Micropolis icon.svg
See also SimCity

Micropolis is one of the oldest and grandest of city simulation games. A Linux port by Don Hopkins was released by Electronic Arts under the GPL for distribution on the XO (See Don Hopkins' blog for more background).

Installing Binaries

Screenshot from the game

Installing activity bundles can be simple or complex.

If you are running Build 623, Ship.1, Ship.2, or something similar, and you have never installed Micropolis before, it should be easy. On your XO, open the web browser, and go to this page. Click on the link for Micropolis-8.xo. As it starts to download, you should see the Frame pop up briefly around the edge of the screen, with a document icon along the upper left side of the frame. When the download is done, the browser and the journal will automatically install the Micropolis activity. You should be able to find it by going into the frame (with the upper right corner "frame key"; it has a rectangle on it). Use the (<) and (>) circles along the bottom of the screen, to see all the different activity icons. Click on the one for Micropolis (as shown at the top of this web page).

If you are running a different build, I'm not sure what to suggest.

Latest stable XO activity bundle: Micropolis-8.xo.

Obtaining Sources

The source code of Micropolis is checked into "git" here.

The Micropolis source code release includes two different generations of code: old and new.

Old Generation: C TCL/Tk Micropolis

The old generation of the source code is the TCL/Tk version of Micropolis (based on SimCity for X11). It is written in C, and the user interface is scripted in TCL with extensions to the Tk user interface toolkit, which runs on X11. It uses an old version of TCL/Tk from 1993.

It currently doesn't support 24 and 32 bit screens, only 16 bit, 8 bit and 1 bit. (This bug may be fixed soon.)

New Generation: C++ Python Micropolis

The new generation of the source code is MicropolisCore. It is based on the TCL/Tk code, but all of the scripting language, user interface and operating system dependent code has been removed. It's been translated to C++, reorganized and cleaned up.

The SWIG interface generation tool was used to integrate Micropolis with Python as an extension module. It also includes a general purpose Cairo based TileEngine that renders the SimCity tiles, and a Cellular Automata Machine engine, which also uses the TileEngine to render the cells.

MicropolisCore is not yet a playable game, but it's the beginning of an engine that can be used in many different situations, like OLPC XO-1 laptops, desktop applications, embedded devices, and web servers.

Why Change a Good Thing?

Rewriting Micropolis in C++ is the first step towards rewriting it in other better languages, and necessary for integrating it with Python. It just happens to be quite easy to translate C to C++ without heavily modifying it or changing its meaning. The entire state of the simulation is encapsulated inside of a C++ object, instead of global variables and functions, so it's possible to have any number of them running in parallel without interfering with each other (for a web server or multi player game).

C++ also makes it very easy to use SWIG to integrate the code with many different scripting languages. SWIG opens Micropolis up to many different scripting languages, instead of locking it into one scripting language or user interface toolkit. Eventually, the idea is to rewrite Micropolis in an easier to understand and maintain language like Python and to put a high-level kid-friendly visual programming language interface over it. However, the first step is to clean up and rationalize the existing code base and make the basic game playable.

Building Micropolis

The old generation code builds on Fedora 7. It doesn't depend on the sugar-jhbuild environment.

The new generation code builds and runs on Fedora 7 as well as Windows (with Microsoft Visual Studio 8). Other people will port it to other platforms like the Mac in the future.

Bil Simser has written a series of articles on his blog about building Micropolis on Windows: Building A City - The Series.

History and Future of Micropolis

  • The original version of SimCity was developed by Maxis on the C64, and ported to various platforms, including the Macintosh. Maxis licensed the Macintosh SimCity source code to DUX software, to port to Unix.
  • DUX Software contracted Don Hopkins to port SimCity to Unix, and he developed "SimCity HyperLook Edition", while working at the Turing Institute on HyperLook with Arthur van Hoff. The user interface was written in PostScript, which ran on the NeWS window system on Sun workstations, and it supported multiple zoomable views, pie menus, annotating and printing maps, and many user interface improvements.
  • After Sun canceled NeWS, DUX Software contracted Hopkins to rewrite the HyperLook user interface in TCL/Tk for X11, and he developed a multi-player networked user interface using the X11 protocol. The TCL/Tk version of SimCity has been ported to various Unix and non-Unix platforms, including SunOS, Solaris, Irix, HP/UX, OSF/1, Quarterdeck Desqview/X, NDC X Terminals, Warp, and Linux. The contract to sell SimCity for Unix expired after ten years, so the TCL/Tk version was no longer commercially available.
  • OLPC SimCity is based on the TCL/Tk version of SimCity. SimCity is a trademark of Electronic Arts. Don Hopkins adapted SimCity to the OLPC, thanks to the support of John Gilmore. OLPC SimCity will be shipped with the OLPC, and it has been run through EA's quality assurance process and reviewed for integrity. EA reserves the right to review and approve any version of the game distributed under the name SimCity.
  • "Micropolis" is the name of the current GPL open source code version of OLPC SimCity. That was the original working title of Will Wright's city simulation game. Since Micropolis is licensed under the GPL, anyone can do anything they want with it that conforms with the GPL, except they can't call it "SimCity" (and a few other limitations to protect EA's trademarks).
  • Other differently named projects can be forked from the Micropolis source code, as long as they're not called SimCity.
  • Improvements to the open source code base that merits EA's approval may be incorporated into the official "OLPC SimCity" source code, to be distributed with the OLPC under the trademarked name "OLPC SimCity", but only after it's been reviewed and approved by EA.
  • In the short term, the TCL/Tk version of Micropolis can be upgraded to support the latest version of TCL/Tk, fix bugs, improve the user interface and Sugar integration, etc. Once that is stable as well integrated into Sugar, it could be submitted to EA to become the official version of "OLPC SimCity" distributed on the XO laptop.
  • In the long term, Micropolis can be recast from C to C++ classes, so it's possible to define clean interfaces between software modules, and make multiple instances of the simulator that don't interfere with each other, as well as easily interfacing it to Python using the SWIG interface generator. That should be done in a language-neutral way, so you could plug the simulator engine into many different languages and programming systems. Then more work needs to be done to open it up, and make it re-vectorable (plug-ins, events, callbacks, hooks, aspect oriented programming, etc), so you can replace and extend the various modules with the host language(s), eventually re-implementing most if not all of SimCity in another language.

Redesigning the SimCity User Interface for the OLPC

User Interface enhancements

(These would take Micropolis from a single-purpose game into a general-purpose simulation environment)

UI enhancements

Simplify the SimCity interface and make it easier for kids to use it with the game controller, in a way that will support multi player interaction.

Collapse the separate concepts of game editing tool (bulldozer, road, residential zone, etc) and agent (sprites like the monster, tornado, helicopter, train, etc).

Editor changes

Undo/Redo/Nudge -- it is very annoying, sometimes impossible, to bulldoze an expensive item that was misplaced.

Edit the world.

All SimCity editing tools (including colored pens that draw on overlays) should be available to the agent.

Enable users to plug in their own editing tools, that they can use themselves with the mouse, keyboard or game controller, or program agents to use to edit the map under program control.

The road tool becomes a road building vehicle, that you can easily move up/down/left/right/diagonally with the game controller directional input. Requires much less coordination to draw straight roads than with a mouse.

The bulldozer tool becomes an actual bulldozer that you can drive around the map, crushing things in your wake.

This makes the game easily usable by little kids in book mode.

Also support small children using SimCity like a drawing tool or etch-a-sketch, simply doodling with the editing tools for the visceral pleasure of it, and setting fires and other disasters to watch it burn and mutate.

Collaboration enhancements

Agents with specialized tool represent different roles that kids can play. A bunch of kids can join together and play different roles at the same time in the same city. Instead of having a bunch of editing tools to switch between, you have a bunch of different agents you can drive around the map, like using a monster to crush things instead of a bulldozer, or riding around in a helicopter to scroll around and observe the map. Make a meta-game like pokemon trading cards or magic the gathering, about acquiring and deploying and using agents on the map. Give agents different budgets and constraints.

Use an agent to represent a user in the world, and control an editing tool. You see other users in the map driving around their editing tool agents.

Each editing tool can be associated with a particular agent, with a keyboard/game controller based user interface for moving around, as well as a mouse based interface for picking it up and dragging it around.

Turtles/Sprites/Agents

Logo Turtles (as a generalization of the monster, tornado, helicopter, etc)

Implement programmable logo turtles as agents that can move around on the map, sense it, and edit it.

Like Robot Odyssey agents, so you can go "inside" an agent, and travel around with it, operate its controls, read its sensors, and automate its behavior by wiring up visual programs with logic and math and nested "ic chip" components.

Plug in graphics to represent the agent: use classic logo turtle and SimCity sprites, but also allow kids to plug in their own. SimCity sprites have 8 rotations. SVG or Cairo drawings can be rotated continuously.

Re-implement the classic SimCity agents like the monster, tornado, helicopter, train, etc in terms of logo turtles, that kids can drive around, learn to use, open up and modify (by turning internal tuning knobs, or even rewiring).

Let kids reprogram the agents to do all kinds of other stuff.

Mobile robots, that you can double click to open up into Robot-Odyssey-esque visual program editors.

Agents have local cellular-automata-like sensors to read information about the current and surrounding tiles.

KidSim / Cocoa / StageCraft Creator let kids define visual cellular automata rules by example, based on tile patterns and rules. Show it a pattern that you want to match by selecting an instance of that pattern in the world, then abstract it with wildcards if necessary, then demonstrate the result you want it to change the cell to in the next generation.

Sense high level information about zones and overlays, so the agents can base their behavior on any aspect of the world model.

Support an extensible model by allowing users to add more layers.

Add layers with arbitrary names and data types at different resolutions:

byte, int, float, n-dimensional vector, color, boolean mask, musical note, dict, parametric field (i.e. perlin noise or other mathematical function) at each cell, etc.


Other ideas

Simcity meets robotwars. Good concept, but a lot of work.

This sounds like a good thing to prototyping using NetLOGO or another simulation language.

Cognitoy's MindRover is a more recent implementation of the Robot Odyssey ideas.

Being able to control items in the "real world" (like a Lego NXT robot) would provide some concrete benefits. In SimCity, putting up a new building can be "free", but they take resources, time, and energy in the real world. Having to control a battery-powered robot would make these resource trade offs more explicit.

Robot Odyssey

Build your own universal programmable editing tool. Roll your own von Neuman Universal Constructor. Smart robots you program to perform special purpose editing tasks.

The "Painter" picture editing program had a way of recording and playing back high level editing commands, relative to the current cursor position.

Remixing. Journaling. Programming by demonstration or example. You could use a tape recorder to record a bunch of SimCity editing commands that you act out (or you can just select them from the journal), then you can play those tapes back with relative coordinates, so they apply relative to where the agent currently is on the map. You can copy and paste and cut and splice any editing commands into tapes that you can use to program the robot to play back in arbitrary sequences.

Program an urban sprawl development-bot to lay out entire residential subdivisions, complete with zones, roads, parks and wires. Then program a luddite roomba-bot that sucks them all up and plants trees in their place.

This becomes really fun when we let players plug in their own programmed zones for the robot to lay out, and layers of data to control the robot's behavior, out of which they can program their own cellular automata rules and games (like KidSim / Cocoa / StageCraft Creator).

The GPL Open Source Code of "OLPC SimCity" is called "Micropolis"

The GPL source code version of SimCity will not be called "SimCity", but we will use the SimCity source code to make a city building game called "Micropolis", which was the original working title of SimCity. That's because EA reserves the right to review and QA the official version of the game that's published under the name "SimCity" on the OLPC.

So we can make improvements to the TCL/Tk version of Micropolis (based on the GPL source code), and submit them to EA for review and QA, which if they approve, will be used as the officially branded version of SimCity for the OLPC. It will be the same code, but the only difference is the name, which EA understandably wants to protect, be ensuring the quality and integrity of OLPC SimCity.

License

The bulk of the code and images in Micropolis are copyrighted by Electronic Arts Inc. The word SimCityTM and many others that begin with Sim are also trademarked by Electronic Arts. EA has released the game under the GNU General Public License, version 3. As permitted under the GPL, EA has licensed the code with some additional terms:

Micropolis!  This game was released for the Unix platform
in or about 1990 and has been modified for inclusion in the One Laptop
Per Child program.  Copyright (C) 1989 - 2007 Electronic Arts Inc.  If
you need assistance with this program, you may contact:
  http://wiki.laptop.org/go/Micropolis  or email  micropolis@laptop.org .

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.  You should have received a
copy of the GNU General Public License along with this program.  If
not, see http://www.gnu.org/licenses/ .

            ADDITIONAL TERMS per GNU GPL Section 7

No trademark or publicity rights are granted.  This license does NOT
give you any right, title or interest in the trademark SimCity or any
other Electronic Arts trademark.  You may not distribute any
modification of this program using the trademark SimCity or claim any
affliation or association with Electronic Arts Inc. or its employees.

Any propagation or conveyance of this program must include this
copyright notice and these terms.

If you convey this program (or any modifications of it) and assume
contractual liability for the program to recipients of it, you agree
to indemnify Electronic Arts for any liability that those contractual
assumptions impose on Electronic Arts.

You may not misrepresent the origins of this program; modified
versions of the program must be marked as such and not identified as
the original program.

This disclaimer supplements the one included in the General Public
License.  TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS
PROGRAM IS PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY
OF ANY KIND, AND YOUR USE IS AT YOUR SOLE RISK.  THE ENTIRE RISK OF
SATISFACTORY QUALITY AND PERFORMANCE RESIDES WITH YOU.  ELECTRONIC ARTS
DISCLAIMS ANY AND ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES,
INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY
RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A COURSE OF DEALING,
USAGE, OR TRADE PRACTICE.  ELECTRONIC ARTS DOES NOT WARRANT AGAINST
INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL
MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE
UNINTERRUPTED OR ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE
WITH THIRD PARTY SOFTWARE OR THAT ANY ERRORS IN THE PROGRAM WILL BE
CORRECTED.  NO ORAL OR WRITTEN ADVICE PROVIDED BY ELECTRONIC ARTS OR
ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY.  SOME
JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON IMPLIED
WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A
CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY
NOT APPLY TO YOU.

In case this confuses you, here is a simpler explanation. The Micropolis code is free software. But the code as released by EA used EA trademarks. We could not modify the code and distribute it unless we (1) made it clear to the player that we have modified it, and (2) removed all the EA trademarks from the game. (We also have to follow all the other rules in the GPLv3, the EA additional terms, and the copyrights of other contributors. This was just a very brief summary.)

A small team of people is working on Micropolis (which was Will Wright's original code name for the game as he was designing it). If you want to improve the game, come help!

History

Screenshot from the game

This Micropolis game came from the original SimCity, through a complex lineage.

Don Hopkins breaks it down like so:

I ported the Mac version of SimCity to SunOS Unix running the NeWS window system about 15 years ago, writing the user interface in PostScript. And a year or so later I ported it to various versions of Unix running X-Windows, using the TCL/Tk scripting language and gui toolkit. Several years later when Linux became viable, it was fairly straightforward to port that code to Linux, and then to port that to the OLPC. After removing all EA trademarks, we have... Micropolis!

More information

Ideas

"The goal is to enable the open source community to renovate SimCity and take it in new educational directions" [1]
  • Simutrans and Lincity graphics could be used to enhance Micropolis where appropriate.
create weekly builds in various platform specific binaries (MacOS, Windows, Linux, etc).

Game examples

  • A Micropolis-based engine could be used for games along the lines of
    • Genius Politik: The player is a politician and has to mediate between different political currents and make decisions about city planning and urban management, following proper political procedure instead of a "point and click" decision-making process. (Citizenship education)
    • Genius - Task Force Biologie: The player is a biologist and works for the UN to restore lost biotopes around the world.

The player could be required to take care of the education of children (e.g. to co-finance schools, to address school issues and to buy OLPC laptops) and to participate in the education and upbringing of his or her own children in the game. (In a game like Task Force Biologie the player could, for instance, need the school to be able to employ qualified biologists later on) This would add a further level of complexity to the game: The player would have to decide whether to attend to private issues or issues of professional life. An in-game calendar application could frequently show conflicting appointments and allow the player to choose. The selection of appointments could also lead to a different social environment: The player would only be able to contact people he had previously met somewhere.

See also

External links

Activity Summary

Icon: Sugar icon::Image:Micropolis_icon.svg
Genre: Activity genre::Games
Activity group: ,|x|Activity group::x}}
Short description: Short description::Micropolis is one of the oldest and grandest of city simulation games
Description:
Maintainers: ,|x|Contact person::x}}
Repository URL: Source code::http://dev.laptop.org/git?p=projects/micropolis-activity
Available languages: ,|x|Available languages::x}}
Available languages (codes): ,|x|Language code::x}}
Pootle URL:
Related projects: Related projects,|x|Related projects::x}}
Contributors: ,|x|Team member::x}}
URL from which to download the latest .xo bundle Activity bundle::
Last tested version number:
The releases with which this version of the activity has been tested. ,|x|Software release::x}}
Development status:
Ready for testing (development has progressed to the point where testers should try it out): ,|x|Ready for testing::x}}
smoke tested :
test plan available :
test plan executed :
developer response to testing :


URL from which to download the last .xo bundle that works with old releases Activity bundle::Media:Micropolis-8.xo
Activity version number: Activity version::8
The releases with which this version of the activity has been tested. ,|x|Software release::x}}
Development status: