-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify FixedTime and Time (proof-of-concept) #8930
Unify FixedTime and Time (proof-of-concept) #8930
Conversation
Example |
Example |
Example |
3 similar comments
Example |
Example |
Example |
Example |
Closing in favor of #8964 |
PULL REQUEST ONLY FOR DISCUSSION, NOT MERGE READY BY FAR.
Objective
Current
FixedTime
andTime
have several problems. This pull aims to fix many of them at once.FixedUpdate
for a large number of steps. If the pause is merely seconds, then this will just mean jerkiness and possible unexpected behaviour in gameplay. If the pause is hours/days as with OS suspend, the game will appear to freeze until it has caught up with real time.FixedUpdate
that calculates elapsed or step count in a resource.FixedStep::period
rather thanTime::delta
. This, coupled with the issue thatTime::elapsed
isn't available at all for fixed steps, makes it that time requiring systems are either implemented to be run inFixedUpdate
orUpdate
, but rarely work in both.Solution
Time
report "fixed step clock" time while insideFixedUpdate
....
maximum_delta
toTime
that limits how much the virtual game clock can be advanced with a single update. Does not affect raw clock.FixedTime::period
to beTime::fixed_period
and removeFixedTime
structure entirely.Time::delta
,Time::elapsed
and friends report time according to fixed steps insideFixedUpdate
.Clock
data structure to make it more obvious what the independent tracked values are and to reduce code duplication.Changelog
Migration Guide