A Physics-Based Game Creation System
by Alec Rivers

Overview: Physics Engine

Before you try to understand anything else about Physical, you should understand its physics engine.

In a traditional physics engine, an object such as a box is treated as one discrete entity simulated using Newtonian mechanics. The laws of torque and inertia are hard-coded into the engine, and the object's movement is determined using formulas derived from them. This approach is known as rigid body physics, and it works well for many situations. You may have seen rigid body physics engines in some of the newer commercial games like Hitman 2 or in demos of Half Life 2. (If you haven't, I highly recommend a freeware game with the amusingly-translated title "Stair Dismount.") Simpler examples of this kind of engine have been in use for years in special cases like the cars in racing games.

A screenshot from a demo of a rigid body physics engine (not written by me)

However, rigid body physics engines severely limit the number of ways objects can be interacted with. For the most part, objects can only be moved around. They cannot be broken in two, crushed, stretched, or split. In a field such as computer gaming, where destruction and breakage form the majority of interactions with the game world, this is a serious shortcoming. Furthermore, rigid body physics engines are unable to simulate environments with complex or high numbers of interactions: water flowing over a mill wheel, for example, or flame eating at a building. Physical can handle all of these situations, and more.

Physical's physics engine is based upon the work of Italian computer scientist Giovanni Tummarello. Tummarello's approach is an extension of what is known as a mass-spring system. In a mass-spring system, physical objects like a box are not whole entities in and of themselves, but are formed out of many smaller particles, referred to in the engine as atoms. (The word ‘atom’ is used to mean a small, indivisible unit of matter; atoms in the physics engine do not necessarily behave like atoms in the real world.) In an object, these atoms are connected to each other, usually in a lattice structure, by ‘links’. These links are essentially springs, and their behavior is governed by Hooke’s law (the force applied by a spring is equal to the spring's elongation times some spring constant). While each atom reacts only to very simple forces – such as link forces and bouncing off of walls – in systems with many linked atoms, higher level laws such as those described in Newtonian physics emerge. For example, while there is no specific equation in the engine that governs rotation, and while atoms themselves don't even have an orientation, a box made up of many linked atoms will rotate realistically when hit.

A mass-spring system in action

Tummarello extended this paradigm in two ways. First, he included an atom-based repulsion system that made every atom repel every other atom, simulating collisions.

A mass-spring system with atom repulsion

Secondly, he added the ability for links to break when extended beyond a breaking point. This was a critical step, because it meant that mass-spring systems could now do everything that was lacking from rigid body physics: objects could deform and break.

A mass-spring system with link breakage

All this talk of physics may be a bit much to take in all at once. The bottom line is this: at the core of Physical is a physics engine that can simulate just about anything you can throw at it. It can handle objects that bounce, roll, stretch, break, get sliced, get crushed, and everything in between, even simulating fluids with ease. It does have weaknesses - ironically, it is not very good at large, rigid objects, which were the easiest thing to simulate with rigid body physics - but its capability for destruction offers a wealth of new possibilities in terms of gameplay.