Page 1 of 1

[FS22]Changing the weather settings in the enviroment

Posted: Tue Jun 14, 2022 11:59 pm
by haker146
Hey, I'm working on changing the weather conditions more closely related to the weather history of my area. I know that the weather conditions and the angles of sunlight in each season can be edited through the enviroment file.
The latitude can be changed by editing <latitude> 40.6 </latitude>.
Which affects the length of the shadows and the change in the position of the sun in each season. However, I have questions about the weather change.
I analyzed the file and I can see that there are cloud presets which are then used to define the weather. However, I don't quite understand all the code. Example for spring:

Code: Select all

<season name="spring">
            <object typeName="SUN" class="WeatherObject" weight="8">
                <variation weight="1" minHours="6" maxHours="12" minTemperature="14" maxTemperature="18">
                    <clouds presetId="SUNNY_BLUE_SKY" />
                    <wind angle="194" speed="4" cirrusSpeedFactor="0.80" />
                </variation>

                <variation weight="1" minHours="6" maxHours="12" minTemperature="12" maxTemperature="17">
                    <clouds presetId="SUNNY_LIGHT_CLOUDS_1" />
                    <wind angle="218" speed="8" cirrusSpeedFactor="0.80" />
                </variation>

                <variation weight="1" minHours="8" maxHours="12" minTemperature="11" maxTemperature="16">
                    <clouds presetId="SUNNY_LIGHT_CLOUDS_2" />
                    <wind angle="227" speed="10" cirrusSpeedFactor="0.80" />
                </variation>                
                
                <variation weight="1" minHours="8" maxHours="12" minTemperature="10" maxTemperature="15">
                    <clouds presetId="SUNNY_LIGHT_CLOUDS_3" />
                    <wind angle="172" speed="13" cirrusSpeedFactor="0.80" />
                </variation>
            </object>        
        
            <object typeName="CLOUDY" class="WeatherObject" weight="8">
                <variation weight="1" minHours="5" maxHours="10" minTemperature="11" maxTemperature="16">
                    <clouds presetId="CLOUDY_LIGHT" />
                    <wind angle="274" speed="17" cirrusSpeedFactor="0.80" />
                </variation>

                <variation weight="1" minHours="5" maxHours="10" minTemperature="10" maxTemperature="15">
                    <clouds presetId="CLOUDY" />
                    <wind angle="294" speed="21" cirrusSpeedFactor="0.80" />
                </variation>

                <variation weight="1" minHours="5" maxHours="10" minTemperature="9" maxTemperature="14">
                    <clouds presetId="CLOUDY_MEDIUM" />
                    <wind angle="333" speed="24" cirrusSpeedFactor="0.80" />
                </variation>                
                
                <variation weight="1" minHours="5" maxHours="10" minTemperature="8" maxTemperature="13">
                    <clouds presetId="CLOUDY_DENSE" />
                    <wind angle="316" speed="28" cirrusSpeedFactor="0.80" />
                </variation>
            </object>

            <object typeName="RAIN" class="WeatherObjectRain" weight="4">
                <rain filename="$data/sky/rain.i3d" />

                <variation weight="1" minHours="1" maxHours="3" minTemperature="9" maxTemperature="15">
                    <clouds presetId="RAIN_1" />
                    <rain dropScale="0.5" />
                    <wind angle="2" speed="38" cirrusSpeedFactor="0.80" />
                </variation>
                
                <variation weight="1" minHours="1" maxHours="3" minTemperature="8" maxTemperature="14">
                    <clouds presetId="RAIN_2" />
                    <rain dropScale="0.8" />
                    <wind angle="23" speed="44" cirrusSpeedFactor="0.80" />
                </variation>
                
                <variation weight="1" minHours="1" maxHours="3" minTemperature="7" maxTemperature="13">
                    <clouds presetId="RAIN_3" />
                    <rain dropScale="1" />
                    <wind angle="47" speed="57" cirrusSpeedFactor="0.80" />
                </variation>  
                
                <variation weight="1" minHours="1" maxHours="3" minTemperature="6" maxTemperature="12">
                    <clouds presetId="RAIN_4" />
                    <rain dropScale="1" />
                    <wind angle="72" speed="68" cirrusSpeedFactor="0.80" />
                </variation>
            </object>
        </season>

The probability of clouds, rain and sun is defined there.
I wonder what the next values ​​mean:
-> weight (I understand that this value represents the probability of a given variaton. The higher the weight value, the greater the probability?)
-> minHours and maxHours - do I understand correctly that this is the minimum and maximum number of hours a given variation can last?

Re: [FS22]Changing the weather settings in the enviroment

Posted: Mon Jun 27, 2022 11:17 am
by drewCZ
haker146 wrote: Tue Jun 14, 2022 11:59 pm ....
I wonder what the next values ​​mean:
-> weight (I understand that this value represents the probability of a given variaton. The higher the weight value, the greater the probability?)
-> minHours and maxHours - do I understand correctly that this is the minimum and maximum number of hours a given variation can last?
Hello, exactly ;-)
Weight is compared between each variation inside the object, and whole objects are also compared.
minHours and maxHours are self-explanatory.
Example: I'm working with 90 days model = each ingame month has 3 days, period have 3 months = calculation for 90 days per period.
when data says 38 sunny days and 44 rainy, I set weights: SUN = 38; RAIN = 44; CLOUDY = 8 (90-38-44=8)
inside the object, I'm compare variation weights up to object weight:
inside SUN (38) and I "must-have" 10 days absolutely clear and generally weather inclines to clear:
SUNNY_BLUE_SKY = 10
SUNNY_LIGHT_CLOUDS_1 = 14
SUNNY_LIGHT_CLOUDS_2 = 9
SUNNY_LIGHT_CLOUDS_3 = 5

This is my model and I hope it works :)
Please let me know what you think about this model or what you use in weather settings.
Cheers

Re: [FS22]Changing the weather settings in the enviroment

Posted: Fri Sep 23, 2022 9:39 pm
by haker146
Hey;) Sorry, I haven't visited this forum for a long time, recently working on a realistic weather mod. I would like this model to be made in the same way as it was done for the Season mod in FS19

Re: [FS22]Changing the weather settings in the enviroment

Posted: Thu Sep 29, 2022 6:43 pm
by drewCZ
Yes, me too, unfortunately, no, it's not :-/ Also resigned to the model of soil moisture, grazing animals, etc... In general, not a step forward, but a step next to "wide community arms".
Now I'm waiting for fix lags in multiplayer, so FS22 is frozen for me and we are playing FS19 ...

Re: [FS22]Changing the weather settings in the enviroment

Posted: Wed Apr 12, 2023 2:38 pm
by Frag
drewCZ wrote: Mon Jun 27, 2022 11:17 am
haker146 wrote: Tue Jun 14, 2022 11:59 pm ....
I wonder what the next values ​​mean:
-> weight (I understand that this value represents the probability of a given variaton. The higher the weight value, the greater the probability?)
-> minHours and maxHours - do I understand correctly that this is the minimum and maximum number of hours a given variation can last?
Hello, exactly ;-)
Weight is compared between each variation inside the object, and whole objects are also compared.
minHours and maxHours are self-explanatory.
Example: I'm working with 90 days model = each ingame month has 3 days, period have 3 months = calculation for 90 days per period.
when data says 38 sunny days and 44 rainy, I set weights: SUN = 38; RAIN = 44; CLOUDY = 8 (90-38-44=8)
inside the object, I'm compare variation weights up to object weight:
inside SUN (38) and I "must-have" 10 days absolutely clear and generally weather inclines to clear:
SUNNY_BLUE_SKY = 10
SUNNY_LIGHT_CLOUDS_1 = 14
SUNNY_LIGHT_CLOUDS_2 = 9
SUNNY_LIGHT_CLOUDS_3 = 5

This is my model and I hope it works :)
Please let me know what you think about this model or what you use in weather settings.
Cheers
Hi drewCZ,

