Cataclysm-dda: Junk food ceases to be enjoyable as you eat it

Created on 7 Mar 2020  路  10Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

The enjoyment value of some junk foods drops when you eat them, just like non-junk food.

Steps To Reproduce

  1. Spawn a big pile of chocolate waffles
  2. Eat it
  3. Enjoyment value drops with each piece consumed, until it reaches zero

Expected behavior

Junk food should not get boring when eaten.

Versions and configuration

  • OS: Windows

    • OS Version: 10.0 1909

  • Game Version: 0.D-12453-g05940bf [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda]
    ]
(S1 - Need confirmation) <Bug> Food / Vitamins Character / Player

Most helpful comment

According to @Davi-DeGanne's feature summary, junk food is not supposed to be affected, but this is only the case if "junk food" is the _only_ material. The chocolate pancakes I tested earlier have junk food, but they also have wheat, meaning they still get boring.

If your observation is correct, that's a bug. This line should be checking whether any material is junkfood. At least, I intended it that way when I wrote it.

It's calculated per-portion, meaning that foodstuffs with smaller serving sizes suffer more. The chocolate pancakes are made in batches of 4, and only have 6 enjoyment, meaning that by the time you've eaten the first three the last one has no taste whatsoever.

Several items that aren't "junk food" feel like they should be exempt, such as coffee, tea and alcohol. Currently, if you drink coffee every day, you will lose your ability to enjoy it, which feels very unintuitive.

These both have the same solution: There is a JSON comestible property, monotony_penalty, which defaults to 2. You can set it to zero to override the feature for a specific item. (No offense but you would have know this if you'd read the PR more thoroughly.)

(Btw, long time no see simulacrum! (and anyone else who sees this and remembers me) I've been really busy for awhile, but meaning to come back at some point... perhaps now is the time? We shall see)

All 10 comments

This is intentional behavior. #35910

I figured there had to be SOME intent behind it, but didn't find the PR. Thanks.
I still think it's too harsh, though.

  1. According to @Davi-DeGanne's feature summary, junk food is not supposed to be affected, but this is only the case if "junk food" is the _only_ material. The chocolate pancakes I tested earlier have junk food, but they also have wheat, meaning they still get boring.
  2. It's calculated per-portion, meaning that foodstuffs with smaller serving sizes suffer more. The chocolate pancakes are made in batches of 4, and only have 6 enjoyment, meaning that by the time you've eaten the first three the last one has no taste whatsoever.
  3. Several items that aren't "junk food" feel like they should be exempt, such as coffee, tea and alcohol. Currently, if you drink coffee every day, you will lose your ability to enjoy it, which feels very unintuitive.

According to @Davi-DeGanne's feature summary, junk food is not supposed to be affected, but this is only the case if "junk food" is the _only_ material. The chocolate pancakes I tested earlier have junk food, but they also have wheat, meaning they still get boring.

If your observation is correct, that's a bug. This line should be checking whether any material is junkfood. At least, I intended it that way when I wrote it.

It's calculated per-portion, meaning that foodstuffs with smaller serving sizes suffer more. The chocolate pancakes are made in batches of 4, and only have 6 enjoyment, meaning that by the time you've eaten the first three the last one has no taste whatsoever.

Several items that aren't "junk food" feel like they should be exempt, such as coffee, tea and alcohol. Currently, if you drink coffee every day, you will lose your ability to enjoy it, which feels very unintuitive.

These both have the same solution: There is a JSON comestible property, monotony_penalty, which defaults to 2. You can set it to zero to override the feature for a specific item. (No offense but you would have know this if you'd read the PR more thoroughly.)

(Btw, long time no see simulacrum! (and anyone else who sees this and remembers me) I've been really busy for awhile, but meaning to come back at some point... perhaps now is the time? We shall see)

If your observation is correct, that's a bug. This line should be checking whether _any_ material is junkfood. At least, I intended it that way when I wrote it.

I ate some more junk food, and it actually looks like there's something else going on. While the chocolate pancakes and waffles do get boring, other junk food items with multiple ingredients do not. Also, there are items with no listed materials other than junk food that still get boring.

consume

One thing I noticed is that the problem items here have the "primary_material" field. It's "processed_food" for the waffles and the TV dinner, "milk" for the hot chocolate" and "water" for the cola and orange soda. Other items just don't have it. Maybe it's checking that instead?

I'm not sure which junk foods this is affecting, but I tested by eating four servings of butter popcorn and three maple candies, all recently looted off zeds, and there was no reduction in enjoyment.

  • OS: Windows

    • OS Version: MINGW/CYGWIN/MSYS2 on unknown Windows version

  • Game Version: 0.D-12648-g63d3fb8 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    No Fungal Monsters [No_Fungi]
    ]

I edited the report to only include the point about some junk foods becoming boring. The rest is really more of a feature request.

As @Davi-DeGanne noted, you can already define exactly what penalty there should be for any food, as documented in JSON_INFO.md, by setting:

"monotony_penalty" : 0 // (Optional, default: 2)
// Fun is reduced by this number for each one you've consumed in the last 48 hours.
// Can't drop fun below 0, unless the comestible also has the "NEGATIVE_MONOTONY_OK" flag.

There are no foods in the game with monotony_penalty or NEGATIVE_MONOTONY_OK defined, so the penalty is falling back on the somewhat elaborate calculation in item_factory.cpp, to determine whether the food is mostly junk, starting on item_factory.cpp L1845. I think this is why you are seeing different penalties for different foods with multiple ingredients.

@Soadreqm Which foods, specifically, do you think should have a different monotony penalty? It seems like such a subjective thing - I mean, I love me some chocolate waffles (especially with bananas and whipped cream), but I could definitely get bored of them if I had 10 in a row.

Which foods, specifically, do you think should have a different monotony penalty?

For starters, anything with "junk food" listed in the materials in-game. I don't think it's by design that chocolate waffles get boring while chocolate cake doesn't, but if it was, it still needs to be communicated to the player. Or at least possible for the player to figure out without examining the source.

I'd also like several other foodstuffs to have no boredom penalty, whole categories actually, but getting the junk food check to work in a deterministic way is a higher priority.

For starters, anything with "junk food" listed in the materials in-game. I don't think it's by design that chocolate waffles get boring while chocolate cake doesn't

Correct. The calculation isn't supposed to be elaborate -- I intended it to simply be, "if the primary material or any of the other materials are junkfood, set the monotony penalty to 0, otherwise it defaults to 2"

I figured out what is going on -- you were right @Soadreqm, if there is a primary material, then this line which is responsible for checking the secondary materials never runs due to being in the 'else if' block.

I will see if I can find some time to take care of it later this week. On the other hand it's a fairly straightforward fix -- good candidate for someone looking for their first C++ PR.

Gotta say, as one who has often gorged on chocolate cake, the monotony penalty is most definitely wrong. It should reach negative after eating enough of it in one sitting. Maybe we could see all junk food suffer morale penalties and give nausea after consuming enough in one go?

Coffee is an interesting point though. Really, foods you haven't consumed in a while could give a buff instead. Maybe a week or two as default but can also be modified? I know that if I spend a day or two without getting a coffee I seriously appreciate the taste, not just the caffeine.

Was this page helpful?
0 / 5 - 0 ratings