Latest Posts

Topic: tree planting locations

Imperio_Centurio
Avatar
Topic Opener
Joined: 2016-04-02, 00:25
Posts: 6
Ranking
Pry about Widelands
Location: Germany
Posted at: 2016-04-02, 00:43

The forest ranger always plants trees on mountain terrain, where the trees do not grow up to final stadium. So the trees cannot be felled by an woodchopper but they inhibit building ways and mines. So could somebody of the almighty programmers be so kind and give the forest rangers more brain, so that they would be intelligent enough, only to plant trees on terrains where they are able to grow properly and not on my mountains? Thanks!


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2016-04-02, 07:00

Welcome to the forum!

Forester is planting the trees randomly. The only "thinking" of him is to plant trees that have highest possibility to grow on the place. To prohibit the forester to plant trees on the mountains, you can simply make roads everywhere and there will be no place for the trees.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2439
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2016-04-02, 09:43

I agree that this is sometimes annoying. You could also prevent this by not placing foresters near to mountains.

But in general this is not a great problem i think.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-04-02, 11:58

Since we now have access to probability_to_grow, we could define a cutoff for Worker::run_plant to prefer a different terrain, e.g. with at least 50% probability or something?

ETA: This looks like a really easy fix, so I have created a quick branch. Not compiled or tested though.

Edited: 2016-04-02, 12:08

Busy indexing nil values

Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 00:54
Posts: 351
Ranking
Tribe Member
Posted at: 2016-04-02, 14:42

The foresters pick a random spot for planting trees, so why not just multiply each spot's odds by the chance of the tree growing? Then, a spot with an 80% probability is four times as likely to be chosen as a spot with 20% probability. Then they'll still plant some trees in unlikely spots, but most will be in tree-friendly areas.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-02, 17:46

also dont forget about situation where there is no good spots around, but a player still needs to grow trees.


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-04-02, 18:04

this is not the first time that the issue was raised, and every time I answered: it's not a bug, it's a feature. basically, you have to find the right placement for the foresters to make them grow good trees. it's something where player skill comes handy. If you can't avoid making foresters close to the mountains, as einstein suggested, you can make roads over the tree-unfirendly terrain.

As for making foresters capable of discriminating terrain, that's not as easy as it seems. yes, we have the probability oof growth for every terrain, but trees are planted at corners, and every corner is bordered by 6 fields, and each one may be a different terrain. But you can just take the average growth probability of each terrain, right? Wrong! because what matters for tree growth are the values of temperature, humidity and fertility, and different trees grow with different values. you can mix terrains with good HGP, and maybe the resulting values will be such that no tree will grow well on them. Or you can take terrains with low HGP and maybe their average will be good for some trees. For example, ashes have moderate HGP because they are very fertile but very dry. Nothing grows on water, and even if it was possible to plant trees on it, it does not have fertility. But mix those terrains togheter, and you get average fertility and humidity; on the shoreline of ashes trees grow really well. So calculating the HGP of every single corner would require a lot of calculation and code.


Top Quote
Imperio_Centurio
Avatar
Topic Opener
Joined: 2016-04-02, 00:25
Posts: 6
Ranking
Pry about Widelands
Location: Germany
Posted at: 2016-04-02, 18:58

I would already be happy if the forester would only stop planting trees in mountain terrain. That wolud mean that the forester does not plant trees on corners that are bordered by six fields of mountain terrain (= bordered only by mountain terrain).


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-02, 19:14

Imperio_Centurio wrote:

I would already be happy if the forester would only stop planting trees in mountain terrain. That wolud mean that the forester does not plant trees on corners that are bordered by six fields of mountain terrain (= bordered only by mountain terrain).

Personally I see no problem with planting trees on mountains, so there is no consensus over this issue, I think...


Top Quote
teppo

Joined: 2012-01-30, 08:42
Posts: 423
Ranking
Tribe Member
Posted at: 2016-04-24, 09:21

Tibor wrote:

I would already be happy if the forester would only stop planting trees in mountain terrain. That wolud mean that the forester does not plant trees on corners that are bordered by six fields of mountain terrain (= bordered only by mountain terrain).

Personally I see no problem with planting trees on mountains, so there is no consensus over this issue, I think...

The forester already figures out the best tree type for a spot. If the odds of tree growth would be below some threshold, the forester could just walk away instead of annoying the player by planting a tree that can only produce irritation instead of logs. Tibor: Would you see a problem if the foresters would stop doing the hopeless plantations?

The game would be more fun this way, in my opinion.

This change should not be too difficult to implement. It would, of course, add one more arbitrarary threshold. I have not had time for WL recently, but older builds had some mountain types that were able to sustain trees.

Edited: 2016-04-24, 09:29

Top Quote