You probably should, just in case you decide to increase the fixedupdate because computers can't cope later down the project, so you don't have to re-tweak all your values.
How long you could play depended on how fast your computer was. The slower the computer (the bigger the delta time) the more you could play before it rounded down to nothing.
Morrowind had that bug where after around 80 hours of play, fast computers had too small of a deltatime and animations stopped working due to rounding down updates to nothing.
yeah, that's the numerically stable way to go about it.
That way even if the computer somehow runs at 10000 fps your physics won't break when trying to add too-small of a fraction that gets rounded down to zero.
You can also do physics(4) physics(4) so for a total of 12ms (went over but it's okay), and next time if you get another 10ms (total of 20ms) you then go physics(4) physics(4)
If you have 10ms you call physics(4) physics(4) so for a total of 8ms, and next time if you get another 10ms (total of 20ms) you go physics(4) physics(4) physics(4).
I cannot recommend a specific frame rate as this depends on physics complexity and your minimum system requirements, Javascript engine performance, etc. You'll have to try it out for yourself as you develop your game. But I will recommend using a delta time variable parameter to the physics update function so you can change the fixed time-step. So long as it's consistent between computers you'll avoid a lot of [bug that only happen on fast or slow systems] situations.
@DMGregory I was just adding that :) In general for numerical stability I prefer to calculate physics at a fixed rate. @Ryan Say you decide to run your simulation at 100Hz (10ms) and you have a 1.003 second delta, you end up running your update physics loop 100 times. In pseudo-code: new_time = now(); while(sim_time < new_time) { Update(10ms); sim_time += 10ms; }
Like, if I made a 2D game with at least 8bit of pixel fractions (like old 8bit/16bit games used in their physics) I could walk 65536 pixels either directions before I don't have those 1/256th of a pixel anymore.
Because usually the [ smallest unit value of concern ] scale is what matters the most in practical terms. Even though in practice it gets a lot worse due to other rounding.