55 votes
Accepted

How can I perform a deterministic physics simulation?

On handling floating point numbers in a deterministic way Floating point is deterministic. Well, it should be. It is complicated. There is plenty of literature on floating point numbers: What Every ...
user avatar
  • 18.5k
36 votes

In games physics engines, what is "tunneling", also known as the "bullet through paper problem"?

What is tunneling and why it happens In video games, physic objects will have an specific position which is updated by the physics engine each frame based on its velocity and any forces applied to it. ...
user avatar
  • 18.5k
34 votes
Accepted

Why integrate over accumulation?

...the inner workings of that function are generated via the appropriate mathematical formula... This will work for certain classes of problems, and the key phrase to search for is a closed-form ...
user avatar
  • 1,301
17 votes

Moving player inside of moving spaceship?

The ship stays in place and everything moves. Mostly. In this answer I present three ideas of how to go about it, and I'm referencing the games I'm basing them on. I could not find out what approach ...
user avatar
  • 18.5k
10 votes
Accepted

Why not derive velocity from position updates in games?

In the vast majority of situations, calling getVelocity is a vastly preferable approach. You don't have to be polling objects on the off chance that next frame you are going to need a velocity (which ...
user avatar
  • 1,197
9 votes

Why integrate over accumulation?

The problem with your approach is, that you don't have a history of your object. You can calculate the position if you move in a direction, but what happens if you hit something and bounce back? If ...
user avatar
  • 536
9 votes

How can I perform a deterministic physics simulation?

I work for a company which makes a certain well known real-time strategy game, and I can tell you that floating point determinism is possible. Using different compilers, or the same compiler with ...
user avatar
  • 191
8 votes

Why integrate over accumulation?

However, I don't understand why it's accumulated like this when it could just as easily be gotten by changing a function. For example: getPosition = makeNewFunction() which could return something that ...
user avatar
  • 803
8 votes

Why integrate over accumulation?

In the case of just a simple bouncing ball, coming up with closed form solutions is easy. However, the more complex systems tend to require solving an Ordinary Differential Equation (ODE). Numerical ...
user avatar
  • 1,197
7 votes

How do force fields scale?

This is what I do in my N-Body simulation: particles far away can be aggregated in combined cells on a grid. (Multi-resolution Grid.) I use gravity calculations, but I am sure that charged attraction/...
user avatar
  • 3,679
6 votes

What exactly is a physics engine?

The input it speed, mass, and time, the output is new speeds. Sometimes rotation/angular momentum is an input and output too. Essentially Physics engines try to simulate the effects of both gravity ...
user avatar
  • 9,927
6 votes

Sound Synthesis from object collision in Virtual Reality Environment

When you say 'synthesis' do you mean pure analog/additive/FM synthesis from scratch, or would a sample-based approach be acceptable? If you can't use combinations of real-world audio samples then this ...
user avatar
6 votes
Accepted

physics engine without time steps

The problem is this only works if movement is linear and there is no possibility of other moving objects hitting one another. As soon as you have multiple forces changing the direction in non-linear ...
user avatar
5 votes

How do I fix objects "popping" or jittering in physics engine?

Your problem lies in the fact that you have no "resting" state for your bodies. Any physics system has an amount of energy, be that kinetic, thermal, and so on. In reality, solid object deform ...
user avatar
  • 2,555
5 votes
Accepted

How to handle player input with fixed rate variable fps time step?

I most often encounter this in the context of Unity, which has the following attributes: Input is checked once per displayed frame, before any of that frame's fixed/variable timestep updates Input ...
user avatar
  • 114k
5 votes

How can I perform a deterministic physics simulation?

I'm not sure if this is the type of answer you're looking for, but an alternative might be to run the calculations on a central server. Have the clients send the configuration to your server, let it ...
user avatar
4 votes
Accepted

Rigidbody physics concept: Why translate collision shape on-the-fly instead of mutating it?

One major advantage is that many collision detection operations are more efficient when performed at the origin. A classic example is box vs sphere. When done in a box's local space the tests are very ...
user avatar
  • 3,022
4 votes

What exactly is a physics engine?

Typically a physics engine is used to make object in a game behave in a realistic manner relative to their environment without having to design specific animations for every possible scenario. ...
user avatar
4 votes

What exactly is a physics engine?

A physics engine is responsible for simulating the motion of objects in "the world" (whatever that means in the context of the engine). Most physics engines nowadays use Newtonian mechanics to do this,...
user avatar
4 votes
Accepted

What is inertia in a physics engine?

I believe what we're looking at here more specifically refers to rotational inertia and inverse rotational inertia; not to linear inertia (nor inverse linear inertia). Wikipedia explains that ...
user avatar
4 votes

Should a bowling game use a 2d or a 3d physics engine?

When developing games it is important to separate the game mechanics from the game representation on the screen. The game mechanics of bowling can be simplified to a pure 2d simulation by looking at ...
user avatar
  • 112k
4 votes

Looking for collision detection algorithms for broad and narrow phases between non-convex polyhedrons

There are almost no algorithms to detect collision with a concave object, because there's no reason to have one. Every concave object can be approximated with convex object. See the following image ...
user avatar
  • 14.5k
4 votes
Accepted

Difference between _process(delta) and _physics_process(delta)?

Graphics or Physics One difference is that _process is tied to graphics (it runs once per frame), while _physics_process isn't. ...
user avatar
  • 18.5k
3 votes

Data oriented design in physics engine

What you should optimize for is probably best shown in and around slide 40 of this presentation: http://www.slideshare.net/cellperformance/gdc15-code-clinic The idea is to prevent the code from doing ...
user avatar
  • 3,578
3 votes
Accepted

multiple contacts for SAT collision detection

When performing OBB-OBB intersection using SAT, the suggested approach for generating multiple contacts is to find the coincident features and perform clipping - either edge against edge, or face ...
user avatar
  • 3,022
3 votes
Accepted

How do I calculate rotational impulses in rigid body collisions?

You're in luck. I did a full translation of Randy Gaul's 2D physics engine into C# and XNA. He hasn't really explained things well for beginners like me. For your answer, you should just multiply ...
user avatar
  • 872
3 votes

How do I calculate rotational impulses in rigid body collisions?

Whatever collision be, angular momentum is conserved. ie Iw = constant with the coefficient of restitution (in translation, i dont know if its said the same in rotation) u define, and with the moment ...
user avatar
3 votes

Understanding constant acceleration in terms of game physics simulation

In your context, I think constant acceleration refers to acceleration's like Earth's gravity. This is lengthy because you are not specific about how you are using the model. Are you trying to simulate ...
user avatar
  • 3,624
3 votes

Do I need to learn any physics if I use a physics engine?

Bare minimum you need to know how the physics SYSTEM works within the engine. Most of these may sound daunting but it's really not that difficult and you CAN simply stumble through things but it will ...
user avatar
  • 574

Only top scored, non community-wiki answers of a minimum length are eligible