Implementing Time Acceleration in Box2D Physics Without Disrupting Physical Events

I’m developing a physics-based game using Defold with Box2D physics, targeting both mobile and web platforms. I’ve noticed that some games implement a “time acceleration” feature, where in-game events are sped up (e.g., 3x or 5x faster) to allow players to experience more action within a shorter real-time period.

What I Want to Achieve: I’d like to implement a similar time acceleration feature in my game. My goal is to accelerate the in-game time so that all events (movements, collisions, animations, etc.) occur at a faster rate without disrupting the integrity of the physics simulation.

  • Ensuring that speeding up time doesn’t cause physics anomalies, such as objects passing through each other or unstable simulations.
  • Maintaining consistent and realistic behavior of physical interactions under accelerated time conditions.
  • Optimizing performance, especially on mobile devices, when the game speed is increased.

What is the best practice for implementing time acceleration in Defold with Box2D physics?
Are there performance considerations or optimizations I should be aware of when increasing the game speed, especially for mobile devices?

1 Like

Maybe this would help you?

https://defold.com/manuals/collection-proxy/#time-step

1 Like

This was the first approach we tried and, without a doubt, the most obvious solution. However, we’ve noticed that as we accelerate time, anomalies seem to increase proportionally, and we’re not sure why this is happening. Additionally, older phones are struggling, which adds to the challenges.

What does this mean?

Also, in general, physics engines like fixed time steps, and not too small or too large floats.
Could it be related to that?

When you say “accelerate”, how much are we talking about?

2 Likes