Lunchbox choosing food with diminishing returns
SevenChords opened this issue ยท 3 comments
Not sure if this is intended, right now when i eat from the lunchbox it will sometimes still choose to eat a piece of food that gives diminishing returns while other foods that don't give diminishing returns are still in the lunchbox.
Lunchbox has 6 different juices from Pams inside
config is set to have the food history be 6 long
In theory, at least in this case, it should never eat something that gives diminishing returns (eating food with diminishing returns on it is slower, which makes the average player want to avoid that)
The other issue that follows eating a food at the beginning that gives you diminishing returns is that if all foods are stacked to the same size in the lunchbox, one will run out faster than the others, and near the end of what you have inside the lunchbox you will have no way of avoiding diminishing returns on every single food inside.
It should prioritize undiminished foods, and there are tests for that prioritization, so I'm not sure what's going wrong:
- https://github.com/squeek502/SpiceOfLife/blob/1.12/java/squeek/spiceoflife/items/ItemFoodContainer.java#L327-L328
- https://github.com/squeek502/SpiceOfLife/blob/1.12/java/squeek/spiceoflife/helpers/MealPrioritizationHelper.java#L67-L121
- https://github.com/squeek502/SpiceOfLife/blob/1.12/tests/squeek/spiceoflife/TestMealPrioritization.java
ok, turn out that i just did my math wrong, with a config of 6 items in the food history and a lunchbox with 6 items, you cannot avoid diminishing returns completely.
so what i think happened when the lunchbox ate one of the items twice in a row was it resetting the diminishing returns on one of the other items to have no diminishing returns on another item, and that would indeed make sense.