Slowing/Pausing CoherenceInputSimulation

For context, I’m working on a 2D fighter and for testing reasons I wanted two things.

  1. To be able to slow down the simulation.
  2. To pause the simulation and move forward 1 frame at a time (on all clients) by pressing a button.

I’m guessing both can be achieved by changing the FixedTimeStep, just not sure how to do that.

Thanks!

I’m not sure if this gets you exactly what you want, but we do have: Simulation Frame | Unity Multiplayer SDK Documentation | coherence

Check out the Fixed Simulation Frame docs: Simulation Frame | Unity Multiplayer SDK Documentation | coherence

Let me also wrangle some folks who might have more insight on how to achieve what you’re looking for.

1 Like

Thank you for the quick response!
I’ll have a look :slight_smile: any more info you can get is greatly appreciated

Just to keep you updated, some engine folks are taking a look at this to see what the best approach is, but will likely be Thursday this week before they can get back to you. In the meantime, one of our devs mentioned the following, if it helps:

This is not supported by our GGPO framework, but can be done with fixed inputs. I’d approach this by having a “Pause” button in the input. Only the client that paused the game can unpause it. It is just another part of the deterministic state, so if you receive the “pause” late (after some predictions), you rollback the state and pause at the right moment.

1 Like

I’ll give that approach a try for the pausing, would still be nice to be able to slow it down, but this is already a great help. Thanks!

Actually I think I’ll be able to do everything with that, just need to not call Simulate on the objects I want to pause.

And to slow it down i can set a timer to pause/unpause at a given frequency (ie. every other simulation frame for 50% speed, etc.)

1 Like

It sounds like you have what you need? Great if so - if not let us know and we can continue further

Yep, this is solved! thanks