Freezing while raining.
anachronistically opened this issue · 5 comments
While using the latest version of the mod (b2.1-1) I noticed that it is possible, in certain biomes, to be raining while the temperature is bellow the freezing point.
Example: In a superflat world with only the taiga biome, at height Y=61, if running /time set midnight
and /weather rain
it will start raining and the displayed temperature will be -6ºC/20ºF.
This is not necessarily a bug, but I think it is a little bit off-putting that this can happen.
So I am requesting a feature that prevents this behavior.
I see two possible ways to stop this from happening:
- Prevent the temperature from dropping bellow the freezing point in biomes were it cannot snow.
- Actually changing the precipitation to snow during the time of the day that the temperature is bellow the freezing point.
I see. This is a very good point. We'll have to do some serious talks about how to rework the system to fix this, since I think putting a lower cap on temperature would curb the difficulty a little too much in some biomes, but I also don't think we should be messing with biome properties like that, for the sake of consistency (since the only way to make it snow is to lower the biome temperature) and compatibility (since messing with biomes might mess up other mods that affect biomes, i.e. Serene Seasons).
I also thought that the second suggestion might cause other issues as you pointed out so I guess that one should just be forgotten.
As for the first one, I personally would not mind simply having a lower cap on non snowy biomes since it is their nature to not have freezing temperatures. (And maybe add an upper cap to snowy biomes, although I do not think it is currently possible to have the opposite [above freezing temperatures while it is snowing] due to the weather temperature modifier)
To avoid curbing the difficulty of those biomes (I think you mean in terms of reducing their diurnal temperature variation), maybe instead of mapping the biome temperature to the base temperature and then subtract down to 6ºC/10ºF to get the minimum (midnight) temperature and add up to 6ºC/10ºF to get the maximum (noon), you could map it to the minimum temperature and then add up to 6ºC/10ºF for the base and up to 12ºC/20ºF for the maximum and do the opposite in snowy biomes (biome temperature -> maximum; base = maximum -6ºC/-10ºF; minimum = maximum -12ºC/-20ºF).
This would ensure that non snowy biomes would never have freezing temperatures (assuming: minimum temperature - weather temperature modifier >= freezing point) and snowy biomes would never have above freezing temperatures.
I see two issues with this approach:
- Now there would be a very big temperature drop when going from a non snowy biome to a snowy one (but I guess at least that makes sense?).
- The mapping would have to be adjusted (since every snowy biome would now be 6ºC/10ºF colder on average and every non snowy one would be 6ºC/10ºF hotter on average and that would definitely mess up biome balance).
Hmm.. I'm not quite sure what you mean with the new function of calculating temperature. Biome temperature is a fixed number assigned to all biomes. The maximum and minimum temperatures are not taken into account for these calculations. I'll give you what the mod currently uses to clarify things:
<biome's temperature>
with the biome's temperature
cos((<game time in ticks> / 3819.7186342) - 1.5707963268) / 4 - 0.1
Then add this function for the day/night cycle. 3819... is the exact number for one cycle to happen every 24000 ticks (one day), and 1.5... offsets this by the correct amount noon (6000) is the highest point of the cosine wave and midnight (18000) is the lowest. The 24000 tick cycle instantly wraps back around to 0 when the next day begins.
-0.25 (if snowing), or -0.15 (if raining)
Then add either -0.25 or -0.15 if it is raining/snowing on the player's position
Finally, we multiply it all by 42, then add 32 (for Fahrenheit), or multiply by 22.3 and add 17.7 (for Celsius)
There are other functions for the player's depth, nearby blocks, hearth, etc; but they aren't important in this case.
So, the full formula:
((biome temperature + cos((<game time in ticks> / 3819.7186342) / 4 - 0.1) - 0.25 or 0.15) * 42 + 32
(Fahrenheit)
((biome temperature + cos((<game time in ticks> / 3819.7186342) / 4 - 0.1) - 0.25 or 0.15) * 23.3 + 17.7
(Celsius)
This obviously isn't hardcoded into the game; it's spread over multiple TemperatureModifiers, as you mentioned, that are applied to the player.
I think the best (and easiest) thing to change would be the very last step, where it converts Minecraft units into real units of temperature. The numbers given are completely arbitrary; they just looked good from our testing.
In the next update, water will cool down the player when standing in it. It starts at a minimum of -10F, and gets lower depending on how cold the ambient temperature is.
Just a notice, couldn't the formula for the day/night cycle be simplified by switching cosine with sine?
I just graphed these two functions and they have the same graph:
cos((x / 3819.7186342) - 1.5707963268)
& sin(x / 3819.7186342)
I meant changing the day/night formula depending on the biome:
(cos((<game time in ticks> / 3819.7186342) - 1.5707963268) / 4 - 0.1) + Y or - Y (if non-snowy or snowy biome respectively)
where Y is the amount in minecraft temperature units equivalent to 6ºC/10ºF.
But, to be honest, now I do not think this is an issue anymore since "temperature" in the context of this mod seems to be more of a "feels like temperature" instead of actually assigning a logic temperature to the block where the player is (which is perfectly fine) because, like the feature of the next update, water does not always have to be colder than the air (where I live, for example, it is usually 3-4ºC colder than the air during the day and 6-7ºC hotter than the air at night during wintertime), it will usually just feel colder because it conduces heat away from the body faster. Maybe change, in the wiki, "temperature" to "temperature felt" just to clarify?
So I think you should decide if you consider this an issue or not, so feel free to close this.
I guess you could call it a "feels like" temperature, especially with water. In real life, 15 ºC air is a bit cold, at least where I am, but 15 ºC water could be deadly if you jump into it or something. We wanted to align the temperature gauge with this kind of logic, since having temperature affect the player differently in certain circumstances makes for pretty unintuitive gameplay.
Thanks for your suggestions and comments, and I'll make sure to switch cos to sin ;)