Friday, May 8, 2009

How we trashed buildings in SimCity 4

At it's heart, SimCity 4 was a giant, realtime compositing engine. The city was displayed isometrically, so we could render stuff to the screen, and not update it until something changed.
Since we didn't have to redraw everything 30 times per second, I could overlay many layers to build up the visual richness that I was after.

Here's one example that I mocked up while trying to figure out how we were going to represent building decay (an important game feedback that needed to read clearly).

Let's say that you start out with this brand new, squeaky clean building:


Each building could have it's own custom, automatically generated "crud" map (a combination of ambient occlusion and 3D noise rendered through the source geometry).
Just multiply it over the base building to make it dirty.


Each building could also have automatically generated window masks (normally used to make the windows glow at night). Just multiply those over the building and the windows start looking dark and dingy.


We could break the window masks into sections and apply them independently for a further stage of decay (we didn't wind up doing that, having to save memory as I recall)


As things go from bad to worse, we could mask a tiling boarded-up-window texture through one of the window channels.


Since the game was in an isometric perspective, we could pre-render "crater" decals and lay them over the building, making it look like parts of the facade had fallen off.



And lastly, for that 12 Monkey's, abandoned Philadelphia look, we could overlay an automatically generated snow mask.


In the end we didn't wind up doing all of these things, running short of memory and disk space for all of the masks I wanted (times 4 rotations and 5 zooms!) But this was what I was after, and (thanks to Paul Pedriana's graphics engine) we got pretty close.

O.

3 comments:

  1. I'd love to see this kind of thing used in more games today. I remember SimCity 4 didn't perform so well when I first played it in 2003 (on 1999 hardware, of course), but optimizing this technique for modern hardware would probably make a lot of stunning looking games that could actually achieve a frame rate.

    By the way, wasn't SimCity 4 trimetric, not isometric?

    ReplyDelete
  2. I completely agree, you could do something just amazing with modern hardware using an approach like this.

    Hah! I remember Paul Pedriana giving me a lecture on exactly what projection it was. And you're correct, it was a axonometric, trimetric projection. The artists all referred to it as isometric, which annoyed him.

    O.

    ReplyDelete
  3. Is there any chance you guys are going to release a mini "expansion pack" for Simcity 4, such as TS2's "Stuff Packs, with all the remade Simcity 3000 buildings in one pack?

    I remembered that when SC4 was in the beta stage and I saw the E3 video preview....it showed the classic SC3K buildings such as Pinky's Plaza, Federal Tower, Walton's Dream, etc

    We hardcore Simcity 4 fans (especially the Simtropolis' ones) would be so grateful if you guys were to release those!

    ReplyDelete