While trying to improve the intelligibility of the Survival game mode, we decided to add a thermometer to the game HUD. We wanted to show in-game thermal condition attributes in some understandable way and the thermometer seemed to be very understandable. However, we do not have such an attribute as ambient temperature. Instead, biomes "attacks" your low/high temperature resistance attributes and this attack is further modified by current weather type. As a consequence of decreased resistence, your general health starts to decrease and you eventually die. How simple.
We decided to use the value of that thermal attack as an input and compute corresponding temperature from it. When we tried to find a mapping between this "effective damage caused by temperature" and the real temperature reading we kind of spinned in a circle. At the end it turned out that we have those values wrongly set, not errorneously measured. It showed drops to -20 degree of celsius on desert when it started to rain, temperature changes of 30 degrees while travelled few seconds by feet etc.
We had to revisit our tools for setting weather generation to see where errors emerged and why it is constantly raining for example.
You must understand that we are making a game, not a weather simulator, so calculating spatial temparature, humidity, air flow and other characteristics at global planetary scale and trying to select appropriate weather type according to that data is out of our scope. Our approach is reversed instead. We start with which biome we are in and than select from list of possible weather in this biome prepared by game designer.
Also to have defined probabilities of translation between each of weather types is important. If we had for example 3 weather types, say clear weather, light rain and heavy rain, we would have 67% probability of rain at all. This is not desired as well as sudden change from clear sky to a heavy rain. On top of this we want clear weather to last much longer than dangerous storms. So now we have multiple weather types with different probability of translation and different minimal and maximal durations.
But this set of values is very unintuitive from designer's point of view. Designer needs immediatelly (not after few horus of playing the game) to see effects of changes he made. In the sense of the total time of occurence of each weather by the game time. For this purpose we have created a tool that simulates weather transitions and measures the proportion of each weather type in time (shown on top, click to enlarge).
Speaking about temperature, we have set fixed limits of -100 and +100 °C. We divided this scale by 10°C and assigned a time for how long your temperature shield should resist for each temperature. From this time we can calculate desired value - attribute change per second. There are also a different attribute regenerations for each temperature, so in warmer weather your antifreeze protection regenerates slowly while your overheat protection is decreasing. This is to solve the problem of freezing and overheating at the same time. We set values for the basic suit and they are then modified by different coefficients for each armor tier.
All those discrete values are then interpolated by simple curves and those curves are used by the designer to see if he did not make some unnatural changes on the one hand and by the game engine to calculate correct attribute changes on the other hand. You can see our "desing tool" in the next picture.
For each weather and biome we need to set up "attack" and "regeneration" values for each attribute. There is a default value for each biome and different weather types modifies this value. For example Arctic biome is cold by default. If it's snowing, cold increases, but if it's raining it will probably heat you a little bit. In contrary, Forest biome has pleasant temperature but rain will cool you instead of warming.
During the temperature and weather overhaul we have added new input boxes to our "weather master sheet" for different day and night temperatures. This enables us to create different temperature changes for each biome and so you will no longer tend to die of overheat and thirst in the desert at night. Cold is also much bigger at polar areas during the nighttime. You can see the sheet in the next picture.
We still need to tune up the values a little bit and fix some issues before we add the thermometer into the game release. But mentioned changes helped us already to get rid of some weather related survival nonsenses. I hope I will not reveal any secrets when I tell you that we are currently evaulating the new ways to fight the weather including the brand new heater/cooler block.