Every ragdoll toy, stunt racer and physics puzzle on the web runs on the same basic ideas. A physics engine stores objects with position, velocity and mass, nudges them forward a tiny step in time, checks what has collided and fixes any overlaps. Do that sixty times a second and you get believable motion. Do it badly and a ragdoll's arm gets launched into orbit. Here are the basics in plain language.

The time step
A game cannot simulate continuous time, so it slices time into steps, often 1/60th of a second. At each step the engine works out the forces on each object, such as gravity, springs and explosions, updates its velocity and then updates its position. The simplest method, called Euler integration, does exactly that. It is easy, but errors pile up. Many games use a refinement called semi-implicit Euler, and cloth and ragdoll systems often use Verlet integration, which stores the previous position instead of velocity and is very stable for chains of connected points.
Good engines also use a fixed time step. If the step size changed with the frame rate, the same throw would land in a different place on a fast computer than on a slow one.
Rigid bodies and joints
Most game objects are rigid bodies: shapes that do not bend. A crate, a wheel and each limb of a ragdoll are all rigid bodies. Joints connect them. A hinge joint lets a knee rotate on one axis; a ball joint lets a shoulder rotate in several. Each joint is a constraint, a rule that says "these two points must stay together", and the engine solves all of them together at each step. With many joints and fast impacts, the solver may not fully satisfy every rule in one step, which is why limbs sometimes stretch or jitter.
Collision detection and response
Finding collisions has two phases. A cheap "broad phase" uses simple boxes to rule out pairs of objects that are nowhere near each other. A precise "narrow phase" then checks the remaining pairs and, if they overlap, works out the contact point and direction. The response pushes the objects apart and changes their velocities according to mass, bounciness and friction.
The classic bug is tunnelling: a fast, thin object moves so far in one step that it passes straight through a wall without ever overlapping it. Engines prevent this with continuous collision detection for fast objects, at a cost in speed.
Why ragdolls explode
Put the pieces together and the famous glitches make sense. A ragdoll limb gets wedged inside a wall; the collision response pushes it out with a huge force; the joint solver yanks the rest of the body after it; and the whole figure is flung across the map. Developers fight this by capping velocities, limiting how hard overlaps are corrected and putting bodies to "sleep" when they stop moving. Games such as Happy Room keep a little of the chaos on purpose, because it is funny; our ragdoll explainer covers how the genre grew around it.
| Engine | Notes |
|---|---|
| Box2D | Erin Catto's open-source 2D engine (2007); ported to Flash and used in many web and mobile games |
| Havok | Commercial 3D middleware used in many big console and PC games |
| PhysX | NVIDIA's engine, built into Unity and Unreal for years |
| Matter.js, Planck.js and others | Lightweight 2D engines for HTML5 browser games |
Chaos, roulette wheels and beating the dice
Physics engines show something important about chance. A simulation with no random numbers at all can still produce results that look random, because tiny differences in the starting point grow very quickly. Drop a ragdoll from one pixel further left and it may land in a completely different place. Scientists call this sensitive dependence on initial conditions, or chaos.
Casino games are built on the same physics. A roulette wheel is a deterministic machine: a ball, a spinning rotor, friction and gravity. In principle, if you knew the speeds precisely, you could predict roughly where the ball would land. In 1961 the mathematician Edward Thorp and the information theorist Claude Shannon built what is often called the first wearable computer to try exactly that, timing the ball and rotor with switches hidden in a shoe. A group of California students known as the Eudaemons tried similar devices in Las Vegas in the late 1970s. Nevada made such devices illegal in 1985, dealers close betting while the ball is still spinning, and modern wheels are built and checked to keep outcomes unpredictable.
Dice, card shuffles and Plinko boards rely on the same principle. Electronic games skip the physics entirely and use a random number generator instead. Our article on the physics and RNG behind slots and Plinko explains the difference, and why an online Plinko ball's bounces are usually decided before it falls.

Try it yourself
The best way to understand game physics is to break it. Load a sandbox, stack objects until they wobble, fire something very fast at something very thin and see what happens. You will start to recognise the time step, the solver and the collision system in every game you play.


















