Closed car1ot closed 11 months ago
Indeed, I experience the same effect.
Indeed, I experience the same effect.
And what to do? I need the same results on server and client...
There's a PR all about timing inconsistencies. Regardless, you should fix your timestep to achieve determinism.
There's a PR all about timing inconsistencies. Regardless, you should fix your timestep to achieve determinism.
777
help pls, I quoted reply in #777
Pretty much as @wmike1987 says (thanks!)
I experience the same problem (wich sound to me logical unless you use fixed time step you IMHO cannot get same results specially with float computation), I fixed it by using fixed time (and integer) step (see below), this solution may be added as an option of the Engine.update ?
timeStep = 5;
...
...
lastFrameTime = frameTime;
frameTime = Date.now();
let frameDuration = frameTime - lastFrameTime;`
let repeat= Math.floor(frameDuration/timeStep);
let remainingTime = frameDuration%timeStep;
frameTime -= remainingTime;
for(var n=0;n<repeat;n++)
{
Matter.Engine.update(engine, timeStep);
}
@DzzD good to know that approach is working for you, it's worth trying out branch #777 too if you get chance.
I've got similar prototypes of adaptive fixed timestep for Matter.Runner
but none are yet production ready, it is something I'll prioritise though when I get back to #777.
Closing this thread to refer to updates in #702 on this topic, thanks again for the reports here.
Hello. I have simulation (game plinko) - balls falling down from exact coordinates into baskets. Repeating the same simulation over and over, results are different!
Also, when I slow down time the simulation results become very different.
I made this issue, beause I need same results in multiple simulations using same exact fall coordinates.