Merged
Conversation
Closed
Miou-zora
requested changes
Dec 4, 2024
Contributor
Miou-zora
left a comment
There was a problem hiding this comment.
Overall it's nice 👍🏼 but the fact that we use time management along multiple scheduler with different context (resource RealTimeProvider and scheduler RelativeTimeUpdate::GetCurrentDeltaTime) may be disturbing.
Contributor
|
Also, putting implementation of schedulers inside of header file is questionable |
|
Miou-zora
requested changes
Dec 7, 2024
|
Miou-zora
approved these changes
Dec 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



(as the critcal label is not setup yet please consider this PR as critical)
Related to:
I have modified the way we handle system running by adding schedulers.
The schedulers work by implementing a common interface that simply needs the call operator
operator()(Registry ®). Each scheduler is responsible for running the systems the way intended.We can get a scheduler by using the GetScheduler method from the registry. This is useful if the scheduler is based on time, for example, the FixedTimeScheduler.
I have implemented two basic schedulers
StartupandUpdate: startup will only execute the systems once and update is the classical way of running systems (each time we call theRunSystemsfunction).I have also implemented two time based schedulers
FixedTimeUpdateandRelativeTimeUpdate.Fixed time works by only calling the systems when needed and doing multiple runs if the framerate doesn't meet the tick rate of the scheduler. By default the tickRate is 20ms (frame time when running at 50FPS). With this scheduler, the systems will only run 50 times per second even if the framerate is higher. There is a method to get the FixedDeltaTime.
Relative time works by calling the systems based on a target tickRate. If the client manages to run at the given tickRate or higher, the systems will always run once, but if the target tickRate isn't met the systems will run multiple times, taking into account the whole deltaTime the frame took. With this scheduler, systems always run at least once and will run multiple times if needed. There is a method to get the current deltaTime we should use for computations.
I have also modified the soft body simulations to use the RelativeTimeScheduler, as I find it the most appropriate.