Time Control 2.0

Time Control 2.0

52.7k Downloads

Physwarp to keep physics time ratio constant

damerell opened this issue ยท 7 comments

commented

When roving, I used to use the Better Time Warp and Physical Time Ratio Viewer mods to keep the physics time ratio to about 100%. Physical Time Ratio Viewer is dead as far as I can see, and this was a fiddly process.

I'd like to request a feature that will adjust physwarp on the fly up to a maximum configured amount to try to keep the physics time ratio close to 100%.

commented

Your statement of the goal is perfectly correct.

Rovers are pretty forgiving of moderate physwarp (and a high physics delta, which I think is doing the same thing?) anyway, and I usually found myself settling on about 1.3-1.6x physwarp depending on the number of parts. Hence a sudden speedup wouldn't result in catastrophe even if the mod were a bit slow to notice.

commented

That mod's 'ratio' is just the percentage difference in real time between each execution of Update() and the real time elapsed since each call to Update(). So it just gives you an idea of how much extra work the processor has to do each frame (sort of, since physics are managed separately...). So your goal is to try to keep the game in 'realtime' as best you can, sacrificing physics accuracy for real-time movement?

It can be done, but will require a significant amount of code.... "real-time keeper" we could call it or something. It'd need to experiment to find the right settings without wasting too much time... sounds like a job for a gradient descent algorithm maybe? I would have to look into it.

commented

In theory you can now do this manually as hyper warp will allow a setting of 1x, which will execute the physwarp changes. I am still thinking about how best to implement a 'real-time keeper'.

commented

I'm now finding hyper-warp quite adequate for this, except that the display jiggles between "HYPER-WARP 1x" and "HYPER-WARP 0.9x". If the former was displayed as "1.0x" (and presumably likewise for 2.0x, etc" it would be much less distracting.

IDK if you want me to close this issue and open a new one.

commented

I think I have a setting that removes the display completely. Also, if you turn off the performance counters, it should just say 'HYPER WARP' with no rate. This is not ideal, I know. Right now its kind of crazy - it does a rolling average of the time between last Universe Timestamp and last Real Timestamp to figure out how fast time is passing relative to real-time, which is going to not be perfect.

Sorry this has taken so long to do. Will just turning off screen messages or performance counters solve your problem?

commented

Oh - i see what you mean. String format as 1.0x instead of 1x. I can make that change.

commented

I'm sorry to say that doesn't seem to have worked quite as expected. I find HyperWarp now exits very shortly after being started (typically at the point I would expect it to display 1.0x) and the log is full of messages from TimeControl.

I'll provide logs or whatever else is is needed if this isn't easily reproducible - just say.

Foolish of me not to at least provide an extract:
[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action PauseToggle with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action TimeStep with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action HyperToggle with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action SlowMoToggle with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action WarpToNextKACAlarm with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action WarpForNTimeIncrements with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action HyperRateSlowDown with Key Combination [None]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block execution time 0ms

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block exit

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - (TimeControlKeyBinding.GetConfigNode) - block entry

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TimeControl(2.10.0)] 10/23/2020 9:27:45 PM - () - Getting ConfigNode For Action HyperRateSpeedUp with Key Combination [None]

There's tens of thousands of lines matching "TimeControl" in Player.log.