News:

Welcome to World of Banished!

Main Menu

Orchards and tree life

Started by Pangaea, September 20, 2014, 06:57:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pangaea

After a moan about orchards I have had a serious look into them. I've run a 20 year experiment to observe when they die and what they yield. Created a new village and instantly set up a 15x4 orchard grove, which results in 16 trees (no mods btw). Below is the most relevant code. It's the same for all orchard types.

GrowthDescription growth
{
// maximum growth before death, -1 for ever living
float _maxGrowth = 4.0;

// growth +- some amount
float _maxGrowthTolerance = 1.0;

// length of growth period to maturity
float _growthInMonths = 24;

// temperature dependant growth
bool _temperatureDependent = false;
float _growthTemp = 0.0;
float _growthTempRange = 0.0;

// re-seeding. Seed chance 0 means no reseeding
int _seedChance = 0;
int _seedDistance = 0;
int _seedTimeMonths = 0;
float _growthForSeeding = 0.0;

// max neighbors when reseeding
int _maxNeighbors = 1;

float _minScale = 0.2f;
}


growthInMonths looks easy enough, it takes two years, and that fits with observation. I'm less sure about what appeared to be the key variable, maxGrowth. I thought this meant the age, and that trees would then start to die in the 4th, or possibly 6th year (minus 2 years to grow).

Here are my notes from the observations
Year Notes
---------------------------------------
1 Planted and growing
2 Growing
3 16/16 trees - 519 apples
4 16/16 trees - 493 apples
5 16/16 trees - 520 apples
6 16/16 trees - 250 apples | Cold autumn
7 13/16 trees - 335 apples | Tree 3, 4, 5 died
8 10/16 trees - 325 apples | Tree 8, 12, 13 died
9 4/16 trees - 175 apples | Tree 6, 7, 10, 11, 15, 16 died
10 1/16 trees - 195 apples | Tree 1, 2, 9 died - tree 14 just after harvesting in Autumn
11 0/16 trees - 360 apples | Tree 14 died

12 16/16 trees - 216 apples | Cold autumn
13 16/16 trees - 516 apples
14 16/16 trees - 499 apples
15 14/16 trees - 406 apples | Tree 5, 8 died
16 9/16 trees - 325 apples | Tree 7, 10, 12, 13, 15, 16 died
17 3/16 trees - 154 apples | Tree 2, 3, 4, 6, 11 died
18 3/16 trees - 324 apples
19 1/16 trees - 424 apples | Tree 1, 14 died
20 0/16 trees - 390 apples | Tree 9 died


Looking at this, the trees clearly live longer than 4-6 years. Plotting the numbers into Excel, I find that the average for their first life was 8.7 years, and for their second life cycle 8.1 years.

Do other code divers know if there is something that could be relevant in other files?

On the other hand, as I'm writing this and looking at the code again, it could be that a value is added somewhere, and when this reaches the 4.0 from maxGrowth (within the range of 3.0 - 5.0, given tolerance?), the tree will die. With about 0.5 added per year, that would fit quite well with the average lifespan recorded in this little experiment.

The yield itself is pretty poor reading, and for most years I had two farmers tending to matters, so getting the job done wasn't an issue. The average across the 20 (or 18 to be pricise) years was a lowly 357. Based on these numbers, there appears to be 3 good years, then another 3 good years when the next batch of trees are mature (could have been four each if not for the poorly timed cold autumns). In between there are fewer mature trees, so the yield is lower.

Wish I had remembered to run a similar-sized cropfield just for direct comparison, but I expect it would be a gret deal higher, even without access to beans, crop or wheat (started with pumpkin and squash).

irrelevant

Personally, I no longer build orchards. I don't like how scraggly they get, and I don't like how flaky their production is. If the tree life were tweaked so that they lived a reasonable duration, I'd consider using them again.

Pangaea

Quote from: irrelevant on September 20, 2014, 07:28:19 PM
Personally, I no longer build orchards. I don't like how scraggly they get, and I don't like how flaky their production is. If the tree life were tweaked so that they lived a reasonable duration, I'd consider using them again.

Yep, that's the problem with how they work right now. They only give decent yields for 3-4 years, and then the trees start dying. This should be a lot longer. Maybe the best solution is indeed to give them eternal life, as they then at least won't have a two year hiatus each time they die. Orchards are still vulnerable to frost though, as the harvest happens so late (Autumn).

I like their look when all the trees are there, but it quickly starts looking scraggy as you say, and based on the food they produce, one can't really argue for orchards over farms. The latter is simply better. Would be nice if the sutuation wasn't so clearcut, so orchards could be an option without feeling that we're losing out.

irrelevant

Maybe eternal life is the solution. I always dismissed that as being cheat-like, but farms essentially have eternal life, all you have to worry about there is the frost. Maybe it would be reasonable to have orchards be the same. But I like the idea of the trees not living forever; they just need to live longer. I know there's a thread somewhere on this board where there was a discussion about how to tweak the lives of orchard trees. Maybe it was @mariesalias who was looking at it.

Pangaea

Quote from: irrelevant on September 20, 2014, 08:37:57 PM
Maybe eternal life is the solution. I always dismissed that as being cheat-like, but farms essentially have eternal life, all you have to worry about there is the frost. Maybe it would be reasonable to have orchards be the same. But I like the idea of the trees not living forever; they just need to live longer. I know there's a thread somewhere on this board where there was a discussion about how to tweak the lives of orchard trees. Maybe it was @mariesalias who was looking at it.

I agree, they need to live longer. Looks like it is indeed the maxGrowth variable afterall. I managed to fire up the rudimentary mod I made, with this value set to 1.0, and only five of the 16 trees survived until harvest after 2 years, with a handful of trees dying twice. Perhaps if this was increased to 10, it would be more reasonable, and the trees would live longer (15-20 years?) without having divine powers.

Would be a bit boring to check how long they actually live by observation again (it took several hours, even on 10x), so it would be nice to know how the function works for how much is added towards maxGrowth each year. Based on the test in the OP, it's ~0.5, which may mean it's a totally random number between 0 and 1, but it would be nice to know for sure. If that is correct, however, and I set that value to 10, the trees should live for an average of 20 years, and thus we can harvest them for 90% of the time (18/20).

Would 20 years be an okay life span?

rkelly17


Pangaea

I've now finally come to the conclusion of a review of the changes of my mod. By changing the maxGrowth value to 10.0, trees do indeed live ~20 years. I set up another 15x4 orchard grove, so 16 trees, and they all died between years 19 and 22. I also compared with a similar 15x4 crop, which happened to be wheat because we started with it. Orchard type was pecan, but that doesn't matter as they all perform the same.

When the trees live this long, it's actually not a landslide victory for the farming field - especially if we take out the 2 growth years from the average yield (but we can't really do that).

I shan't write down all the values, but the test ran for 25 years, until all the 2nd batch of trees were mature again. In that time only once was there a significant difference in yields between the crop and orchard field (before the orchards started dying), and that was due to extreme cold. Wheat mostly harvested, pecans not. For most years the orchards actually yielded more, because the max for 15x4 is 520, while it's 420 for a 15x4 crop field. Naturally, when the orchards were in their death and re-growth period (5-6 years), the yield was lower (200-350).

Total yield crop: 10,208
Total yield orchard: 9,347
Average yield crop: 408.3
Average yield orchard: 373.9 (406.4 if excluding the initial two 0 yield years)
Percent of max crop: 97.2%
Percent of max orchard: 71.9% (78.2% if exluding first two years)

With this change, there shouldn't be such a massive difference between crops and orchards. The numbers will of course be a bit different based on size of the fields (plus a host of other environment-related factors) and the type of crop and orchard. In this example, size-wise it was ideal for the orchard, and type-wise it was close to ideal for the crop, so they're kind of comparable, I think.

The trees won't live forever, so for decoration purposes the eternal life mod is more suitable, but for regular play, at least if you'd like to use orchards, then this could be decent if you feel eternal life is pushing it too much towards making things more comfortable compared with the default game.

I've uploaded the mod HERE in case others want to give it a whirl.

canis39

This is great, I will definitely use this mod. I like the idea of using orchards but did not want immortal trees. Thank you!!

Pangaea

Quote from: canis39 on September 22, 2014, 06:00:29 PM
This is great, I will definitely use this mod. I like the idea of using orchards but did not want immortal trees. Thank you!!

Happy to help :)

rkelly17

@Pangaea, in terms of orchard vs. field production, I'm not quite sure how this would work with your mod--which I need to try--but with @slink's "Immortal Orchard Trees" combined with @rageingnonsense's "Better Fields," which packs trees in tighter so that a tree takes 2X2 rather than 3X3, you get significantly more food from a 9X9 orchard than a 9X9 field. I would assume that combining your mod with "Better Fields" would produce the same results. On the vanilla 3X3 grid I filled a 9X9 square with 1 4X9 and 1 5X9 which gave me just a few less trees than 9X9 with "Better Fields" (the BF single orchard looks better), but the constant (and rather unrealistic) die-off and replanting really cut into production.


Pangaea

#10
Quote from: rkelly17 on September 23, 2014, 09:48:45 AM
@Pangaea, in terms of orchard vs. field production, I'm not quite sure how this would work with your mod--which I need to try--but with @slink's "Immortal Orchard Trees" combined with @rageingnonsense's "Better Fields," which packs trees in tighter so that a tree takes 2X2 rather than 3X3, you get significantly more food from a 9X9 orchard than a 9X9 field. I would assume that combining your mod with "Better Fields" would produce the same results. On the vanilla 3X3 grid I filled a 9X9 square with 1 4X9 and 1 5X9 which gave me just a few less trees than 9X9 with "Better Fields" (the BF single orchard looks better), but the constant (and rather unrealistic) die-off and replanting really cut into production.

The default is 2x3, not 3x3, but that was perhaps a typo. My mod works the same way @slink's does, the only difference is that 'my' orchard trees die after ~20 years, while slink's never do. In terms of productivity, it was sort of expressed above. The fields don't actually produce more per year, my mod doesn't change that per se, but over time productivity will be higher than default, because the "death and regrow" period is relatively smaller. So over a roughly 20 year period there will be 18 years of productivity, vs 6 years per 8 with the default orchards. So with my mod the orchard trees give fruits/nuts roughly 90% of the time, vs ~75% with the normal orchards. slink's will be close to 100%, as only the initial 2 years won't give any yield.

I tested with two fields of 15x4. That is the 'best' size in the default game for orchards, and the same-sized cropfield give a little less (420 v 520). But all factors taken into consideration, the test I ran showed that over the 25 year period, there was no longer a huge difference in output from crops and orchards using my mod. Crops will still be better, but it shouldn't be by a huge margin any more. Of course, it depends also on the weather. If you get a lot of early winters, crops will likely be better than orchards, as orchards tend to be harvested late. Same as with some crop types really.

I suppose cropfields are also more efficient in terms of labour, so you can have bigger fields without necessarily needing to add another farmer. According to banishedinfo, 15x4 (default) is the most one farmer can handle with orchards, but typically one farmer can handle a 15x8 cropfield fairly well, which is twice the size. In this test the cropfield was only 15x4, so both were the same size, so the farmer got 420 yield almost every year. With a bigger field, most likely he wouldn't get so close to 100% when winter set in early.

Not sure what the best orchard size will be with the Better fields mod, but 15x3 will have the same amount of trees as 15x4, so perhaps that. 15x5 will have another row of trees, but I'm not sure if one farmer can handle that on his own. It will be 24 trees...

The point about the mod isn't really to make orchards as good as crops - I would need to change the values of what the farmers get then (default is 65 for educated) - but to prolong the life of orchard trees so they don't die so bloody often. A side effect of that is that they also produce better over time.

I'm going to try it out in my proper game, and hope it doesn't crash down the line, and then I'll probably not cut down orchards at all. Or perhaps do so when the first few trees start dying after about 19 years. Will lose a little yield that way, but on the other hand you get logs for the soon-to-die-anyway trees, and two years later the whole orchard will be full and healthy again, as opposed to partially full for a few years until all trees have died and regrown to maturity.

Sorry, that got really long  :-\  :P