Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

SimCity Source Code Is Now Open

Posted by kdawson on Sat Jan 12, 2008 04:01 PM
from the but-you-can't-call-it-that dept.
Tolkien writes "Source code for SimCity has been released under the GPLv3. For legal reasons the open source version was renamed Micropolis, which was apparently the original working title. The OLPC will also be getting a SimCity branded version that has been QA'ed by Electronic Arts. Some very cool changes have been made by Don Hopkins, who updated and ported what is now Micropolis. (Here is an earlier Slashdot discussion kicked off by a submission Don made.) Among other things, it has been revamped from the original C to using C++ with Python. Here is the page linking all the various source code versions. Happy hacking!"
+ -
story

Related Stories

[+] Games: One SimCity Per Child 253 comments
SimHacker writes "Electronic Arts has donated the original 'classic' version of Will Wright's popular SimCity game to the One Laptop Per Child project. SimCity is the epitome of constructionist educational games, and has been widely used by educators to unlock and speed-up the transformational skills associated with creative thinking. It's also been used in the Future City Competition by seventh- and eighth-grade students to foster engineering skills and inspire students to explore futuristic concepts and careers in engineering. OLPC SimCity is based on the X11 TCL/Tk version of SimCity for Unix developed and adapted to the OLPC by Don Hopkins, and the GPL open source code will soon be released under the name "Micropolis", which was SimCity's original working title. SJ Klein, director of content for the OLPC, called on game developers to create 'frameworks and scripting environments — tools with which children themselves could create their own content.' The long term agenda of the OLPC SimCity project is to convert SimCity into a scriptable Python module, integrate it with the OLPC's Sugar user interface and Cairo rendering library. Eventually they hope to apply Seymour Papert's and Alan Kay's ideas about constructionist education and teaching kids to program."
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • by Anonymous Coward on Saturday January 12 2008, @04:08PM (#22017618)
    ... a big scream was heard, as if a thousand hours had suddenly been lost.
  • Craptastic Code? (Score:5, Insightful)

    by DingerX (847589) on Saturday January 12 2008, @04:08PM (#22017622) Journal
    FTA:

    There's still a lot of craptastic code in there, but the heart of the software (the simulator) hasn't changed.


    I dunno, from the QA side in 88/89, the results were darn clean. The simulation would crash from time to time, but the interface, never. To all those who point to multi-threaded apps and say it's too hard for coders to do, I'd suggest that really good programmers are hard to come by.

    So maybe somebody can point to what's being complained about here. Back in the day, we didn't have the luxury of infinite space for code and variables. But from a quality-of-product point-of-view, very little could match (and can match) SimCity
  • Version? (Score:5, Interesting)

    by Anonymous Coward on Saturday January 12 2008, @04:09PM (#22017624)
    I can't see anywhere stating the obvious, what version is it? Simcity classic, 2000? 3000? 4000?

    I'm assuming the classic, which is a shame as I felt 2000 was one of the few times a sequel actually made the game better. Unfortunately 3000 and 4000 continued to suggest otherwise however.

    Even if it's just classic however I'm sure I remember even that had some differences between platforms.

    Perhaps I'm just blind but it'd be interesting to know which version this is!
    • Re:Version? (Score:5, Informative)

      by X0563511 (793323) <draeathNO@SPAMmember.fsf.org> on Saturday January 12 2008, @04:22PM (#22017772) Homepage Journal
      had you looked at the links, you would see this screenshot. [nyud.net]

      Looks a lot like Classic.
    • by jesterzog (189797) on Saturday January 12 2008, @04:54PM (#22018064) Homepage Journal

      It actually states the history of where it's come from in one of the linked articles [donhopkins.com] (emphasis added):

      • 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 me (Don Hopkins) to port SimCity to Unix, and I 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 me to rewrite the HyperLook user interface in TCL/Tk for X11, and I 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.

      So it looks as if it's some kind of mutated version of SimCity Classic which dates back to the C64 version.

  • by Anonymous Coward on Saturday January 12 2008, @04:11PM (#22017652)
    why it is that commercial zones placed more than a certain distance to the left of the city center never developed. I wonder if it was some kind of subtle political commentary on how leftist policy hurts business or something.
    • by Animats (122034) on Saturday January 12 2008, @06:19PM (#22018936) Homepage

      left of the city center

      Probably because they borrowed some of the code from SimAnt, which had less ant growth towards the upper left due to a processing order issue in the updating algorithm. It's one of those problems where step N+1 is computed incrementally from the current state, rather than from a frozen copy of step N.

  • Boo-hoo (Score:5, Interesting)

    by Anonymous Coward on Saturday January 12 2008, @04:21PM (#22017766)

    The plane crash disaster has been removed as a result of 9/11
    This is ridiculous.
    • Re:Boo-hoo (Score:5, Insightful)

      by Fred_A (10934) <fred.fredshome@org> on Saturday January 12 2008, @04:26PM (#22017836) Homepage

      The plane crash disaster has been removed as a result of 9/11
      This is ridiculous.
      I hope fires have also been removed as a result of California fires, tornadoes as a result of the Indian ocean tsunami and the big monster invasion as a result of Cmdr Taco. Other wise it wouldn't be very respectful for the victims you know.
  • good news (Score:5, Insightful)

    by brunoacf (1186539) on Saturday January 12 2008, @04:56PM (#22018084)
    That's amazing. It would be very nice if the code of other titles were released also. Many old (but good) softwares were forgoten because their sources were not available to maintain it's life.
  • No build on MacOS X (Score:5, Informative)

    by Midnight Thunder (17205) on Saturday January 12 2008, @04:56PM (#22018086) Homepage Journal
    Because someone is likely to ask it, this does not yet build on MacOS X, even if you are willing to accept X11 as the interface. If anyone has any success it would be worth knowing.
  • Lincity Absorption (Score:5, Interesting)

    by Zombie Ryushu (803103) on Saturday January 12 2008, @05:07PM (#22018194)
    So lets have the Lincity project absorb this project. Lincity NG is graphically on par with Simcity 2000, but its playability is lower and it misses features. Simcity 2000 was just a graphically enhanced Sincity Classic with a few playability enhancements and more structures. I see no reason why the LinCity project can't just assimilate this project, call it Super Lincity, and use the nessessary areas from Metropolis to fill its deficencies.
    • Re:Finally! (Score:5, Informative)

      by Anonymous Coward on Saturday January 12 2008, @04:47PM (#22018004)
      Luckily we already have much more advanced [berlios.de] clones on Linux than the old original whose code has been opened.

      Though their move is still good, and interesting just to dig into the code.

    • Re:huh? (Score:5, Funny)

      by that this is not und (1026860) on Saturday January 12 2008, @04:53PM (#22018060)
      Why all the effort to port to C++ ? C rocks !


      It needed to be updated, because it ran too fast on modern hardware.
      • Re:No, its worse (Score:5, Insightful)

        by Sentry21 (8183) on Saturday January 12 2008, @05:12PM (#22018244) Journal
        Your post shows a deep lack of understanding of how and where Python is used, and for what purposes. As an example, Civilzation IV is written partially in Python (the user interface, as I recall), and EVE Online has a significant portion written in Python as well. Considering that a lot of what Python does is I/O bound, and a lot more can be done in outside libraries (e.g. DirectX), using Python in game development can make things a lot easier, and a lot easier to modify down the road.

        Put aside your prejudices and you may actually learn something.
        • Re:No, its worse (Score:5, Informative)

          by SimHacker (180785) on Saturday January 12 2008, @05:27PM (#22018388) Homepage Journal

          To clear up some confusion: The old version of SimCity/Micropolis uses TCL/Tk to implement the user interface. That is the version currently being distributed on the OLPC. The new version is rewritten in C++, and has all the TCL/Tk and user interface stuff ripped out of it. I converted it to C++ for the reasons I described in other posts (quoted above), so it is now modular and can be run through SWIG to integrate it with many different scripting languages.

          But the core simulator is independent of Python, and runs extremely fast (the TCL/Tk version can run more than a year a second on the relatively slow OLPC). The OLPC uses Python as its standard system wide programming language, and all of its important libraries (like Cairo and Pango) are integrated as Python modules. So it makes the most sense to use SWIG to cast Micropolis into a Python module, first. Of course SWIG also makes it easy to integrate it with any other scripting language.

          If it's not immediately obvious to you (or even if it is), why anyone would want to integrate SimCity with a scripting language, instead of just writing the whole thing in C, then you should read some of the discussions I've been having with Alan Key about that topic, on my blog [donhopkins.com].

          -Don

        • Re:No, its worse (Score:5, Insightful)

          by PinkPanther (42194) on Saturday January 12 2008, @05:45PM (#22018556)

          C++ & Python does seem to be a weird and cumbersome choice though. But when all you have is a hammer everything looks like a nail

          One person's hammer is another person's "right tool". If you read the article, it appears to me that the guy who ported the code has a clue about a few things. I'm gonna bet that his choice of Python was thought through. Likely he is leveraging some existing infrastructures that he knows, thus speeding the time-to-release. To me, that's a very handy hammer.

          The code is now open. Feel free to hack onto oblivion the design choices you don't appreciate.

          • by SimHacker (180785) on Saturday January 12 2008, @05:50PM (#22018594) Homepage Journal

            The original SimCity code written in C ran just fine of an 8 bit 1.02 MHz 6510. And I've optimized to run even more efficiently since then. So worrying about Python slowing SimCity down is totally lacking in perspective -- penny wise but pound foolish. SimCity is already many orders of magnitude faster than it needs to be. Anyway, the core simulator is written in C, so Python doesn't slow it down at all. You should learn more about Python programming, developing Python modules in C and C++, and using SWIG for integrating Python and native code, and using Python as an embedded application extension language, before "making such [...] comments".

            Using Python drastically speeds up the software development process, which is a great thing when software developer's time is so expensive, and computers are so fast. Python is also is a much easier language for kids to read, learn and program -- and the OLPC is an educational project, not a laptop project.

            -Don

              • by SimHacker (180785) on Saturday January 12 2008, @06:31PM (#22019054) Homepage Journal

                Agreed. But Java isn't exactly what I'd call a scripting language. What I expect from a scripting language is the easy ability to interact with it on a command line or interactive interpretive interface (like Smalltalk). (It doesn't actually have to be interpreted, just compiled fast enough that I don't notice, like many Lisps and OpenLaszlo implement their interactive command line.) Java's problem is not just that the compilers and tools aren't set up for interactive evaluation, but also that the syntax makes it extremely tedious and required typing a lot of boilerplate structural crap. Of course there are some good interactive interpreted languages like JavaScript (Rhino), Python (Jython) and Groovy implemented in Java.

                The great thing about integrating C++ modules like micropolis with Python is that you can play around with it from the keyboard, test and debug it easily, and get it to work quickly. Immediately after I compiled the micropolis module for the first time, I was able to import it, make a simulator, load a city, set the tax rate, and run the simulation loop, all from the keyboard! Then I copied that code I typed into a python file, and I had the first test framework.

                -Don

        • by SimHacker (180785) on Saturday January 12 2008, @06:04PM (#22018776) Homepage Journal

          You can do anything in C you can do in C++, but it's a total pain in the ass. Why, you can even write a C++ compiler in C that compiles C++ into C, and call it CFront.

          If you want to see what happens when you try to simulate C++ interfaces in C, then look at Microsoft's COM header files, which do exactly that.

          The reasons I translated the C code to C++ were: 1) eliminate all global variables, so multiple simulators could exist simultaneously without interfering with each other, 2) define all interfaces in one place so it's easier to work with and evolve the code, 3) enable SWIG to automatically generate an object oriented wrapper for any of a large number of scripting languages, like Python, 4) Impose some sane programming conventions on the code, for reliability and readability's sake.

          I hate C++ as much as anyone else does, probably more than most [google.com]. But I know when it's better to use C++ than C, and this is one of those times.

          -Don

          ``The more important question of whether or not systems like C++ and X-Windows cause actual permanent brain damage in humans, will have to wait for the autopsies of human brain doners. That won't be soon, since they're still only in the animal experimentation stages. But I think it's reprehensible how they're exposing all those poor innocent bunnies to shoddy static class libraries without garbage collection, and high doses of raw Motif.''
          [From comp.lang.functional, ``Re: Effect of programming languages on thought'', Don Hopkins]
    • by SimHacker (180785) on Saturday January 12 2008, @06:23PM (#22018964) Homepage Journal

      Yes, it'll be great to port Micropolis (SimCity) to embedded devices! I'd like to port it to the TomTom, and hook it up so you can operate the bulldozer or road building tool via GPS, just by driving around!

      -Don

      (Disclaimer: I work for TomTom, and this should NOT be interpreted as a product announcement!)