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

Eliminate "Peckish" #39760

Merged
merged 2 commits into from
May 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4213,10 +4213,6 @@ std::pair<std::string, nc_color> Character::get_hunger_description() const
} else if( recently_ate && contains >= cap * 3 / 8 ) {
hunger_string = _( "Full" );
hunger_color = c_green;
} else if( ( stomach.time_since_ate() > 90_minutes && contains < cap / 8 && recently_ate ) ||
( just_ate && contains > 0_ml && contains < cap * 3 / 8 ) ) {
hunger_string = _( "Peckish" );
hunger_color = c_dark_gray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to merge the branch condition into the next branch, otherwise people may see "Hungry/Very Hungry" when they would have see "Peckish" before this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I carefully analyzed that, and that's also why I outlined the testing I did.
As far as I can tell, "Peckish" only ever kicked in instead of no message, so now it should just go to no message as intended. Also this logic had gotten significantly over-complicated.
If you're hungry and start eating, you should still see hungry until either 15 minutes have passed OR you reach 3 / 8 stomach fullness.
If you're full and passing time as your stomach empties out, it should go from "Sated" to no message, then to Hungry.
If you're hungry and eat a small snack, it should go from hungry to no message and back to hungry, unless the snack is so small that your stomach empties out within 15 minutes, in which case it never budges from hungry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, "Peckish" only ever kicked in instead of no message

If just_ate is true, "Peckish" may kick in but no message may not. For example, if the stomach content is between 1/8 and 3/8, and time since last ate is larger than 0.25 hrs, then no hunger message is displayed. If at this time the player eats something small (such as a pill of aspirin?), then time since last ate becomes 0 and stomach content is still below 3/8. Before this change "Peckish" would have been displayed, and after this change "Hungry" would be displayed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going from no message to "peckish" when you eat and going from no message to "hungry" when you eat are both bugs, so restoring the old behaviour isn't a fix.
The only pertinent part of that logic is "just ate", everything else is redundant. The problem is, if we don't exclude "just ate" from the no message case, then "hungry" will always disappear immediately upon you eating anything, which is most likely going to make people think "eat one thing and then stop" is what the game wants them to do.

I can't see any way to resolve this without overhauling the whole thing, the scenario of "eating a tic-tack when your stomach is almost empty makes the game say you're hungry" is unintended, but it's the least bad alternative I can see, and it's no worse than the status quo.

} else if( !just_ate && ( recently_ate || contains > 0_ml ) ) {
hunger_string.clear();
} else {
Expand Down