there is something I am trying to figure out in your weight. If you have 3 days per month, it would mean that you have 36 days per year (3 days x 12 months = 36 days. So I am really puzzled where you do get the 90 days from? Am I missing something?

Re: [FS22]Changing the weather settings in the enviroment

Posted: Wed Apr 12, 2023 4:45 pm
by Eische
Frag wrote: Wed Apr 12, 2023 2:38 pm
Hi drewCZ,

there is something I am trying to figure out in your weight. If you have 3 days per month, it would mean that you have 36 days per year (3 days x 12 months = 36 days. So I am really puzzled where you do get the 90 days from? Am I missing something?
Most likely he meant 30 days per month. Which equals 90 days per period (3 months).

But that does not matter for the weights. You don't have to use your total number of days. How would this setup work for people playing the same map only using 1 day per month?

You can simply interprete them as fractions or maybe percentages. They are not defining on how many exact days it will be sunny. They are just defining a weight for the random weather generator where higher weights mean more likely to happen.

Re: [FS22]Changing the weather settings in the enviroment

Posted: Wed Apr 12, 2023 5:47 pm
by drewCZ
Yep. @eische is right. Fraction is best word for describe the weight. Each weight is compared within object with other weights and based on values randomized weather is generated.
Not percentage, because sum of weights is not equal to 100.

Re: [FS22]Changing the weather settings in the enviroment

Posted: Fri Apr 14, 2023 3:51 pm
by Frag
drewCZ wrote: Wed Apr 12, 2023 5:47 pm Yep. @eische is right. Fraction is best word for describe the weight. Each weight is compared within object with other weights and based on values randomized weather is generated.
Not percentage, because sum of weights is not equal to 100.
Ok get it. So you do mean that I could use a percentage if I want. Let's say for example that I would want the "RAIN" setup to happen 25% of the time, cloudy 25% of the time and sunny 50% of the time ... I could set it up this way.

Also within the rain section, there are 4 subtypes of weather. I can also set the percentage there also (in the following example, 70%,10%,10%,10%)

<season name="spring">
<object typeName="SUN" class="WeatherObject" weight="50">
<variation weight="1" minHours="6" maxHours="12" minTemperature="14" maxTemperature="18">
<clouds presetId="SUNNY_BLUE_SKY" />
<wind angle="194" speed="4" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="1" minHours="6" maxHours="12" minTemperature="12" maxTemperature="17">
<clouds presetId="SUNNY_LIGHT_CLOUDS_1" />
<wind angle="218" speed="8" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="1" minHours="8" maxHours="12" minTemperature="11" maxTemperature="16">
<clouds presetId="SUNNY_LIGHT_CLOUDS_2" />
<wind angle="227" speed="10" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="1" minHours="8" maxHours="12" minTemperature="10" maxTemperature="15">
<clouds presetId="SUNNY_LIGHT_CLOUDS_3" />
<wind angle="172" speed="13" cirrusSpeedFactor="0.80" />
</variation>
</object>

<object typeName="CLOUDY" class="WeatherObject" weight="25">
<variation weight="1" minHours="5" maxHours="10" minTemperature="11" maxTemperature="16">
<clouds presetId="CLOUDY_LIGHT" />
<wind angle="274" speed="17" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="1" minHours="5" maxHours="10" minTemperature="10" maxTemperature="15">
<clouds presetId="CLOUDY" />
<wind angle="294" speed="21" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="1" minHours="5" maxHours="10" minTemperature="9" maxTemperature="14">
<clouds presetId="CLOUDY_MEDIUM" />
<wind angle="333" speed="24" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="1" minHours="5" maxHours="10" minTemperature="8" maxTemperature="13">
<clouds presetId="CLOUDY_DENSE" />
<wind angle="316" speed="28" cirrusSpeedFactor="0.80" />
</variation>
</object>

<object typeName="RAIN" class="WeatherObjectRain" weight="25">
<rain filename="$data/sky/rain.i3d" />

<variation weight="70" minHours="1" maxHours="3" minTemperature="9" maxTemperature="15">
<clouds presetId="RAIN_1" />
<rain dropScale="0.5" />
<wind angle="2" speed="38" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="10" minHours="1" maxHours="3" minTemperature="8" maxTemperature="14">
<clouds presetId="RAIN_2" />
<rain dropScale="0.8" />
<wind angle="23" speed="44" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="10" minHours="1" maxHours="3" minTemperature="7" maxTemperature="13">
<clouds presetId="RAIN_3" />
<rain dropScale="1" />
<wind angle="47" speed="57" cirrusSpeedFactor="0.80" />
</variation>

<variation weight="10" minHours="1" maxHours="3" minTemperature="6" maxTemperature="12">
<clouds presetId="RAIN_4" />
<rain dropScale="1" />
<wind angle="72" speed="68" cirrusSpeedFactor="0.80" />
</variation>
</object>
</season>

Re: [FS22]Changing the weather settings in the enviroment

Posted: Fri Apr 14, 2023 5:51 pm
by Eische
Yes, exactly.
For the rain variations you can as well just use 7, 1, 1, 1 instead of 70, 10, 10, 10. It will have the same effect.

But you have to keep in mind that those are only probabilities , no fixed values. So there is no guaranty for 50% sunny, 25% cloudy and 25% rainy weather.
That's just the nature of random mechanics.

Re: [FS22]Changing the weather settings in the enviroment

Posted: Fri Apr 14, 2023 5:57 pm
by drewCZ
yes, great work :-)
good help when tuning is that mod for the console, where you can turn on debug screen and observe how the environment is changing. and reload environment.xls etc etc...

Re: [FS22]Changing the weather settings in the enviroment

Posted: Fri Apr 14, 2023 6:00 pm
by Frag
Ok thanks guys. This is super clear now. I will come back here if I have other conclusions Thanks for the help!