squeek502 / SpiceOfLife

A Minecraft mod that encourages dietary variety through diminishing returns
The Unlicense
23 stars 27 forks source link

Lunchbox choosing food with diminishing returns #168

Closed SevenChords closed 3 years ago

SevenChords commented 3 years ago

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.

squeek502 commented 3 years ago

It should prioritize undiminished foods, and there are tests for that prioritization, so I'm not sure what's going wrong:

SevenChords commented 3 years ago

i will try to make a screen recording of the incident later today

SevenChords commented 3 years ago

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.