SimCity Source Code Is Now Open
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!"
... a big scream was heard, as if a thousand hours had suddenly been lost.
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
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!
My very own Linux city!
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.
It builds, but you get to the loading screen and then you can't actually start a game. It Freezes.
Does anyone know if there are Win32 binaries available?
I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.
Now, if they will only open-source that dark brown piece of paper with the glyphs printed in black on it...
Who would have known? Thanks for the warning I almost got close to maybe think about clicking the link, you saved me!
The godless atheist Linux crowd can now eliminate the 1 line of code that creates a tornado every time you bulldoze a church.
Contrary to the title, this doesn't seem to be the actual SimCity source code. I'm interested in source code like this, but I want the 'original', not something that has been mashed up and modified by a middleman. This is as useful for historical insight a klingon version of the new testament.
Belief is the currency of delusion.
This is actually clearly explained in one of the linked articles:
Why all the effort to port to C++ ? C rocks !
It needed to be updated, because it ran too fast on modern hardware.
It actually states the history of where it's come from in one of the linked articles (emphasis added):
So it looks as if it's some kind of mutated version of SimCity Classic which dates back to the C64 version.
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.
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.
Jumpstart the tartan drive.
Hunh. And here I was thinking that my 2Ghz computer could run-time compile code faster than my old 4Mhz computer could run native code.
Glad you set me straight on that.
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. I hope at least the core simulation is all one language.
You can pick up Simcity4 for like 5 euro, and (especially with Rush Hour) is a _much_ better game and you don't need supermodern hardware to play it.
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.
Yes it did. I believe it was in June or so of last year. Now the browser costs 500 points.
11 was a racehorse
12 was 12
1111 Race
12112
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.
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.
-Don
Take a look and feel free: http://www.PieMenu.com
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.
It's a simple matter of complex programming.
I guess a new disaster needs to be added: Slashdotting
It's official, the terrorists have won.
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
Take a look and feel free: http://www.PieMenu.com
Unless you live in some alternate universe, (where I would like to move), SNES games are 800 points ($8 US).
"I think an etch-a-sketch with an ethernet port would beat IE7 in web standards compliance."
NeWS was like AJAX, but with PostScript instead of JavaScript for programming, with PostScript instead of DHTML for rendering, and with PostScript instead of XML for data representation.
-Don
Take a look and feel free: http://www.PieMenu.com
From Designing User Interfaces to Simulation Games, a summary of Will Wright's talk to Terry Winnograd's User Interface Class at Stanford, in 1996.:
-Don
Take a look and feel free: http://www.PieMenu.com
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!)
Take a look and feel free: http://www.PieMenu.com
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
Take a look and feel free: http://www.PieMenu.com
The UI is quite abstract. I had to cleanly separate the UI and the simulator engine to port SimCity to NeWS, and TCL/Tk maintained that separation. The new MicropolisCore has all the UI code taken out, so all the rendering and event handing has to be implemented outside of the simulator core, in a scripting language like Python, with a graphics library like Cairo, and a user interface toolkit like GTK.
The new Micropolis core simulator engine talks to the tile engine through efficient raw memory pointers. Micropolis hands the tile engine a pointer to its tile memory and a description of the format, and a tile bitmap and a description of the tile layout (including an indirect tile map). The tile engine uses Cairo to render the tiles. Cairo is a much more advanced imaging library than SDL, and most importantly it supports Unicode and fully internationalized text via the Pango library (OLPC activities must support many different languages). Cairo enables scaling and transformation, vector graphics, anti-aliasing, clipping, SVG, etc. It is more like the PostScript based user interface to SimCity I developed for NeWS. The Cairo tile engine supports zooming into the city, and the old NeWS version used to let you play the game at any scale. Zooming is very important on the OLPC's 200 dot per inch resolution screen, because the unscaled tiles are very small, and kids like to zoom in to look closer at the city, so it's easier to see. Another reason for using Cairo is that it's great for drawing map overlays and data visualizations, with scalable vector graphics, transparency, etc. And also, Cairo is hardware accelerated on Linux, the Mac and Windows, so it can draw extremely fast and still look pretty.
-Don
Take a look and feel free: http://www.PieMenu.com
I couldn't hear you, I was busy watching the NYC episode of the Simpsons and - NOOOOooooooooo...
Evidently, the key to understanding recursion is to begin by understanding recursion. The rest is easy.
Hey, dipshit. It doesn't matter if this game only runs at 30000 FPS on your 4 GHz quad-core Core2 Duo just because it uses Python, rather than the 80000 FPS it would achieve were it completely written in C. I mean, your goddamn fucking eyes and brain don't even notice any difference once you exceed 40 FPS. What the hell is wrong with you? Your ignorance of Python makes you look like a shitfool.
What the hell is this Lunix thing that so many keep talking about?
Bro, you suck at your job.
For the perfect anti-Unix, write an OS that thinks it knows what you're doing better than you do and let it be wrong.
Lunix is one of the most powerful contraceptives evar ....It is an operating system that was the result of really crappy reverse-engineering efforts to create a free version of UNIX. Linus Torvalds and Alan Cox are the perpetrators behind this travesty. Tons of people use it, especially hippies, and no one really likes it except the terminally uncool. Most of them use it in violation of SCO's intellectual property rights. To use Lunix legally, one must pay a $699 license fee to SCO for each processor that runs the Lunix kernel.
I believe I understand.
NeWS is like Lisp, but with PostScript instead of Lisp for programming, PostScript instead of Lisp for rendering, and PostScript instead of S-expressions for data representation.
I, for one, would like to welcome Don Hopkins: our sim-hacking overlord.
==================
Hippie Logger Jock
==================
Im guessing part of the reason is that it takes time to release code in "open source"-able format... Often, commercial software is written assuming that no one else will ever need to use it, so it may very well have weird dependencies...stuff like, to compile it you need a machine named "JOESBUILDER" with a X drive mapping to some network ressource, and all that is hardcoded... internally it didnt matter, but when you open source it, that doesn't work.
Cleaning up code -production code- is often not an option in the commercial world, nevermind code thats not used and doesn't return a profit anymore.
Add to that, that a lot of games, especially more recent ones, are full of middlewares that the company doesn't own...that rules those out.
UNIX SimCity was actually the first multiplayer SimCity game, and Micropolis seems to hold on to this feature. Not sure how to work it though.
"I think an etch-a-sketch with an ethernet port would beat IE7 in web standards compliance."
I imagine that I could probably run things at a pretty low tax rate in a world where a coal power plant costs $3000, and an airport costs $10000, and I can fully fund a police station for $50/year.
// MD_Update(&m,buf,j);
It's free software. Put that shit back in.
(That and I want a global thermal-nuclear war scenerio.)
It's a type of bug more common back when memory was limited. Classically, it was a spreadsheet bug. The dumb way to evaluate a spreadsheet is to start at the upper left, evaluating the formula (if any) for each cell. If any formula refers to a value that's to the right or below the cell being evaluated, the spreadsheet values will be wrong. Each time you hit the recalculate key, the values propagate through one more wrong-direction dependency. Once you've hit "recalc" enough times, the values stabilize. Unless the spreadsheet actually has a dependency loop, in which case they continue to change with every recalc.
All the early desktop spreadsheet programs (VisiCalc, etc.) used this dumb algorithm. The correct way to do it was known, but had been patented in 1969. It's also much more complicated to do it right; you have to build graphs, sort them by dependencies, and detect loops. It's so simple to do it with two nested FOR loops, and most of the time the complex algorithm yields the same answer as the dumb one.
Anything that has in-place updates of a grid of cells with arbitrary dependencies on other cells potentially has this problem. So it crops up in games, in image processing algorithms, and in simulations now and then.
Okay, that wasn't the best post ever. But Troll?
Anyway, the plane crash is one of the milder disasters in Sim City, so it would be teaching the kids that place crashes don't do much damage.
Actually, I think it wouldn't remind most of those kids of anything.
I suffer from attention surplus disorder.