The TimeStone can apply simulation on Physics and on code.
- Start and Stop Simulating
Call TimeStone.StartSimulation() and
TimeStone.StopSimulation()
For testing purpose, you have Editor's real time controller to do this actions.
- Do simulation on start
TimeStone will execute a simulation on Start
- Limit duration
The simulation will automatically stops when reaching the duration
If the simulation has no limit, you should stop it by calling TimeStone.StopSimulation()
- Simulation speed
The simulation will be executed at this speed.
If the maximum milliseconds by frame is reached while simulating, the real
execution speed could be lowered to preserve the performances
- Use Time.deltaTime
The simulation uses the current frame Time.deltaTime.
If speed is higher than 1, then the current frame deltaTime is used for all
ticks simulated in the same frame.
This option is useful to get results closer to the real execution, but as a
result, you will also get the eventual real lags and spikes in your simulation.
For example, on scene start Unity will most of the time have a deltaTime spike,
you can avoid it in your simulation by unchecking this option.
About Debugging : While debugging your code, you should uncheck this
option, because the debug will strongly alter the deltaTime you get
in Unity and you could get different simulation results from what you get
without debugging
- Simulate Code
With this option activated, the TimeStone will call the TimeAgents life-cycle
callbacks to execute code during the simulation
- Simulate Physics
With this option activated, the TimeStone will run the Physics simulation on the
TimeAgents.
- Max ms by frame
The limit in milliseconds that a simulation execution won't be able to go over
every frame. This is a security to preserve your framerate during a
simulation.
- Group frame ticks
When speed is higher than 1, this option will group all simulated ticks from a
same frame (with an adapted deltaTime).
This results in faster simulation but with less precision.
- Keep simulation scene
The scene where TimeAgents and clone and simulated won't be destroyed when
simulation ends.
Useful for debug for example.
- Reset add cursor on completion
The TimeStone.addTickCursor will be replaced at the Simulation start tick index
on completion.
Useful to run multiple simulations in a row without having to replace the cursor
manually (without this option the simulations will be chained)