[FS22]Changing the weather settings in the enviroment

Your forum for all discussions around Modding.
haker146
Posts: 7
Joined: Fri Jun 10, 2022 11:32 am

[FS22]Changing the weather settings in the enviroment

Post 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?
User avatar
drewCZ
Posts: 50
Joined: Thu Jul 16, 2015 12:01 pm
Location: Earth, Europe, Czechia

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

Post 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
Ticho aka DrewCZ
FS2013 24/7 dedisrv 'Posledni JZD', MRmods | down 2016=R.I.P.
FS15 | more than a year of pain
FS17 dedi srv, multiplayer+MR !Forever! | Thanks old pal, but moved to 19
FS19 Seasons+GEO+VCA+REA+Cam+Mass+MaizePlus | 6th ingame Year | we are still WORKS in MP!
FS22 - MP moved! Real map+Industries+Relight, Hard Level, Definitely profitable w/ modern machinery
haker146
Posts: 7
Joined: Fri Jun 10, 2022 11:32 am

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

Post 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
User avatar
drewCZ
Posts: 50
Joined: Thu Jul 16, 2015 12:01 pm
Location: Earth, Europe, Czechia

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

Post 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 ...
Ticho aka DrewCZ
FS2013 24/7 dedisrv 'Posledni JZD', MRmods | down 2016=R.I.P.
FS15 | more than a year of pain
FS17 dedi srv, multiplayer+MR !Forever! | Thanks old pal, but moved to 19
FS19 Seasons+GEO+VCA+REA+Cam+Mass+MaizePlus | 6th ingame Year | we are still WORKS in MP!
FS22 - MP moved! Real map+Industries+Relight, Hard Level, Definitely profitable w/ modern machinery
Frag
Posts: 173
Joined: Wed Sep 18, 2019 4:01 pm

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

Post 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?
Eische
Posts: 3773
Joined: Thu Oct 18, 2018 5:17 pm

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

Post 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.
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
User avatar
drewCZ
Posts: 50
Joined: Thu Jul 16, 2015 12:01 pm
Location: Earth, Europe, Czechia

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

Post 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.
Ticho aka DrewCZ
FS2013 24/7 dedisrv 'Posledni JZD', MRmods | down 2016=R.I.P.
FS15 | more than a year of pain
FS17 dedi srv, multiplayer+MR !Forever! | Thanks old pal, but moved to 19
FS19 Seasons+GEO+VCA+REA+Cam+Mass+MaizePlus | 6th ingame Year | we are still WORKS in MP!
FS22 - MP moved! Real map+Industries+Relight, Hard Level, Definitely profitable w/ modern machinery
Frag
Posts: 173
Joined: Wed Sep 18, 2019 4:01 pm

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

Post 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>
Eische
Posts: 3773
Joined: Thu Oct 18, 2018 5:17 pm

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

Post 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.
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
User avatar
drewCZ
Posts: 50
Joined: Thu Jul 16, 2015 12:01 pm
Location: Earth, Europe, Czechia

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

Post 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...
Ticho aka DrewCZ
FS2013 24/7 dedisrv 'Posledni JZD', MRmods | down 2016=R.I.P.
FS15 | more than a year of pain
FS17 dedi srv, multiplayer+MR !Forever! | Thanks old pal, but moved to 19
FS19 Seasons+GEO+VCA+REA+Cam+Mass+MaizePlus | 6th ingame Year | we are still WORKS in MP!
FS22 - MP moved! Real map+Industries+Relight, Hard Level, Definitely profitable w/ modern machinery
Frag
Posts: 173
Joined: Wed Sep 18, 2019 4:01 pm

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

Post by Frag »

Ok thanks guys. This is super clear now. I will come back here if I have other conclusions Thanks for the help!
Post Reply