Skip to content
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

Decouple fps tps #1166

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

Hambones82
Copy link
Contributor

@Hambones82 Hambones82 commented Apr 10, 2023

This pull request attempts to address #997. First, in framework.cpp, a new whileloop is added around currentstage.update() which runs on a ticks per second basis, rather than being in lockstep with stage.render(). The code also includes various changes related to ticks_per_second and related constants, throughout a number of files. The code also moves the ticks_per_second constants into framework.h, in order to allow the state update loop to run on a ticks_per_second basis. This assumes a 1:1 correspondence between in-game seconds at the slowest speed and real-time seconds. Later, we might consider moving the time constants back into gametime.h and having a single number that is ticks per real second (or something), as well as ticks_per_sim_second, with a relation between the two.

Re the change to doodad, it now has a magic number which is bad. I'm not sure what it should be, though... It was originally ticks_multiplier, which I thought I knew what it meant but now I'm not so sure.

@FilmBoy84
Copy link
Collaborator

Regarding Doodad.cpp do we want to hardcode this value of four if we move to a variable simulation rate?

@Hambones82
Copy link
Contributor Author

You are right. I think it will make sense to create a new constant for doodads in doodad.h. I'll update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants