[quote=“Khrysanth, post:5, topic:7169”]Summer, 102 degrees:
Catch fish, butcher fish, and cook fish on a nearby fire - All without moving or delaying. The result is 2 cooked rotten fish fillets.
Given the extremely deadly cold in spring and the instant rot in summer, I’m going to have to step away from playing for a while.[/quote]
When I was messing around with the food decay code I saw how this could be a problem. I figured it would be fine, since it was fine before, but it’s obviously not so. The main problem here is the math that calculates the rotting of a piece of food is very abstracted out and vaguely commented. When I tried to decipher it, I was confused for a long time. The most annoying part is that food items have a counter for the spoiling date, in turns, then that counter is compared against the counter for rotting, which increases from zero (until here it makes sense), but then at some event that I’m not certain when it happens, the rotting number updates by adding an amount of “rot per hour” turns, which doesn’t necessarily happen each hour (because unloading terrain) and is augmented or decreased by the historical temperature of the tile.
This means that to know the right value it should add in a specific moment, you have to get the current date and the last date the item was updated and examine the past temperatures to modify the base amount of rot. That part is easy. But what happens when you have to check for a fraction of an hour and therefore the hourly rot-points don’t make sense anymore? Weird things happen. Even after dividing by the fraction of hour you need. There’s some math errors somewhere in that part of the code, probably, maybe, that I can’t figure out.
And to compound it further, you get bad info from the item display because it looks up the rotting points while presenting the data, and I believe it expects it to be updated, but somehow it isn’t, even though food items are now active and should be checked by the game every turn.
Does it sound complicated and annoying and hard to grasp? That’s because it is. There’s no classing in that area beyond the itype and item instance. It’s a bunch of raw math, mostly uncommented. Even after people went and did their best to comment it. XD
So yeah, even if it’s in the fixing line, this may take a while to figure out, or it may be solved in two minutes, who knows. That’s the problem with playing on experimentals. You risk having game-breaking bugs. =3