What is a physics engine?
Physics engines make crates topple and balls bounce without you writing the math. Here is what they simulate, when they help, and when hand-written movement is better.

Key takeaways
- A physics engine moves bodies by forces (gravity, impulses, friction) and resolves their collisions every step.
- It shines for stacking, rolling, ragdolls and chain reactions; tight platformer controls are often better hand-written.
- Run it on a fixed timestep and sleep resting bodies to keep it stable and cheap.
With a physics engine, you describe objects by their shape, mass, bounciness and friction, and a library simulates how they fall, collide, slide and stack, step after step, so you do not have to write the math for every interaction yourself.
It is like building a marble run instead of animating one. You place the ramps and drop the marble; gravity and the ramps decide where it goes. A physics engine is the gravity and the ramps for a game.
What it simulates
- Rigid bodies: objects that move and rotate but do not bend. Dynamic bodies are pushed around; static bodies (floors, walls) never move; kinematic bodies (moving platforms) move by your code and push others.
- Colliders: the simplified shapes used for contact, boxes, spheres, capsules, convex shapes. They decide what touches what.
- Forces and impulses: gravity every step, a kick from an explosion, a jump impulse.
- Materials: restitution (bounciness from 0 to 1) and friction. A rubber ball might start at 0.8 restitution, a crate near 0.1.
- Joints: hinges, springs and chains that link bodies, for doors, bridges, ragdolls and wrecking balls.
Each step, the engine applies forces, moves bodies, runs collision detection and pushes overlapping bodies apart with believable bounces. Startbase 3D games come with Rapier, an open-source physics engine, ready to switch on (games template docs).
When a game needs one, and when it does not
Use physics when emergent behavior is the fun: a physics puzzle game where towers collapse, a pinball table, marble races, vehicles, crates to push in a 3D level. Skip it, or use it only for props, when you need exact, predictable control. Platformer heroes built on pure physics feel floaty and slide off ledges, which is why many platformers move the player with hand-written velocity and collision, and let physics handle the debris.
Settings that tame a physics engine
- 01Fixed timestep. Step the world at a constant rate, 60 Hz is the usual start, independent of frame rate. Variable steps make stacks jitter and explode.
- 02Sensible scale. Engines assume meters and kilograms. A 300-unit-tall character treated as 300 meters falls in slow motion. Keep objects roughly real-world sized.
- 03Sleeping. Bodies that stop moving are put to sleep and skipped. A level with 200 settled crates should cost almost nothing.
- 04Continuous collision for fast things. Enable it on bullets and fast balls so they do not tunnel through thin walls.
Physics when building with Startbase
Describe the feel in physical words and the agent can map them onto settings: heavy, bouncy, slippery, floaty. Expose the key numbers (gravity, restitution, friction, jump impulse) as dials in the Engine panel, so you can tune them live while playing instead of guessing in chat.
Turn on physics for the crates and barrels only; keep the player on hand-written movement. Crates: restitution 0.1, friction 0.8, sleep when resting. Barrels roll. Step physics at a fixed 60 Hz, enable continuous collision on cannonballs, and add Engine panel dials for gravity and crate friction.
Common confusions
- Physics engine vs game engine. A game engine handles drawing, input, sound and scenes; a physics engine is one component inside or beside it.
- Realistic vs fun. Real gravity often feels slow in games. Many platformers use 2 to 3 times stronger gravity when falling than when rising.
- Determinism. Most engines do not produce bit-identical results across devices, which matters for multiplayer replays.
Frequently asked questions
Do 2D games need a physics engine?
Many do not. Arcade, puzzle and platformer games often use simple box and circle checks. Use an engine for stacking, rotation, ropes and realistic bounces.
Why do my physics objects jitter or explode?
Common causes are a variable timestep, objects at an unrealistic scale, or bodies spawned overlapping. Fix the step to 60 Hz, size objects in meters and spawn them apart.
What physics engine do Startbase 3D games use?
3D games run on Three.js with Rapier physics ready to switch on when the game needs it.

