4 ms·
Why couldn't you just run physics at the graphics frame rate (or double it if the graphics becomes too slow)? I don't think many games need fully deterministic
by IshKebab 4y ago
Why couldn't you just run physics at the graphics frame rate (or double it if the graphics becomes too slow)? I don't think many games need fully deterministic physics do they?
Like
x += v * dt
draw(x)
Or is that what this does?
- spacehunt 4y agoCollision detection is a major reason. If you only sample positions at the frame rate, you're going to have bullets go through walls without hitting anything. Also, physics is costly to run, so usually it's not run on every frame.
- wongarsu 4y agoAnd you really want your collision detection to be reasonably deterministic. Reasonable frame rates range from 30fps to 240fps, which is nearly an order of magnitude, and you want your bullets to behave the same over that range.
- IshKebab 4y agoYou only need physics to run at a "fast enough" rate. Let me rephrase: Why not just snap physics frames to graphics frames?
- spacehunt 4y agoFrame rate is variable.