<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
This holiday I got a lot of work done reworking Micropolis for Python
and Cairo! <br>
<br>
The "MicropolisCore" project includes the latest Micropolis (S*mC*ty)
source code, cleaned up and recast into C++ classes, integrated into
Python, using the wonderful SWIG interface generator tool:
<a class="moz-txt-link-freetext" href="http://www.swig.org">http://www.swig.org</a><br>
It also includes a Cairo based TileEngine, and a cellular automata
machine CellEngine, which are independent but can be plugged together,
so the tile engine can display cellular automata cells as well as
SimCity tiles, or any other application's tiles.<br>
<br>
This is what SJ was asking for at his keynote talk at last year's game
developer's conference: deconstruct games like SimCity into reusable
components for making other games! <br>
<br>
I also wrote some example Python code that uses the TileEngine module
to make a scrolling zooming view of a live city with the Micropolis
module, and a scrolling zooming view of a cellular automata with the
CellEngine module. <br>
<br>
The TileEngine comes with a Python TileWindow base class that
implements most of the plumbing, tile display and mouse tracking, so
SimCity and the CellEngine can easily subclass and customize to suit
their needs. <br>
<br>
You can pan with the mouse and arrow keys, and zoom in and out by
typeing "i" or "o", or "r" to reset the zoom. <br>
<br>
The TileEngine supports zooming in and out, and has a lazy drawing
feature that calls back into Python to render and cache the scaled
tiles right before they're needed (so you can implement the tile
caching strategy in Python, while the rendering is in efficient C++
code calling hardware accelerated Cairo -- and the Python code could
easily render tiles with pretty scaled SVG graphics). <br>
<br>
The Micropolis engine can load a SimCity save file and run it, and use
the TileEngine to draw it, but you can't actually interact with it or
edit the map yet, since the user interface and other views haven't been
implemented, just a scrolling zooming view of its tiles. <br>
<br>
I hope this code serves as a good example of how to use SWIG to
integrate C++ classes into Python and Cairo, in a portable cross
platform way that works on Linux and Windows. <br>
<br>
-Don<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.DonHopkins.com/home/micropolis">http://www.DonHopkins.com/home/micropolis</a><br>
<h1>Micropolis Downloads</h1>
<p> This is the binary and source code for Micropolis (A.K.A.
"S*mC*ty": see the <a
href="http://www.donhopkins.com/home/micropolis/#license">GPL License
and additional terms, below</a>), which is released under the GPL. </p>
<p> Questions to <a href="mailto:dhopkins@DonHopkins.com">dhopkins@DonHopkins.com</a>.<br>
</p>
<ul>
<li> <b><a
href="http://www.donhopkins.com/home/micropolis/micropolis.xo">micropolis.xo<br>
</a></b><a class="moz-txt-link-freetext" href="http://www.donhopkins.com/home/micropolis/micropolis.xo">http://www.donhopkins.com/home/micropolis/micropolis.xo</a><br>
Download this to TCL/Tk Micropolis install on the OLPC XO-1. </li>
<li> <b><a
href="http://www.donhopkins.com/home/micropolis/micropolis-activity.tgz">micropolis-activity.tgz</a></b><br>
<a class="moz-txt-link-freetext" href="http://www.donhopkins.com/home/micropolis/micropolis-activity.tgz">http://www.donhopkins.com/home/micropolis/micropolis-activity.tgz</a><br>
Download this to install TCL/Tk Micropolis on x86 Linux systems. </li>
<li> <b><a
href="http://www.donhopkins.com/home/micropolis/micropolis-activity-source.tgz">micropolis-activity-source.tgz<br>
</a></b><a class="moz-txt-link-freetext" href="http://www.donhopkins.com/home/micropolis/micropolis-activity-source.tgz">http://www.donhopkins.com/home/micropolis/micropolis-activity-source.tgz</a><br>
Download this to build TCL/Tk Micropolis from source. </li>
<li> <b><a
href="http://www.donhopkins.com/home/micropolis/MicropolisCore.tgz">MicropolisCore.tgz<br>
</a></b><a class="moz-txt-link-freetext" href="http://www.donhopkins.com/home/micropolis/MicropolisCore.tgz">http://www.donhopkins.com/home/micropolis/MicropolisCore.tgz</a><br>
Download this to build the Python modules micropolis, cellengine and
tileengine.
<ul>
<li> The micropolis module is the new version of Micropolis,
cleaned up and recast as a C++ class. </li>
<li> The cellengine module is a cellular automate machine engine.
</li>
<li> The tileengine module is a Cairo based tile renderer, used
to display micropolis tiles and cellengine cells. It plugs into
micropolis and cellengine, but is independent of them and useful for
other applications. </li>
<li> These modules require Python 2.5 and the Python modules
pygtk, pycairo and PIL to be installed. Probably some other modules I
can't think of off the top of my head, too. </li>
<li> This code will compile on Windows or Linux. It is intended
to be used with the OLPC's Sugar user interface environemnt (depending
on Cairo and Pango for graphics and text formatting), but layered so
the core code is useful in other contexts such as different scripting
languages, web servers, desktop applications, embedded devices, etc. </li>
</ul>
</li>
</ul>
<h1><a name="license">Micropolis GPL License Notice</a></h1>
<p> Micropolis, Unix Version. 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: </p>
<p> <a href="http://wiki.laptop.org/go/Micropolis">http://wiki.laptop.org/go/Micropolis</a>
or email <a href="mailto:micropolis@laptop.org">micropolis@laptop.org</a>.
</p>
<p> 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="">. </http:></p>
<h2>ADDITIONAL TERMS per GNU GPL Section 7</h2>
<p> 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. </p>
<p> Any propagation or conveyance of this program must include this
copyright notice and these terms. </p>
<p> 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. </p>
<p> 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. </p>
<p> 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. </p>
<br>
</body>
</html>