You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem related to your feature request.
Valence currently uses the ScheduleRunnerPlugin to run each tick with a fixed delay. Problems arise because ScheduleRunnerPlugin does not account for thread::sleep inaccuracies. This is especially apparent on platforms like Windows where the timer resolution is very imprecise (16ms) by default. Regardless, this is probably not the intended use for ScheduleRunnerPlugin.
The obvious solution is to use bevy_time and CoreSet::FixedUpdate. However, there are two problems:
The default base set for the Main schedule is CoreSet::Update. It's far too easy to accidentally add systems to the wrong set when .in_base_set(CoreSet::FixedUpdate) is forgotten.
There are no standard PreFixedUpdate, PostFixedUpdate, sets. Plugins and Valence internally need to run code before and after user code.
Bevy 0.11 will fix (1) with the "schedule-first" redesign. But there is still no solution for (2).
What solution would you like?
When Bevy 0.11 is released, create a TickLoop schedule and use the facilities in bevy_time to run our own TickFirst, PreTick, Tick, PostTick, TickLast schedules in that order. User code goes in Tick.
What alternative(s) have you considered?
We could modify the app's runner to match the behavior of CoreSet::FixedUpdate. But that will cause problems for graphical plugins that will likely replace the runner by using WinitPlugin.
Additional context
The text was updated successfully, but these errors were encountered:
Describe the problem related to your feature request.
Valence currently uses the
ScheduleRunnerPlugin
to run each tick with a fixed delay. Problems arise becauseScheduleRunnerPlugin
does not account forthread::sleep
inaccuracies. This is especially apparent on platforms like Windows where the timer resolution is very imprecise (16ms) by default. Regardless, this is probably not the intended use forScheduleRunnerPlugin
.The obvious solution is to use
bevy_time
andCoreSet::FixedUpdate
. However, there are two problems:Main
schedule isCoreSet::Update
. It's far too easy to accidentally add systems to the wrong set when.in_base_set(CoreSet::FixedUpdate)
is forgotten.PreFixedUpdate
,PostFixedUpdate
, sets. Plugins and Valence internally need to run code before and after user code.Bevy 0.11 will fix (1) with the "schedule-first" redesign. But there is still no solution for (2).
What solution would you like?
When Bevy 0.11 is released, create a
TickLoop
schedule and use the facilities inbevy_time
to run our ownTickFirst
,PreTick
,Tick
,PostTick
,TickLast
schedules in that order. User code goes inTick
.What alternative(s) have you considered?
We could modify the app's runner to match the behavior of
CoreSet::FixedUpdate
. But that will cause problems for graphical plugins that will likely replace the runner by usingWinitPlugin
.Additional context
The text was updated successfully, but these errors were encountered: