Page 1 of 1
Conditions of ground condition changes?
Posted: 2023-04-11 17:43, Tuesday
by none
Could somebody please refresh my memory, once it has snowed and the ground is "frozen", how long will it last, and what does thaw depend on? An amount of "clear" days? How many actually? Is there anything else affecting it? Can I prevent it somehow?
The "weather.txt" comments only mention probabilities of rain/snow, I didn't find anything about ground conditions.
I remember Luis having explained it back in the old forum, but that information is now gone.
Re: Conditions of ground condition changes?
Posted: 2023-04-12 16:31, Wednesday
by LuisGuzman
none wrote: ↑2023-04-11 17:43, Tuesday
Could somebody please refresh my memory, once it has snowed and the ground is "frozen", how long will it last, and what does thaw depend on? An amount of "clear" days? How many actually? Is there anything else affecting it? Can I prevent it somehow?
The "weather.txt" comments only mention probabilities of rain/snow, I didn't find anything about ground conditions.
I remember Luis having explained it back in the old forum, but that information is now gone.
It is difficult for me to explain properly, so I hope than any one can understand this pseudo-code...
Notes:
* When scenario option "Weather can change ground condition" is set, the game tracks the ground wet level to decide if ground condition changes.
Two vars are used for that;
1.- scen.groundWet
2.- scen.groundCond
* If weather changes in a turn, the engine waits for next turn to increase/decrease scen.groundWet and eventually scen.groundCond
Code: Select all
wet = scen.groundWet; // current scen.groundWet before changing
ground = scen.groundCond; // current scen.groundCond before changing
WET_LOW = 0, //when 0, terrain gets more dry (dry > mud > froz)
WET_DEF = 2, //default at start of scenario
WET_HIGH = 4 //when 4 terrain gets less wet (froz > mud > dry)
GND_DRY = 0, // dry ground
GND_FROZ = 1, // frozen ground
GND_MUD = 2 // mud ground
//First checks if ground wet changes
//
if (weather is rain or snow) // if any precipitation
{
if (wet < WET_HIGH) // scen.groundWet cannot be more than WET_HIGH
scen.groundWet ++; //increase level
}
else // there is no precipitation
if (wet > WET_LOW)
scen.groundWet--; //decrease level
// Then checks ground condition
//
if (wet != scen.groundWet) // wet changed, so can change scen.groundCond
{
wet = scen.groundWet; // uptate to new wet level
if (gndWet == WET_LOW) // change in sequence: froz > mud > dry
{
if (ground == GND_FROZ)
{
scen.groundCond = GND_MUD;
}
else if (ground == GND_MUD)
{
scen.groundCond = GND_DRY;
}
}
if (gndWet == WET_HIGH) // change in sequence: dry >mud > froz
{
if (ground == GND_DRY and is raining) // raining change always to MUD ?
{
scen.groundCond = GND_MUD;
}
else
if (ground != GND_FROZ and (is raining or snowing)) // if not frozen and any precipitation
{
scen.groundCond = GND_FROZ;
}
}
// if scen.groundCond changed, reset scen.groundWet
if (ground != scen.groundCond)
{
scen.groundWet = WET_DEF;
}
Re: Conditions of ground condition changes?
Posted: 2023-04-12 18:02, Wednesday
by none
Thanks, yes, it's pretty understandable.
Unfortunately it means that I would need to have it snow regularly to keep the ground frozen, and it's impossible since there is a limit on weather zones (already winter in "Continental Russia", the coldest zone).
I'm trying to keep the whole scenario in snow-covered ground. Not only because it feels silly to have a white snowy map with "dry" ground, but also because it's winter in northern Russia, and even if it isn't snowing, thaw shouldn't come for months.
A pity there is no way to influence weather -- both ways BTW, since bad luck with weather can ruin any scenario. Something like being able to fix a minimum amount of clear or snowy days during the scenario's duration. Oh well.
Re: Conditions of ground condition changes?
Posted: 2023-04-12 18:52, Wednesday
by LuisGuzman
none wrote: ↑2023-04-12 18:02, Wednesday
I'm trying to keep the whole scenario in snow-covered ground. Not only because it feels silly to have a white snowy map with "dry" ground, but also because it's winter in northern Russia, and even if it isn't snowing, thaw shouldn't come for months.
A pity there is no way to influence weather -- both ways BTW, since bad luck with weather can ruin any scenario. Something like being able to fix a minimum amount of clear or snowy days during the scenario's duration. Oh well.
But you could remove the option "Weather can change ground condition" and set the ground condition to frozen for that scenario ?
Re: Conditions of ground condition changes?
Posted: 2023-04-13 07:59, Thursday
by none
I can do that for just one scenario? Oh great, thank you!
I do remember all these settings, but never remember if they E-File, campaign or scenario-level...