How "weight" works in the envrionment.xml file

Your forum for all discussions around Modding.
Frag
Posts: 173
Joined: Wed Sep 18, 2019 4:01 pm

How "weight" works in the envrionment.xml file

Post by Frag »

Hi guys,

any of you understand clearly how the weight variable works in the environment.xml file?

Here is the "winter" section of the yukon valley environment.xml file as an example.

There is weight here and there and I am really not sure how it operates. I feel that the weight play something in the random throw for selecting the daily weather, but it is really shady to me. In many maps, I saw it varying from 1 all the way up to 95. I would really like to understand clearly how this value is used by the application.

Please enlighten me if you figured this one out!


Code: Select all

<season name="winter">
            <object typeName="SUN" class="WeatherObject" weight="4">
                <variation weight="1" minHours="6" maxHours="12" minTemperature="-10" maxTemperature="0">
                    <clouds presetId="SUNNY_BLUE_SKY" />
                    <wind angle="174" speed="4" cirrusSpeedFactor="0.80" />
                </variation>

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

                <variation weight="1" minHours="8" maxHours="12" minTemperature="-13" maxTemperature="-1">
                    <clouds presetId="SUNNY_LIGHT_CLOUDS_2" />
                    <wind angle="207" speed="10" cirrusSpeedFactor="0.80" />
                </variation>                
                
                <variation weight="1" minHours="8" maxHours="12" minTemperature="-14" maxTemperature="-2">
                    <clouds presetId="SUNNY_LIGHT_CLOUDS_3" />
                    <wind angle="142" speed="13" cirrusSpeedFactor="0.80" />
                </variation>
            </object>    
            
            <object typeName="CLOUDY" class="WeatherObject" weight="7">
                <variation weight="1" minHours="5" maxHours="10" minTemperature="-15" maxTemperature="-3">
                    <clouds presetId="CLOUDY_LIGHT" />
                    <wind angle="224" speed="17" cirrusSpeedFactor="0.80" />
                </variation>

                <variation weight="1" minHours="5" maxHours="10" minTemperature="-16" maxTemperature="-4">
                    <clouds presetId="CLOUDY" />
                    <wind angle="274" speed="21" cirrusSpeedFactor="0.80" />
                </variation>
                
                <variation weight="1" minHours="5" maxHours="10" minTemperature="-16" maxTemperature="-5">
                    <clouds presetId="CLOUDY_MEDIUM" />
                    <wind angle="304" speed="24" cirrusSpeedFactor="0.80" />
                </variation>     
                
                <variation weight="1" minHours="5" maxHours="10" minTemperature="-16" maxTemperature="-6">
                    <clouds presetId="CLOUDY_DENSE" />
                    <wind angle="306" speed="28" cirrusSpeedFactor="0.80" />
                </variation>
            </object>

            <object typeName="SNOW" class="WeatherObjectRain" weight="12">
                <rain filename="$data/sky/snow.i3d" />
                
                <variation weight="1" minHours="4" maxHours="8" minTemperature="-16" maxTemperature="-4">
                    <clouds presetId="RAIN_1" />
                    <rain dropScale="0.5" />
                    <wind angle="24" speed="8" cirrusSpeedFactor="0.80" />
                </variation>
                
                <variation weight="1" minHours="4" maxHours="8" minTemperature="-17" maxTemperature="-5">
                    <clouds presetId="RAIN_2" />
                    <rain dropScale="0.8" />
                    <wind angle="357" speed="18" cirrusSpeedFactor="0.80" />
                </variation>
                
                <variation weight="1" minHours="4" maxHours="8" minTemperature="-17" maxTemperature="-6">
                    <clouds presetId="RAIN_3" />
                    <rain dropScale="1" />
                    <wind angle="57" speed="37" cirrusSpeedFactor="0.80" />
                </variation>

                 <variation weight="1" minHours="1" maxHours="3" minTemperature="-18" maxTemperature="-7">
                    <clouds presetId="RAIN_4" />
                    <rain dropScale="1" />
                    <wind angle="72" speed="68" cirrusSpeedFactor="0.80" />
                </variation>    
                
            </object>        
        </season>
Frag
Posts: 173
Joined: Wed Sep 18, 2019 4:01 pm

Re: How "weight" works in the envrionment.xml file

Post by Frag »

Guys I am coming back with this. If someone understood how the weight works, it would be awesome.
User avatar
drewCZ
Posts: 50
Joined: Thu Jul 16, 2015 12:01 pm
Location: Earth, Europe, Czechia

Re: How "weight" works in the envrionment.xml file

Post by drewCZ »

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
Post Reply