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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Ovidios
Prole
Posts: 27
Joined: Thu Dec 04, 2014 12:00 pm
Location: Berlin, Germay

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

Post by Ovidios » Sat Apr 16, 2016 12:40 pm

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? :(

User avatar
pgimeno
Party member
Posts: 2215
Joined: Sun Oct 18, 2015 2:58 pm

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

Post by pgimeno » Sat Apr 16, 2016 2:25 pm

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 31 guests