Video game physics are something that we often take for granted.

Although, if you have played Skyrim long enough, you know that this can happen anyway.

Rigid body physics is generally defined as forces that act on a solid object.

Article image

It is required for most 2D and 3D games.

Soft body physics is applying physical forces to a deformable mass — like a flag.

Soft body is much more complex to simulate.

However, that is not to say games have to abide strictly to the natural laws of physics.

In fact, most developers bend the rules for the sake of fun.

The game has to be enjoyable to play after all.

If the physical forces are too lifelike, it can ruin the fun factor.

So there is a fine line between making a game enjoyable to play and it being physically realistic.

Racers are a good example.

A smaller demographic prefer sim-racing games that are a closer approximation to reality, such as Gran Turismo.

Gran Turismo initially relied onphotorealismto attract other players, which worked to an extent.

Still, Polyphony Digital eventually added an arcade mode to the series to cater to a broader market.

Rigid body physics deals with simulating and animating physical laws on solid masses.

Gee, when you put it that way, it doesn’t sound fun at all.

The granddaddy of video games did not realistically model real-world physics.

For one, its programmers ignored calculations involving gravity, friction, and inertia.

It was just a ball going back and forth at a constant speed.

Second, the angle of the ball rebounding from the paddles was not calculated accurately.

The ball’s bounce completely ignored the law of reflection.

So players could completely reverse the ball’s momentum, regardless of its incoming vector.

Angular trajectory would come into play more with later iterations and other paddle games like Breakout.

However, even then, the numbers were usually fudged.

It all comes back to the fun factor.

Mimicking deflection too closely to reality was less fun and often more difficult to play.

Artillery games were the first to start incorporating factors like gravity and resistance into the mechanics.

Again, designers did not make the games too true-to-life.

Their target audience was the average joe, not ballistics experts.

Arrows or missiles are a good example of animating a rigid body in these games.

While the plane of the projectile would change during flight, the arrow itself would remain straight.

It did not bend as it completed its arc, which is what we would expect.

Any two points on an object in a rigid body system will always remain the same distance apart.

Jumping was the primary game mechanic, and it has since become a staple that will never go away.

When dealing with jumping and gravity, we intuitively know that what goes up, must come down.

The question is, how high does it go up, and how fast does it come down?

If Mario was forced to obey real-world laws, he would probably never make it past level one.

Later games would stretch the bounds further by introducing the double jump.

The double jump allowed players to leap higher vertical or horizontal distances to clear gaps or reach ledges.

The game mechanic became popular in platformers almost to the point of overuse.

The physics used in 3D games is not that much different than what developers used in their 2D cousins.

As mentioned before, even the double jump exists in some 3D games.

For example, Mario landing on top of a Koopa.

Any part of Mario can touch any part of the Koopa.

How that contact occurs determines whether the Koopa gets bopped or Mario loses a life.

Either way, it is only one collision.

Most 3D titles have multiple solid objects interacting with each other.

Take the Uncharted series as an example.

This structure and how it behaves is referred to as “ragdoll physics.”

Ragdoll physics is used in most, if not all, games with player or NPC models.

Each rigid body must act under a set of rules to look realistic when moving.

To compute these movements, programmers use a variety of techniques.

Just as in 2D titles, game makers have to find a balance between realism and fun.

Take the Sniper Elite series as an example.

That is not to say that games have not attempted to make sniping more complicated.

Call of Duty: Modern Warfare has a campaign level that involves taking out a target from long range.

The player must contend with the Coriolis effect and wind speed/direction (above).

The mission is frustratingly tricky, enough so that I eventually put it down and played something else.

That is not to say that some players do not like that challenge.

Some called it the best mission in the game.

I just don’t have the patience for it.

Assetto Corsa Competizione (version 1.0.7), for example,introduceda five-point tire model into the game.

Most other racers just have a single point of contact on each tire.

Each of the regions acts as a connected rigid body.

They can move and flex in three dimensions, independently reacting to forces and surface contact.

However, the extra contact points up the calculations done by the physics engine considerably.

Many more variables and collisions must be tracked to keep the physics on an even keel.

However, most calculations are still linear and, therefore, more straightforward than soft body physics models.

Some soft body physics examples would be cloth, hair, and collections of particles like smoke or mist.

For instance, let’s look at a flag.

However, as the flag moves, the distance between any two points can vary.

The number of configurations of all the points on the flag, while finite, is still staggering.

So, developers often rely on shortcuts to mimic the random movement of a flag blowing in the wind.

Batman’s cape in the Arkham games is a perfect example.

Designers cannot use looping animations for Batman’s cape because its morphing relies on how the player moves.

It cannot just flap around randomly like a flag because it will not look right.

To handle these complex variables, game makers employ physics engines to handle the work for them.

In Batman: Arkham Knight, developer Rocksteady used APEX Cloth PhysX.

This tool allows designers to create a mask for cloth bodies and set parameters for how it should move.

Depending on how it is configured, anything from silk to burlap can be simulated.

For instance, “Wind Method” can be set to “Accurate” or “Legacy.”

Legacy ignores drag and lift, thus reducing the calculations that need to be done.

Additionally, not all points on a piece of cloth are factors.

Unlike fabric or hair, particles such as smoke or clouds are far more complicated to simulate.

Any two points within a particulate object can move in a nonlinear fashion.

However, physics engines have improved particle systems to a great degree over the years.

Just watch the title screen of Skyrim to see how realistic illusions of smoke have become (below).

Generally speaking, each particle in a soft body system has a static lifespan.

During that time, the point will move according to set parameters.

Take smoke from a campfire, as an example.

They do this until they are removed from the simulation, based on their lifespan.

The lifespan roughly determines how realistic the particle system looks.

A long lifespan tends to create very realistic campfire smoke but is taxing on the processors.

As you watch you’re free to see the particles evaporate before they are respawned again.

Switching to actual gameplay, you will notice that smoke around fires is not as realistic looking.

Interlacing a number of static smoke layers is a common method.

In short, soft body physics in all games is limited.

For one, it is not necessary to fully simulate SBP since it is usually just there for aesthetics.

Full SBP simulations are best left in the physics labs.

The bottom line is to make it fun.

Realism takes a backseat to engaging gameplay.

This is not to say that game physics is optional.

Check out the physics section in theUnity manualor theLumberyard tutorials.

We may also cover the topic in more depth in a future article.

Give it a go and let us know.