# Eli5 how can video games perfectly replicate real life physics

111 views

Like making a ball bounce…etc

In: 0

Easy:

By *not* perfectly replicating real life physics.

Physics is basically just lots and lots of mathematical equations. You plug in information for the inputs, and the equations give you the output.

For a ball bouncing, you’d plug in its starting position, its starting velocity, its mass, and acceleration due to gravity, and we have equations that will tell you how it moves.

Computers are very good at doing math, so all they’re doing is the same thing: taking inputs, performing math, and producing outputs, then telling the computer how to draw that output.

But computers don’t *perfectly* follow along with physics equations. They are simply too complex. They’ll use simplified equations that produce good enough results that look real. The fewer variables you have to consider, and the simpler the math, the faster the computer can produce results.

Well usually they don’t, and sometimes that’s intentional. But physics is just math and it comes down to looking at the formulas from the perspective of the game engine. Gravity is just downward force, and a collision detection to stop you going through the floor. Air resistance/friction; that’s negative force. And in fact, you can exploit that in some games.

A common misconception, however, is when something is labeled as a physics sim when it isn’t. Take water for example; real water simulations are massive particle simulations, even modern game engines can’t handle. How oceans are usually simulated, is with displacement, where they deform the mesh using rules that make it act like an ocean.

What it really comes down to, again, is taking the concept of what you want to do, and translating that to how you would program it. Another example is lighting. In real life, waves emit from the sun and bounce into our eyes, but that means a lot of those rays are unnecessary because you’ll never see them. So games do it in reverse, shooting the ray from the camera and checking if it hits a light source.

They don’t.

The motion of a ball in real life is way more complicated than in any video game because of all the interactions with different surfaces and the atmosphere and so on.

Most video games don’t bother with any of that because you won’t notice the difference if they keep it simple.

Then it’s mostly code. You tell the ball how fast it should fall to the ground and then tell it to bounce back up again when it hits the ground. It’s fairly simple to have the bounce speed relative to whatever speed it hit the ground with.

Tweak it until it fills right and you’re good.

Not only is it too difficult to fully replicate real world physics, it’s almost mostly not desirable. Gamers aren’t playing games expecting perfect recreations of the real world. Unless it’s a simulator, you don’t need to be fully accurate, you just need it to be good enough for whatever game you’re trying to make, and often that means deliberately ignoring things that don’t fit (for example, most shooters deliberately ignore bullet physics because it’s more satisfying if the bullet just hits whatever you were aiming at)

Well usually they don’t, and sometimes that’s intentional. But physics is just math and it comes down to looking at the formulas from the perspective of the game engine. Gravity is just downward force, and a collision detection to stop you going through the floor. Air resistance/friction; that’s negative force. And in fact, you can exploit that in some games.

A common misconception, however, is when something is labeled as a physics sim when it isn’t. Take water for example; real water simulations are massive particle simulations, even modern game engines can’t handle. How oceans are usually simulated, is with displacement, where they deform the mesh using rules that make it act like an ocean.

What it really comes down to, again, is taking the concept of what you want to do, and translating that to how you would program it. Another example is lighting. In real life, waves emit from the sun and bounce into our eyes, but that means a lot of those rays are unnecessary because you’ll never see them. So games do it in reverse, shooting the ray from the camera and checking if it hits a light source.

Easy:

By *not* perfectly replicating real life physics.

Physics is basically just lots and lots of mathematical equations. You plug in information for the inputs, and the equations give you the output.

For a ball bouncing, you’d plug in its starting position, its starting velocity, its mass, and acceleration due to gravity, and we have equations that will tell you how it moves.

Computers are very good at doing math, so all they’re doing is the same thing: taking inputs, performing math, and producing outputs, then telling the computer how to draw that output.

But computers don’t *perfectly* follow along with physics equations. They are simply too complex. They’ll use simplified equations that produce good enough results that look real. The fewer variables you have to consider, and the simpler the math, the faster the computer can produce results.

Well usually they don’t, and sometimes that’s intentional. But physics is just math and it comes down to looking at the formulas from the perspective of the game engine. Gravity is just downward force, and a collision detection to stop you going through the floor. Air resistance/friction; that’s negative force. And in fact, you can exploit that in some games.

A common misconception, however, is when something is labeled as a physics sim when it isn’t. Take water for example; real water simulations are massive particle simulations, even modern game engines can’t handle. How oceans are usually simulated, is with displacement, where they deform the mesh using rules that make it act like an ocean.

What it really comes down to, again, is taking the concept of what you want to do, and translating that to how you would program it. Another example is lighting. In real life, waves emit from the sun and bounce into our eyes, but that means a lot of those rays are unnecessary because you’ll never see them. So games do it in reverse, shooting the ray from the camera and checking if it hits a light source.

They don’t.

The motion of a ball in real life is way more complicated than in any video game because of all the interactions with different surfaces and the atmosphere and so on.

Most video games don’t bother with any of that because you won’t notice the difference if they keep it simple.

Then it’s mostly code. You tell the ball how fast it should fall to the ground and then tell it to bounce back up again when it hits the ground. It’s fairly simple to have the bounce speed relative to whatever speed it hit the ground with.

Tweak it until it fills right and you’re good.

Not only is it too difficult to fully replicate real world physics, it’s almost mostly not desirable. Gamers aren’t playing games expecting perfect recreations of the real world. Unless it’s a simulator, you don’t need to be fully accurate, you just need it to be good enough for whatever game you’re trying to make, and often that means deliberately ignoring things that don’t fit (for example, most shooters deliberately ignore bullet physics because it’s more satisfying if the bullet just hits whatever you were aiming at)

Easy:

By *not* perfectly replicating real life physics.

Physics is basically just lots and lots of mathematical equations. You plug in information for the inputs, and the equations give you the output.

For a ball bouncing, you’d plug in its starting position, its starting velocity, its mass, and acceleration due to gravity, and we have equations that will tell you how it moves.

Computers are very good at doing math, so all they’re doing is the same thing: taking inputs, performing math, and producing outputs, then telling the computer how to draw that output.

But computers don’t *perfectly* follow along with physics equations. They are simply too complex. They’ll use simplified equations that produce good enough results that look real. The fewer variables you have to consider, and the simpler the math, the faster the computer can produce results.

They don’t.

The motion of a ball in real life is way more complicated than in any video game because of all the interactions with different surfaces and the atmosphere and so on.

Most video games don’t bother with any of that because you won’t notice the difference if they keep it simple.

Then it’s mostly code. You tell the ball how fast it should fall to the ground and then tell it to bounce back up again when it hits the ground. It’s fairly simple to have the bounce speed relative to whatever speed it hit the ground with.

Tweak it until it fills right and you’re good.

Not only is it too difficult to fully replicate real world physics, it’s almost mostly not desirable. Gamers aren’t playing games expecting perfect recreations of the real world. Unless it’s a simulator, you don’t need to be fully accurate, you just need it to be good enough for whatever game you’re trying to make, and often that means deliberately ignoring things that don’t fit (for example, most shooters deliberately ignore bullet physics because it’s more satisfying if the bullet just hits whatever you were aiming at)