Nape physics, with a fixed time step?

79 views
Skip to first unread message

nathan....@redspace.com

unread,
Feb 18, 2015, 9:04:28 AM2/18/15
to fla...@googlegroups.com
I've noticed that sometimes when my game lags a little on a lower performing device, the physics will seem to try to catch up with the lag and seem to add extra velocity or force to my objects. I think it's due to the fact that in flambe we send the variable delta time into the space.step method. If there is a longer time then usual between update ticks then nape will be passed a higher delta time, causing the calculations to be higher for a time then usual.

Does anyone know if there is a way to send it maybe a fixed time step or is there a way to mimic something like Unity's FixedUpdate loop, which is used for physics objects for the same reason as above.

Thoughts?

Emilio Shodi

unread,
Feb 23, 2015, 2:59:13 AM2/23/15
to fla...@googlegroups.com, nathan....@redspace.com
Where is the problem exactly? Just use space.step(1/60).
Also, Luca Deltodesco, the creator of nape, said that nape should work only with fixed timestep.


среда, 18 февраля 2015 г., 17:04:28 UTC+3 пользователь nathan....@redspace.com написал:

nathan....@redspace.com

unread,
Feb 23, 2015, 8:16:55 AM2/23/15
to fla...@googlegroups.com, nathan....@redspace.com
Yeah I think I should have worded my question differently. I know I can just pass in my own fixed time step, but I will still have to do it inside the update loop, which will still have lag between ticks. I was hoping there might be a fixed update loop already present in flambe, something like what you see in Unity with the FixedUpdate loop.


Reply all
Reply to author
Forward
0 new messages