Latest Posts

Topic: Tree growth in practice

No0815
Avatar
Topic Opener
Joined: 2016-05-01, 14:52
Posts: 49
Ranking
Pry about Widelands
Posted at: 2017-12-19, 15:49

With the introduction of the new model for tree growth quite a while back, things have become somewhat complex. For most players it's sufficient to look at the editor or use the rule of thumb (the greener the better for tree growth) to get a good idea where trees will grow well enough. For map creators and obsessive optimizers though it can be quite difficult to asses what terrain would be optimal to use. So it would be interesting to know a bit more about how stuff works.

So far I have caught that

  • every terrain has specific values for fertility, humidity and temperature and each tree has preferences for these values plus a pickiness, and the probabilities shown in the editor are calculated from these values (and how well they match)
  • for nodes with different adjacent terrains the vales are averaged (and growth probabilities might be vastly different than for any of the terrains alone)
  • foresters plant one of the six trees that grow best on the given terrain
  • the probabilities of choosing a tree to plant out of these six are not evenly distributed but weighted

The questions I have now:

  • If less then six trees can grow on a terrain, are only those considered by the forester? So on dry soil only Borassus and Coconut Palm would be planted?
  • Are the probabilities for planting weighted with fixed values? Or by the relative portion of the sum of all six growth probabilities? Or something else?

Also, things are getting really crazy when you would like to know how well trees might grow on mixed terrains. Since I plan to remake the map for the second mission of the barbarian campaign it would be really helpful to know about suitability of mixes for trees. It uses a mix of terrains around the allowed area for playing that doesn't support buildings but is suitable for a thick forest. I'd like to keep this idea but I'm not sure if I can find out which terrains might work best, as the current choice of Beach (winter) and Tundra 2 is not so optimal. The forest on it gets quite some holes over time from dying trees.


Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2017-12-19, 18:41

No0815 wrote:

  • If less then six trees can grow on a terrain, are only those considered by the forester? So on dry soil only Borassus and Coconut Palm would be planted?

There will always be six trees. Some are just horribly unsuitable.

  • Are the probabilities for planting weighted with fixed values? Or by the relative portion of the sum of all six growth probabilities? Or something else?

The weight of each tree is the square of its probability to grow in that spot.

If one tree has a growth probability of 20% and other the probability of 1%, the weights are 0.04 and 0.0001; the former is planted 400 times more often.

Also, things are getting really crazy when you would like to know how well trees might grow on mixed terrains.

The editor should show the combined forestability, instead of the raw numbers.

I wonder if the humidity will be used to tinker with the performance of empty wells in the future.


Top Quote
No0815
Avatar
Topic Opener
Joined: 2016-05-01, 14:52
Posts: 49
Ranking
Pry about Widelands
Posted at: 2017-12-19, 19:52

teppo wrote:

There will always be six trees. Some are just horribly unsuitable.

Oh, that makes it a bit harder to calculate since trees with an extremely low probability (below 1%, I presume) aren't displayed in the editor. On the other hand, if that value is squared for the choice it's basically irrelevant anyway.

  • Are the probabilities for planting weighted with fixed values? Or by the relative portion of the sum of all six growth probabilities? Or something else?

The weight of each tree is the square of its probability to grow in that spot.

If one tree has a growth probability of 20% and other the probability of 1%, the weights are 0.04 and 0.0001; the former is planted 400 times more often.

That should give even better results than weighting the raw values. I'll have to change my formula first to compare the results.

Also, things are getting really crazy when you would like to know how well trees might grow on mixed terrains.

The editor should show the combined forestability, instead of the raw numbers.

The probabilities to grow are shown in the editor's help window and only there. Therefor one can only check the probabilities for a specific terrain, not a mix of several. Since I assume, that the raw values for fertility, humidity etc. are averaged for mixed terrains instead of the calculated growth probabilities (which wouldn't make sense), the growth probabilities for a specific mix of terrains would need to be either calculated by hand or with a script since there are many possibilities. I hope I can find a way to make that easier ...

I wonder if the humidity will be used to tinker with the performance of empty wells in the future.

I'd like that since these values would probably fit well, but it seems my suggestion isn't met with much approval face-sad.png


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-12-19, 19:55

We have just been discussing in another thread that we need tooltips here. The bottleneck is developer time.


Busy indexing nil values

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-12-27, 20:02

teppo wrote:

No0815 wrote:

  • If less then six trees can grow on a terrain, are only those considered by the forester? So on dry soil only Borassus and Coconut Palm would be planted?

There will always be six trees. Some are just horribly unsuitable.

So let's reduce this number to... One? face-wink.png

  • Are the probabilities for planting weighted with fixed values? Or by the relative portion of the sum of all six growth probabilities? Or something else?

The weight of each tree is the square of its probability to grow in that spot.

Oh, wow. Another top secret law of tree growth. But I like it! The confusing thing is that as a rookie map-maker you don't know that "Forested Mountain 2 / Wasteland" is the best ground for trees, you rather think that it's not a very good ground.

Even grounds like "Hard Ground 3" are worse, even though you think that they are probably better face-wink.png


Wanted to save the world, then I got widetracked

Top Quote