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

math_parser/eoc: migrate arith. weather to math #65298

Merged
merged 5 commits into from
May 11, 2023

Conversation

andrei8l
Copy link
Contributor

@andrei8l andrei8l commented Apr 25, 2023

Summary

None

Purpose of change

Port another arithmetic function to math. weather was used recently for #64954 and it's a small enough target.

Describe the solution

Move the code from arithmetic to math.
Use Kelvin for temperature to match internal representation.
Add temperature conversion functions.

Fix the calculations and conditions for fog/mist: ported from EOC to jmath_function. Added reference for the formula we used and re-converted it to Celsius. Fixed the conditions for mist to better match reality.

Describe alternatives you've considered

Continuing to use Fahrenheit: Temperature is internally already Kelvin so it makes more sense to expose it to EOCs in the same unit. Weather aspects use a mixed bag of undocumented metric and non-metric units atm and I'd rather port them all to SI if possible.

Testing

Existing test unit.

Both mist and fog still occur in game. Mist/fog no longer occur by default on a fresh game simply because dew_point_factor hasn't been calculated yet.

Additional context

I promised I'd do this for #64954 but I got sidetracked IRL. Better late than never though.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON [Markdown] Markdown issues and PRs Code: Tests Measurement, self-control, statistics, balancing. EOC: Effects On Condition Anything concerning Effects On Condition Mechanics: Weather Rain, snow, portal storms and non-temperature environment Mods Issues related to mods or modding Mods: Aftershock Anything to do with the Aftershock mod Mods: Desert Region Anything relating to the Desert Region mod NPC / Factions NPCs, AI, Speech, Factions, Ownership astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 25, 2023
@andrei8l andrei8l force-pushed the math_parser-weather branch from ec760cd to ca746d0 Compare April 28, 2023 04:05
@andrei8l andrei8l marked this pull request as draft April 29, 2023 21:34
@andrei8l

This comment was marked as outdated.

@andrei8l andrei8l marked this pull request as ready for review May 4, 2023 05:38
@andrei8l andrei8l force-pushed the math_parser-weather branch from ca746d0 to 15723a5 Compare May 4, 2023 05:38
@andrei8l andrei8l force-pushed the math_parser-weather branch from c5cbcd6 to 1fd8901 Compare May 5, 2023 04:34
@dseguin dseguin merged commit 896a884 into CleverRaven:master May 11, 2023
@andrei8l andrei8l deleted the math_parser-weather branch May 11, 2023 04:43
@andrei8l
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mechanics: Weather Rain, snow, portal storms and non-temperature environment Mods: Aftershock Anything to do with the Aftershock mod Mods: Desert Region Anything relating to the Desert Region mod Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants