Skip to content

Use built-in constants for tick values#649

Merged
notfood merged 1 commit intorwmt:devfrom
SokyranTheDragon:use-built-in-constants-for-tick-values
Aug 24, 2025
Merged

Use built-in constants for tick values#649
notfood merged 1 commit intorwmt:devfrom
SokyranTheDragon:use-built-in-constants-for-tick-values

Conversation

@SokyranTheDragon
Copy link
Copy Markdown
Member

I've replaced a few of the constant values (that I could catch) used in the mod with references to the in-game constants.

I've done this primarily to make the intentions behind those values clearer. Using GenTicks.TicksPerRealSecond is more obvious that the value refers to amount of ticks in a second, rather than just using the value of 60. Likewise, using GenDate.TicksPerDay is much easier to understand than a value of 60000 or 2500 * 24.

The only "change" on top is changing 1 / 60f to 1f / GenTicks.TicksPerRealSecond (1 to 1f), as we need one of those values to be a float (or we'll end up with integer division).

This will not change anything gameplay-wise, as all those constants will be computed at compile time and end up the same in the compiled code. This will only affect the source code.

I've replaced a few of the constant values (that I could catch) used in the mod with references to the in-game constants.

I've done this primarily to make the intentions behind those values clearer. Using `GenTicks.TicksPerRealSecond` is more obvious that the value refers to amount of ticks in a second, rather than just using the value of `60`. Likewise, using `GenDate.TicksPerDay` is much easier to understand than a value of `60000`, or even `2500 * 24`.

The only "change" on top is changing `1 / 60f` to `1f / GenTicks.TicksPerRealSecond`, as we need one of those values to be a float (or we'll end up with integer division).

This will not change anything gameplay-wise, as all those constants will be computet at compile time and end up the same in the compiled code. This will only affect the source code.
@SokyranTheDragon SokyranTheDragon added enhancement New feature or request. low priority Quality of life or ignorable to an extent. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels Aug 23, 2025
@notfood notfood moved this to In review in 1.6 and Odyssey Aug 24, 2025
@notfood notfood merged commit c20fb87 into rwmt:dev Aug 24, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In review to Done in 1.6 and Odyssey Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). enhancement New feature or request. low priority Quality of life or ignorable to an extent.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants