3 Entire Crops Lost due to Drought?

Eische
Posts: 3836
Joined: Thu Oct 18, 2018 5:17 pm

Re: 3 Entire Crops Lost due to Drought?

Post by Eische »

This is a section from the Six Ashes Geo in question:

Code: Select all

<gt index="7"> <!--late summer to early autumn-->
                <crop name="WHEAT" incrementByOneRange="1" setRange="2-MAX" setTo="WITHERED"/>
                <crop name="OAT" incrementByOneRange="6" setRange="1" setTo="CUT"/>
                <crop name="BARLEY" incrementByOneRange="6" setRange="1" setTo="CUT"/>
                <crop name="CANOLA" incrementByOneRange="6" setRange="1" setTo="CUT"/>
                <crop name="MAIZE" incrementByOneRange="1-6"/>
                <crop name="SOYBEAN" incrementByOneRange="1-6"/>
                <crop name="SUNFLOWER" incrementByOneRange="5-6"/>
                <crop name="POTATO"    incrementByOneRange="4-6"/>
                <crop name="SUGARBEET" incrementByOneRange="4-6"/>
                <crop name="POPLAR" setRange="CUT" setTo="2" incrementByOneRange="1-MAX"/>
                <crop name="GRASS" incrementByOneRange="1-MAX" setRange="CUT"  setTo="2"/>
                <crop name="OILSEEDRADISH" incrementByOneRange="2-MAX"/>
                <!-- <crop name="WEED" /> -->
            </gt>
            <gt index="8"> <!--early autumn to mid autumn-->
                <crop name="WHEAT" incrementByOneRange="1" setRange="2-MAX" setTo="WITHERED"/>
                <crop name="OAT" incrementByOneRange="1" setRange="2-MAX" setTo="WITHERED"/>
                <crop name="BARLEY" incrementByOneRange="1" setRange="2-MAX" setTo="WITHERED"/>
                <crop name="CANOLA" incrementByOneRange="1" setRange="2-MAX" setTo="WITHERED"/>
                <crop name="MAIZE" incrementByOneRange="1-6" />
                <crop name="SOYBEAN" incrementByOneRange="5-6" />
                <crop name="SUNFLOWER" incrementByOneRange="6" />
                <crop name="POTATO"    incrementByOneRange="5-6" />
                <crop name="SUGARBEET" incrementByOneRange="5-6" />
                <crop name="OILSEEDRADISH" incrementByOneRange="1-MAX"/>
            </gt>
I'm not a full expert here, but I spent some time in the past to understand how geos work. My explanation would be the following:
- Range 1 is seeded/planted, range 2 is germinated (nothing is visible on the fields, yet.)
- in my past tests, the change from seeded to germinated does not need a growth/seasons transition. It happens over night if parameters like temperature are correct.

Keeping that in mind, the geo is set up wrongly:
- your crop seeded in first days of early autumn will germinate within early autumn (go to range 2)
- with transition from early to mid autumn, geo forces crop into the withered stage

Please correct me if I'm wrong. Maybe theSeb can shine some light on it.
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
theSeb
Posts: 1517
Joined: Tue Mar 07, 2017 8:16 pm

Re: 3 Entire Crops Lost due to Drought?

Post by theSeb »

You are close.

1 = germinated

Planted is a "hidden" state, so that geos do not try to manipulate it directly and to allow for the built-in germination system to work. It's not that hidden. One can see what it is if they read the code, but ... :D

You are right though that the Geo is not correct.

For example...

wheat planted in summer that germinates because soil temp is high (which it should be in the summer) will be at stage 1 in the late summer to autumn period. It will get incremented by 1 to 2. Then the set command which will work on 2-MAX will work on this wheat and immediately set it withered. One could correct it by changing the set range to setRange="3-MAX"


oat, barley and canola will also fail but in a different way. If you planted any of those 3 in late summer and they germinate then during late summer to early autumn they will all go immediately to "cut" , i.e. harvested
This I can understand the intention, I think, because it's what we used to do in Seasons 17 to show that you planted too early during the summer (too dry), but with Seasons19 I changed that approach to the patchy crop failure, since it's a bit more realistic and also less punishing on players.

This could be corrected by changing these 3 lines and removing the set commands

Code: Select all

   <crop name="OAT" incrementByOneRange="6" />
   <crop name="BARLEY" incrementByOneRange="6" />
   <crop name="CANOLA" incrementByOneRange="6" />
Eische
Posts: 3836
Joined: Thu Oct 18, 2018 5:17 pm

Re: 3 Entire Crops Lost due to Drought?

Post by Eische »

Thank you for the enlighting information and explaining it with examples!
That also solves/explains small weird behaviour I found during my tests.

I used this post as reference:
viewtopic.php?f=1014&t=157287
But as you explained now, the information for germinated stage is not correct in that guideline.
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
theSeb
Posts: 1517
Joined: Tue Mar 07, 2017 8:16 pm

Re: 3 Entire Crops Lost due to Drought?

Post by theSeb »

Unfortunately I cannot speak German so I don't get involved in that side of the forum.

What is important for Geo makers to realise is that there is a set order of operations and they can conflict with each other. It does not matter what order you put them into the xml file, because xml attributes do not have the concept of order. Of course I could have done something like growthCommand1, growthCommand2 and so forth, but I didn't because I had no requirement to and therefore there was no point in making the code more complex. I slightly regret that decision now, seeing a few of the issues in third party GEOs, but only very slightly.

Code: Select all

<crop name="BARLEY"  incrementByOneRange="6" incrementByRange="3-5" incrementBy="2" setRange="1" setTo="2"/>
is the same thing as

Code: Select all

<crop name="BARLEY" setRange="1" setTo="2" incrementByOneRange="6" incrementByRange="3-5" incrementBy="2" />
The growth code does not care what order you put them in the xml file. The order of operations is ALWAYS

1. incrementByOne
2. incrementBy
3. set

This means that it's possible, if one does not consider what they are doing, to have unintended consequences.

You will see in the line above that none of the results conflict with each other

result of incrementByOne = 6 will become 7
result of incrementByRange = 3 will become 5 , 4 will become 6, 5 will become 7. The 6 from this operation will not become 7 because incrementByOne has already done its thing since it gets done first
result of set = 1 will become 2

However, in this example:

Code: Select all

<crop name="BARLEY"  incrementByOneRange="2" incrementByRange="3-5" incrementBy="2" />
2 will become 5, which is probably not the intended effect. 2 will be incremented by 1 first to become 3. 3 will then be acted upon by incrementByRange (+2) to become 5.
tom1979
Posts: 112
Joined: Sun Jan 03, 2021 2:10 pm

Re: 3 Entire Crops Lost due to Drought?

Post by tom1979 »

Was it the Farming Agency version of Six Ashes by any chance?
dogwalker1
Posts: 95
Joined: Sun Jan 10, 2021 10:21 pm

Re: 3 Entire Crops Lost due to Drought?

Post by dogwalker1 »

tom1979 wrote: Tue May 25, 2021 6:13 pm Was it the Farming Agency version of Six Ashes by any chance?
I don't believe so... just the one on the in-game Modhub.
tom1979
Posts: 112
Joined: Sun Jan 03, 2021 2:10 pm

Re: 3 Entire Crops Lost due to Drought?

Post by tom1979 »

dogwalker1 wrote: Tue May 25, 2021 6:30 pm
tom1979 wrote: Tue May 25, 2021 6:13 pm Was it the Farming Agency version of Six Ashes by any chance?
I don't believe so... just the one on the in-game Modhub.
The Farming Agency maps tend to have the Geo built into them. I had similar problems with Six Ashes until I realised this
Post Reply