CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.31k stars 4.14k forks source link

Freezer Rot #36401

Open Zourin2 opened 4 years ago

Zourin2 commented 4 years ago

Edit: The issue appears inconsistent. One reload resulted in bugged food items, the subsequent reload, the food appears to operate normally. I will continue to experiment.

Food placed in a minifreezer (and probably minifridge) are not having their decay timers properly applied to the item. Food is rotting at a normal rate despite being (Cold) or (Frozen) under still unknown circumstances.

Bugged food items are easily identified because when you take them out of the fridge/freezer, they instantly no longer have the (cold) or (frozen) tag, indicating the state was stripped from it at some point, likely during the vehicle loading into the reality bubble.

Steps To Reproduce

Frozen Debug 1.zip

Steps to reproduce the behavior:

  1. Load save (do NOT go outside!)
  2. Retrieve 1 "Frozen" batter-fried fish portion
  3. The food in your hands is not frozen. It is not cold.
  4. Wait about 12 hours.
  5. retrieve 1 additional "frozen" batter-fried fish portion. Note this stack has not been removed from the freezer.
  6. Item is not frozen. It is not cold. It is rotten.

Additional context

Items in this particular freezer were pre-cooked and immediately placed into the mini-freezer in preparation for my current situation (ant siege). It was properly frozen at that time, as it stored for several days.

The vehicle was left outside the reality bubble on several occasions after food was placed, leaving it outside the reality bubble for no less than 12 hours, At least 48 hours was spent with the vehicle inside the reality bubble before the vehicle was moved.

Prior to identifying the items were glitched, I took the vehicle from my home base, drove to the evac shelter to the east, and then parked in the current location.

Expected behavior

Frozen food should be properly preserved and not rot. Expiration timers should be extended for Cold food.

Versions and configuration

Zourin2 commented 4 years ago

Some testing with a new event that happened:

I had a stack of frozen sausages I've had for ages. I removed 4 from the stack for breakfast and they were 'Frozen'. I went fishing about 4 map tiles away, came back, and removed 4 more frozen sausages for lunch. These were 'cold' the instant they were in my hands. When the freezer contents were unloaded, ONLY the sausage stack emerged as 'cold' while other items were 'frozen'.

Now, I suspected that taking items off the stack was doing this. I had two frozen bottles of Kompot in the same freezer. I removed one. Frozen. Removed the second, also frozen. Repeated this, only I reheated the first bottle before removing the second. Also frozen. This is an obnoxiously elusive bug.

JeanLucVanDamme commented 4 years ago

I seem to be having the exact same issue.

Had several stacks of frozen, fresh meat in my vehicle minifreezer. After scavenging dozens of overmap tiles away for 2-3 days, I return and all meat is frozen and rotten. The vehicle had near 100% power the whole time, the freezer was continuously on, no damage.

Ker-Nes commented 4 years ago

Just had it happen to me. A lot of my food stockpile got severely aged despite being frozen. Same thing, batteries were full, two separate freezers in two separate and unconnected vehicles, both had all food suddenly aging a lot, as if it had been always aging. Of particular note in terms of expected behavior were Beech Nuts, harvested a long time ago (beyond it's lifespan at room temperature) but that had been frozen shortly after being harvested, and some sourdough bread crafted a week ago (thus still in its normal lifespan at room temperature) and frozen, which did not rot, although in some reloads it did got aged up some.

It leads me to believe that the issue is that the game is retroactively applying aging to items in the freezer when the game is reloaded.

Jovus commented 4 years ago

Piling on here to add another instance; in my case everything in my minifreezer rotted all at once, despite very definitely being frozen. (The items showed both that they were frozen and rotten.)

Possibly of interest, a bunch of other stuff, using other preservation methods, including both canning metal and glass cans and pickling and dehydrating all rotted at (as far as I am able to tell) the same time.

Hirmuolio commented 4 years ago

I think I found a likely cause for this.

Food items are not processed every turn. So in certain situations you can come back to your vehicle (it is loaded into your reality bubble) and take the item out of freezer before the item temperature/rot are calculated. Then the rot is calculated after the item is in your inventory. And since the last rot check was long time ago it will process the item as if it had been in inventory for long time.

This does not happen for items that are on ground. Those get processed immediately when they are loaded into reality bubble in map::actualize. Items in vehicles do not get this treatment.

The easiest fix would probably be to process items that are in vehicle containers when the vehicle is loaded into reality bubble.

I do not know how the frequency at which the food item is processed is determined. If you debug spawn multiple items they get processed every turn but if you then drop those items they no longer are processed every turn. It seems like more items means less frequent processing. item::processing_speed says it is 10 minutes, maybe this is max time between processing calls.

If someone knows how to reproduce this bug here is how to test if this is the cause.

If the difference between last rot and current turn is more than 600 (10 min) then the item has not been processed since it was loaded into reality bubble.

Zourin2 commented 4 years ago

Perhaps the discrepancy isn't about loading the reality bubble but specifically loading the game world itself (game load vs regional movement) somehow inhibiting or delaying the freezer calculation?