Shaking it up: Simcity’s Physics

Via Simcity Blog

Hey everyone! I’m Robert Perry and I’m the engineer in charge of physics for SimCity. The two things I enjoy most are building things and solving problems. SimCity is a fun way for me to do both.

When we use the phrase, “what you see is what we sim,” we really mean it. With that said, why should physics get left out? Physics provides another tool to simulate what happens in a city. We’ve coupled physics with the GlassBox engine to create an even deeper simulation. Every building in SimCity is simulated in the physics engine. Buildings are attached to the ground with a physics model that simulates the forces that act on that building. When a module is stacked on a building, the building reacts. If multiple modules are stacked on a building, they all react. If an object strikes a building, the building reacts – modules included.

Disasters are where the physics system is put to best use. Disasters are able to affect the game physics in a variety of ways. A small meteorite will set a building rocking; a large one will reduce it to a pile of rubble on the blackened, scorched ground. Physics is a great simulation tool and it adds depth and nuance to the game, but there are some things we don’t solve using physics. One example is vehicles. The transport team has done a great job of with the vehicles and there’s not a lot the physics would add there. Vehicles turn, merge, and navigate with detailed behavior. At the scale the vehicles operate at the physics system wouldn’t dd enough benefit to justify the cost in performance.

When we’ve hit instances where physics alone isn’t the best solution, we’ve been able to team up with the artists to create integrated solutions. Simulating a tornado is far beyond the scope of SimCity. We use a hybrid approach with the tornado that allows an artist to create a particle system to drive physics bodies. The tornado sucks up buildings and vehicles, drives them up and through its funnel with an animated particle system, and seamlessly releases them to the physics system. The final result is that tornados will chew through your city and fling buildings and vehicles like a giant blender that has been released in your city.

We announced four disasters last week on our Facebook page. Besides the meteor shower and tornado I’ve already talked about, we also revealed the earthquake and UFO disasters. Earthquakes, in particular, make for good use of physics, as triggering this particular disaster will shake buildings to the ground (as one would expect). And UFOs, besides abducting Sims and stealing resources, will slice buildings in two with a laser. Typical alien behavior. Keep checking back, we’ll be revealing more disasters later on.

What I talked about today is just a small taste of what to expect in the new SimCity. As you know, disasters have always been a big part of SimCity and they’re better than ever. Make no mistake, buildings will crumble, debris will fly, and stuff will explode. This SimCity is a simulation with great depth and detail. Physics allows us to layer on more detail and ultimately bring more fun to SimCity. I’m looking forward to hearing what everyone thinks of the disasters.