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

Audit satiety. #78206

Conversation

osuphobia
Copy link
Contributor

@osuphobia osuphobia commented Nov 28, 2024

Summary

Interface "Audit satiety"

Purpose of change

We use satiety to represent the energy density of food and beverage, but there are some mistakes in the infrastructure.
For berverage, the dry volume is 0, and compute_calories_per_effective_volume does not treat it correctly, resulting in overflow and always returning max satiety, even when the berverage, like lotus tea, barely has any calories.
See the chart below for more details:
2024-11-28 -0

Describe the solution

Fix masticated_volume can return minus solid mass.
Return both water and dry volume in masticated_volume.
Fix overflow for berverage, add a factor for water and consider both water and dry volume in compute_calories_per_effective_volume, changed max_cal_per_effective_vol to 2000.
Update test cases.
Before:
2024-11-28 -1
After:
2024-11-28 -2
For GOURMAND mutant with a bigger stomach:
2024-11-28 -3

Describe alternatives you've considered

Testing

Passed "effective_food_volume_and_satiety" and "food_satiety_bar", worked good locally.

Additional context

quench value of food and beverage needs an audit #78182

@github-actions github-actions bot added Items: Food / Vitamins Comestibles and drinks Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions labels Nov 28, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Nov 28, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 28, 2024
@osuphobia
Copy link
Contributor Author

Clang is irrelevant, fixed in #78217 .

src/consumption.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 1, 2024
@Night-Pryanik Night-Pryanik merged commit 6bcd824 into CleverRaven:master Dec 2, 2024
20 of 26 checks passed
@osuphobia osuphobia deleted the Modify-compute_calories_per_effective_volume branch December 2, 2024 07:44
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. Info / User Interface Game - player communication, menus, etc. Items: Food / Vitamins Comestibles and drinks json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants