Giter Site home page Giter Site logo

Comments (15)

SimHacker avatar SimHacker commented on April 28, 2024 4

You'll find some excellent analysis of the SimCity ("Classic") code and algorithms in Chaim Gingold's PhD Thesis on Play Design:

Abstract:
https://pqdtopen.proquest.com/doc/1806122688.html?FMT=ABS

PDF viewer:
https://pqdtopen.proquest.com/doc/1806122688.html?FMT=AI

(To download the 148 MB PDF file, point at the page in the pdf viewer and a toolbar will appear at the top with a download icon.)

Excerpt about open sourcing SimCity:
https://tinyurl.com/DonHopkinsSimCity

from opensc2k.

dfloer avatar dfloer commented on April 28, 2024 4

Hi, I'm the Dale Floer mentioned in the readme. I've been slowly working on reverse engineering the simulation, mostly from a "playing the game and seeing what happens" perspective. Right now my notes are pretty unorganized, but I'd love to put them together somewhere nice and public.

SC2k appears to behave significantly differently from Simcity (Classic) in most of the simulation, being an almost complete rewrite.

from opensc2k.

kyr0 avatar kyr0 commented on April 28, 2024 2

Well, here is the "original" source code, SimCity classic, including the Simulation code in simulate.cpp.

https://github.com/SimHacker/micropolis/blob/master/MicropolisCore/src/MicropolisEngine/src/simulate.cpp

from opensc2k.

kyr0 avatar kyr0 commented on April 28, 2024 2

This might also be of some interest:

https://github.com/SimHacker/micropolis/blob/wiki/InsideTheSimulator.md

from opensc2k.

SimHacker avatar SimHacker commented on April 28, 2024 1

The section titled "The Simulation Assemblage" starting on page 310 is probably where you want to start reading, since it has all the diagrams and analysis of how the SimCity algorithm works. But check out the rest of the paper -- there's some amazing stuff in there, including lots of background, theory, interviews and history!

from opensc2k.

nicholas-ochoa avatar nicholas-ochoa commented on April 28, 2024 1

Looks like someone ported Micropolis to JS which should help things quite a bit.

from opensc2k.

dfloer avatar dfloer commented on April 28, 2024 1

@no-identd: I haven't looked too closely at large parts of the simulation, including how industry tax rates effect the simulation, though I do plan on fully reverse engineering the simulation parts of the game. Primarily my focus has been on reverse engineering the various file specs, as there aren't any complete and public specs. One thing I have noticed is that the manual and PPP (Power, Politics & Planning) are not always correct about the internal simulation of the game.

I'll explain on what this looks like:
A power plant has a rating in MW, but this doesn't directly relate to how much power it actually provides, even when the manuals say that it does. It gives a general idea, but the power plants actually power a certain number of tiles, and each tile uses the exact same amount of power (including power plants, which both produce and use power).

Another detail I haven't really seen mention of is that the simulation (for most building, the special buildings don't seem to behave this way) is that the building use the leftmost tile for the simulation. This is why when you rotate the map the land-value, crime, etc. changes and why buildings can even become abandoned because that corner can become >3 tiles away from transportation.

So while the manuals are a good starting place for the game, they don't necessarily reflect the actual state of the released game and it requires a lot of tedious reverse engineering. PPP does a good job at trying to understand how the simulation works, but details are light in many places.

I've pushed my barebones start at a simulation spec to my documentation repo: https://github.com/dfloer/SC2k-docs/blob/master/simulation%20spec.md

priscilla is the cheat you're looking for to get to the debug menu on the game in the Win95 Special Edition version.

from opensc2k.

chaimgingold avatar chaimgingold commented on April 28, 2024 1

@dfloer excited about this project.

Yeah, that's one of the things I found in my close reading of the original SC simulation code, is that there are a lot of shortcuts/bugs—and what's a bug?—where things don't quite work as you would expect. Even Will Wright didn't realize that some of the sim code in the original SC doesn't quite do what it seems to do, like with transit connectivity, when I talked with him about it. So there's an interesting philosophical question here about how to approach things like that. Are you trying to simulate the original simulation, or remake it?

from opensc2k.

dfloer avatar dfloer commented on April 28, 2024 1

@chaimgingold: I can't say what @rage8885's intention is, but when I started the reverse engineering project, I started with the intention to make an Open Source re-implementation of the Win95SE version of the game. I was planning on a "compatability" mode that was as good a recreation as the original as possible (though I hadn't intended on making the UI look exactly the same, it doesn't work well on a high-res/high-dpi screen, for example). Additionally, I want an "extended" mode that fixes some of the more annoying bugs and oversights and adds extra features, such as much larger city maps,

from opensc2k.

cursorial avatar cursorial commented on April 28, 2024

Nice, thanks for those resources, they'll definitely be helpful, could be worth creating some documentation that contains a collection of resources that help with implementation.

from opensc2k.

cursorial avatar cursorial commented on April 28, 2024

from opensc2k.

brylie avatar brylie commented on April 28, 2024

Does SC2K still rely on cellular automata for things like power, etc.?

from opensc2k.

dfloer avatar dfloer commented on April 28, 2024

Power seems to be based off a simple connectivity check. A power plant is a source and each tile sinks a certain amount of power.

It could be that it's using cellular automata, just with a simple rule of if you have any neighbours that are "alive" (powered) you are as well, at least until the number of powered tiles equals the number of tiles a power plant can put it.

One thing I did learn while investigating things is that the MW rating that a power plant has isn't the same as how much power it actually puts out.

from opensc2k.

no-identd avatar no-identd commented on April 28, 2024

Note:

@chaimgingold has Github.

Also, @dfloer I think one thing you'll want to take a look at more closely consists of how industry tax works, see especially pages 38 to 39 of the manual (PDF pages 42 to 43) and page 93 (PDF page 97):

https://classicreload.com/sites/default/files/sim-city-2000-manual.pdf

In my experience, the per-sub-industry tax setting feature is something even the vast majority of game FAQ writers and professional game reviewers covering SC2K overlooked (albeit it's mentioned in the manual!) back in the day.

You might also want to check some of the books @patcoston mentions here, albeit I have no idea how much detail on the simulation behavior it contains, but at least :

http://patcoston.com/co/books.aspx

The oivaizmir cheat for opening the debug window should also help.

from opensc2k.

nicholas-ochoa avatar nicholas-ochoa commented on April 28, 2024

@chaimgingold Long term I'd like to do something along the lines of what @dfloer is proposing. Reimplement the original simulation as closely as possible. But I'd also like to support larger map sizes and other features that don't exist in the original game. It's a few years away from either goal, but that's the intention at least.

from opensc2k.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.