Game version: 0.C-28852-gf3e70f1
Operating system: Windows 7, 64-bit
Tiles or curses: tiles
Mods active: Dark Days Ahead, Filthy Clothing, Disable NPC Needs, Simplified Nutrition, Alternative Map Key, NPC Traits, Beta National Guard Camp, More Buildings, More Locations, Tall Buildings, Urban Development
Food left in an ice lab should not spoil, or spoil very slowly. (In freezing temperatures, especially as low as in an ice lab, food is expected to last very long - certainly for months at least, even if flavor changes, oxidation, etc. are considered "rot" in Cataclysm DDA sense.)
Meat in an ice lab, kept constantly at below -20C, rots within days. This is likely related to the recent commit https://github.com/CleverRaven/Cataclysm-DDA/commit/22e2683b219d4137cbd51bfe1dcaa9c99b503a38, and the corresponding PR https://github.com/CleverRaven/Cataclysm-DDA/pull/24073. The language in the PR leads me to believe this is not intended behavior.
For example, spawning a chunk of tainted meat and having it lie for 6 hours on the floor of a -1 level of an icelab (temperature of -22C), shows the following debug info upon examinination:
```Material: Flesh
age: 6
bday rot: 3616
temp rot: 1204
max rot: 2400
fridge: -1
last rot: 88245
burn: 0
It seems to rot only three times as slowly as in room temperature, and indeed waiting 12 hours is enough to make it rotten.
Doing the same at level -5 (temperature of -88C) results in:
```Material: Flesh
age: 6
bday rot: 3606
temp rot: 1308
max rot: 2400
fridge: -1
last rot: 95570
burn: 0
Waiting 12 hours is also enough to rot it. The temperature seems to make no difference to rotting speed, apart from slowing it down three times.
Put meat or another quickly spoiling food article in an ice lab. Wait some time, note the decay.
It's not just ice labs, low temperature effect on rotting is generally too miniscule, as evidenced by using 24/7 powered minifridges.
From what I remember, minifridges had nothing to do with temperature, but rather worked like magical boxes which slowed food aging by some multiplier. So this bug probably has no relation to minifridges, but bear in mind I have never actually looked at Cataclysm DDA code.
BTW, a few months ago, food never rotted in ice labs; likely because it was a special case in code. (I.e. "is it in an ice lab? then no rot at all, regardless of temperature.")
Yeah, the special case was removed in PR #24073 . From looking at the code, I think he forgot to make sure that the get.temperature() function return the hardcoded low temp of ice lab, but then I'm likely wrong since I've not done any serious coding in 10 years.
I think I know where the problem is. Fix in progress.
From what I remember, minifridges had nothing to do with temperature, but rather worked like magical boxes which slowed food aging by some multiplier.
That. Flat 20% Something to think about in this thread for a future PR: #24145
From looking at the code, I think he forgot to make sure that the get.temperature()
Haven't forgot, I just didn't noticed that temperature()
function in map use different map scale (depth). As a result it haven't taken any local mam temperatures overlays into account, just flat underground temperature. My bad.
That. Flat 20% Something to think about in this thread for a future PR: https://github.com/CleverRaven/Cataclysm-DDA/issues/24145
Hopefully, in the future, fridges and freezers will just make their contents magically behave as if they were low temperature (how low depends on appliance), as long as power is provided. I will keep my fingers crossed that your PRs eventually develop into a whole environment physics system. :)
Minifridges simulate this behaviour, or they should --> I think i've seen an issue report that they don't always work?
From my point of view i'm just not sure if flat 20% is what it should be. Rather that that i'd gladly see it simulated actual temperature, using existing sophisticated RL-based calcualtors already existing in game, like those implemented in my rootcellars PR mechanics. What temperature should it be? Feel free to drop some ideas in issue mentioned above.
The usual temperature for refrigerators is about 1.6 degrees Celsius, putting it just above freezing. Ground beef, for example, which provides a vastly increased surface area to pathogens and thus, is incredibly susceptible to rotting if left out compared to whole carcasses, primals and sub-primals, can last in a fridge without deterioration in quality for two weeks before it starts to deteriorate; this is a physical deterioration, though, and just results in sub-prime taste and consistancy for up to two weeks after. Microorganism growth roughly doubles every 3.3 degrees Celcius, and below 4.4 is considered safe; The average of current fridges being 1.4 slows them down even further, with many already lapsing into hibernation until the food is warmed again. Freezing foods makes them entirely impervious to rot, as there is no microbial action at those temperatures, and while the food quality will suffer (anything frozen will have its cell walls rupture from internal moisture freezing and expanding, unless dried first) it remains perfectly edible.
As such, that's my recommended base point for consideration. 0 degrees C, things don't rot. At 1 degrees C, raw meats take four weeks to rot. For every 3.3 degrees C the temperature increases, halve the time to decay. Most fruits and vegetables (basically everything not watermelon or potato) is safe up to about 7 degrees C; watermelon and potato are safe up to 4 degrees C. Most fruits are still at their prime edibility within 7 days after being picked and stored in a fridge, and will exponentially deteriorate afterwards; they should not just jump to "rotten", but rather to "deteriorating" and be only good for jam or juice recipes (which are traditionally how old fruits that were going bad were used). Root vegetables should last for two weeks at room temperature; most actually rot faster in a fridge because moisture condenses on their surfaces and causes them to rot in that manner. They're best stored in a root cellar instead (where it got its name from, in fact) of a fridge, unless you install a circulating fan inside to keep the air flowing and keep things dry. I also think that a freezer should be able to be created; Styrofoam is just C8H8; you can easily make some low-quality stuff at home, using glue, a strong acid, and detergent. Cover the inside of a large metal container with it (either welded together, or using a pre-existing container), add some copper tubing and diesel or gasoline as a refrigerant, and add a mechanical pump. Hook it up to power and you have a working freezer, just like that. Add rubber hose for a sealing edge, for good measure. You can also make a folded-over space inside the metal walls (taking twice as much metal) and use a vacuum pump to siphon out the air and leave a vacuum (same principle behind thermos) but then you can avoid having to do the whole chemical foaming process.
Here's more information available on all this sort of stuff re; food temperatures and the like: highered.mheducation.com/sites/dl/free/0073398187/835451/Chapter17.pdf
Would we need 0 degrees or -1 for considering something "frozen"? Not any system is perfect. Especially a fridge or freezer. As warm spots, disturbance from opening/closing etc cause it to fluctuate, and those instances can cause rot to spread (power cut causing a freezer to get warm, rot gets in). Though a lot of the freezers (and ice in general ;) ) have thermal capacity, so it's not instant either (some fridges/freezers rated for hours of safe use during a power cut).
So whatever temp is chosen, and the speed of rot or the type of food quality degradation, we need some understanding of the inexact qualities of the storage mediums (effectively the maths is exact, but the ability of the player character needs to be considered if perfect or not).
Back to the nitty gritty of the issue. Most modern fridges and freezers have thermometers to set exact temps (lower = more power too). Where as older ones just have "more power = lower temp" settings.
Could the player (as there is a thermometer item) make a temp sensitive fridge? You'd not use the thermometer as a part, just a tool for setting the thermal metal expansion switch to the temp you want (or if using complex electronics, the resistance of a bit of metal and an adjustable dial).
Or you would "attach" the thermometer to the fridge, and when activated it would say the temp, then ask if you wish to up the power, lower, or leave it alone.
H20 freezes at 0, and it takes a VERY long time for something that's frozen to thaw out when the temperature rises above that but remains within refrigeration temperatures; since unless power goes out for a prolonged period of time this won't happen even with standard temperature fluctuations (which are honestly more on the term of microdegrees rather than whole or even tenths of degrees during standard operation; only time there's a "big" influx of warmth is when you pop it open to get something, and that's not enough to even budge a thermometer). While some things freeze at lower temperatures, like salt water, because the salt disrupts the crystallization, and as parts of it freeze, the salt gets more concentrated (as the ice formed doesn't contain the salt in solution), such that when saturated to the utomost the temperature it freezes at is about -21 degrees C.
Note that most modern home fridges and freezers are mass produced pieces of crap that aren't really made to be efficient or effective; they're made to be cheap to manufacture; when they consumed a lot more energy, they were generally better quality, because they didn't have to spend the funds to make them more energy efficient while also maintaining a positive profit margin. A good fridge or freezer, like any commercial or industrial model you might find in a commercial kitchen or factory setting, can keep for days without any power, because they're designed to be basically vacuum sealed and heavily insulated from outside temperatures all around. There's also been plenty of examples of near-passive freezers/coolers that have been made, using minimal energy over the year, such as https://benchapman4.wordpress.com/2012/12/10/passive-refrigerator/, which basically simulates the giant ice storages used in some parts of the world, but using some modern tech to also near-passively cool some adjacent rooms as well; basically modern construction methods, ancient concept.
True. I forgot about the phase change energy requirements. I must have been thinking more about fridges, and those are covered in the other PRs.
The bug seems to persist on ground level (level 0) of ice labs. The temperature there is consistently below freezing, yet food seems to rot.
I assume you are playing updated version after the fix. Do you have any tool on you like thermomether to actualy tell the temp? Level 0 is the aboveground part, in my test rig its temperature in summer was lower then normal but just above freezing. It is intended so I want to confirm if we have the same conditions. True below zero Celsius temperatures start at lvl -1. In other seasons temp at 0 lvl might also drop below zero and rot should stop. But it wont erase the accumulated rot in any way. If you confirm it under above then I'll do another round of tests. FYI I confirmed the prevoius bug and tested if the solution works, so if its still a thing that might be something else then what I just fixed.
Yes, I'm playing the newest version.
I do have a thermometer. In a test I just performed, the temperatures stayed below -9C (standard spring start). I have visually verified this by using the wait command and looking at the temperature as time passed.
My impression now is specifically this: as long as the temperature outside the lab is below freezing, no rot happens, but when the temperature outside climbs above 0C, food starts to rot, despite the temperature inside the lab being about -9C/-10C at the time. So, could you test when outside temperature is above 0C, but the temperature inside is below? It seems like the cooling effect of the lab is not taken into account in calculations at level 0.
Everything you said sounds like a correct behaviour. Every level of the ice lab has its own temperature overlay, and temperature drops as you go down. The least drastic change is at zero level where temperatures can actualy go above freezing and that is intended, it simulates that the outside world actualy heats up the lab a bit. If you walk away from the lab, and walk back on zero level while checking temperatures you should notice drop of temperature but it doesn't mean it must always drop below freezing.
Food rots on level 0 of an ice lab even though the temperature there is below freezing. This starts happening when this temperature is at about -9C. This is not as intended, or at least - not correct behavior. Specifically, food does not rot on ice lab level 0 because "temperatures can actualy go above freezing and that is intended", but because it starts rotting there when the temperature is -9C, which is below freezing.
Food rots on level 0 ice lab when the world temperature outside gets above freezing, even though the temperature where the food actually is (inside the lab, but on level 0) is very much below 0C.
To recap, it is possible to observe food rotting with negative temperatures on the thermometer. The effect of the lab's negative temperature overlay seems not to be taken into account on level 0. This is not the case of food rotting because at level 0 said overlay has weak effect; apparently the effect is not taken into the account at all, and this is not correct behavior.
You were right. Fixed. Thanks very much for testing and pointing it out.
Reopening as bug is returned after #24300.
It seems that currently (latest experimental 0.C-29061-g7a0abc6, Windows 64-bit, tiles) food on -1 level of an ice lab always rots three times slower than normal speed (despite the temperature being below freezing, which should stop spoilage). Food on level 0 rots exactly as fast food outside the lab - so interior's lower temperature is not taken into account. (Yes, this does mean that food on level -1 rots faster than on level 0, if the world temperature outside is below freezing.)
Thanks in advance for your continuing efforts to make temperature behave sanely!
Your assessment of the problem is correct @Asseverater , and it is because changes were reverted becouse of: #24300.
It's ok, as crashes are worse then leser bugs, and it seems that my approach was just partially solving the issue - I've tested it in an ice lab above and below ground and it worked in compiled version. I had no idea it can affect chargen, but i now believe that it might even affected my non-test game as I wasnt able to load the saved game for a moment.
I believe the problem in chargen is related to map generation itself, because in fix nr 1 and nr 2 I narrowed down the problem to two things: conversion of map coordinates between local/submap/global and pure fact that above-ground calculations used only weather temperatures, and not included map temperatures. Map temperatures are special overlays that can be used to code increased temperature of certain location (imagine volcano) or decrease it (ice lab).
My intuition tells me that i either messed up the conversion of coordinates (lower chance) or that somewhere along chargen process food is spawned, rot calcualtion takes place, but the map is not ready, so checks for the local map (not existing yet) temperatures might crash the game (higher chance). Or both... I hope its the latter, and that my approach was right from the beginning. Also worth noting: before i started changing the rot calcs, even with map temperature overlay's coded, there was an hard-coded 'hack' in the decay calculators, that simply switched off ice lab rot to zero, without checking the overlay temperature. This might be because this problem was observed before, and it was a temporary by-pass.
Well, the changes were not reverted; the behavior now is different than the one with the hack, previously. I figured I would tell you about it; I wasn't sure you realized. Anyway, disabling all rot in ice labs is almost completely correct in its effects. At level -1 and below rot can't happen anyway, and the only place that has variable effects is level 0 interior.
However, this is obviously not the "right" approach, and I greatly prefer yours which mirrors what actually happens, and is more future-proof. I keep my fingers crossed for the eventual introduction of more physics simulation, with food freezing, thawing, and other appropriate storage flags (https://github.com/CleverRaven/Cataclysm-DDA/issues/24145), energy flow simulation, insulation, phase change heat (I want to stash blocks of ice for the summer in my root cellar!), and maybe even realistic monster behavior in ice labs (how do they not freeze? for that matter, how doesn't my steel weapon shatter on impact? maybe it would be an incentive to use copper...). I can dream, right? :)
I can dream, right? :)
Just hope you know that we can't simulate everything.
Well, I don't require it to run in real time; I would graciously allow some slowdown once the map size gets bigger than a few lightyears across... :innocent:
Seriously, though, after the changes you are making, the next step in futureproofing/simulationism would probably require some sort of heat (not temperature) transfer model, or cleverly making it seem that it is what is being done, especially outside the reality bubble.
Meanwhile, though, just please make my icelab larder stop rotting. :wink:
I wouldn't want exact simulation, just analog close enough to lead to similar results in practical dimension. Most features of the game aren't even half advanced enough to benefit from meticulous simulation and the increase of requirements for questionable gain is not something I'd appreciate. Simple (relatively) temperature system good enough to properly deal with what game actually needs temperature for - like body temperature or food spoilage - is enough.
Not that some of the stuff @Asseverater mentions - like cold affecting all kinds of mobs, freezing or thawing - I wouldn't want to see in some form myself.
Yes, and snowbanks, and no more "walk off the stairs into lava", and perhaps a way to heat those ice labs with a huge fire... ;)
But just to be clear - I meant that all the food changes that @nexusmrsep is busy implementing are so good, that to make things substantially better would probably require a further, significant overhaul (as I don't see a way of getting them to work in line with real-life expectations without heat flow simulation), not that I demand it. I very much approve of the direction the changes are going.
Tl;dr - https://github.com/CleverRaven/Cataclysm-DDA/issues/24145 FTW!
Most helpful comment
Food rots on level 0 of an ice lab even though the temperature there is below freezing. This starts happening when this temperature is at about -9C. This is not as intended, or at least - not correct behavior. Specifically, food does not rot on ice lab level 0 because "temperatures can actualy go above freezing and that is intended", but because it starts rotting there when the temperature is -9C, which is below freezing.
Food rots on level 0 ice lab when the world temperature outside gets above freezing, even though the temperature where the food actually is (inside the lab, but on level 0) is very much below 0C.
To recap, it is possible to observe food rotting with negative temperatures on the thermometer. The effect of the lab's negative temperature overlay seems not to be taken into account on level 0. This is not the case of food rotting because at level 0 said overlay has weak effect; apparently the effect is not taken into the account at all, and this is not correct behavior.