Page 1 of 1

Is there randomness in the physics-module's simulation?

Posted: Sat Apr 16, 2016 12:40 pm
by Ovidios
Currently making my Ludumdare-game using love.physics, I had it happen to me that on two equal scenarios there would be different outcomes. Why? How do I fix it? :(

Re: Is there randomness in the physics-module's simulation?

Posted: Sat Apr 16, 2016 2:25 pm
by pgimeno
Maybe because of different dt's?

If so, an obvious fix would be to call world:update with a constant.

Edit: I've tried setting a fixed seed with this: https://www.love2d.org/forums/viewtopic ... 43#p191579 and while the initial positions and velocities were all the same, very quickly the results diverged between runs. Changing world:update(dt) to world:update(1/60) made everything behave the same way even after about 1 minute.