Dev comment on Tree Growth

General discussion about Life is Feudal MMO and Life is Feudal: Your Own, The main section and backbone of the forums.
User avatar
Arrakis
 
Posts: 5455
Joined: 25 Oct 2013, 14:11
Location: Space

Dev comment on Tree Growth

Post by Arrakis » 09 Nov 2016, 01:15



http://steamcommunity.com/app/290080/discussions/0/276237094321633855/#c276237094330917557


FR: http://vonculm.fr/explication-des-devs- ... -foret-397


O_O.BeN wrote:Hey guys! Let me clarify some things about forest growth process that was introduced in 1.1.5.7. Everything below has little use for players and is aimed for server admins.

Forest is now governed by much more complicated rules which are described below. If you are not interested in the innards of the algorithm, skip the first section right to the topics you guys discussed here. The first section is provided just to clarify which things do not work like before, like "sprout spawn rates" that were mentioned here.

General algorithm description
Here are the goals of the algorithm:
1. Forest should never become too big
2. Forest should be visually diverse in terms of tree types, should contain trees of various ages and qualities

There is a new server configuration file named cm_forest_maintenance.xml which configures the "optimal" overall state of the forest. Regardless of the state of the forest before 1.1.5.7, maintenance-by-maintenance the algorithm will slowly "move" forest from it's current state to the optimal state.

The most important thing about this optimal state is how much trees there should be on the server. This can be expressed in terms of "tree density" settings and basically means that "moving to optimal state" results in either increasing or decreasing the number of trees in existing forest. The optimal state is maintained once reached.

The criteria for tree death is it's age. The older the particular tree gets, the greater the chance that it will die during the next maintenance. EVERY tree will die of old age sooner or later. In contrast to this, the algorithm will create new trees only if there is a shortage of trees of a particular type compared to the "optimal" forest.

Let's say that we want to cover 10% of forest soil with pines and there are 1000 cells of forest soil on the server. This would mean that forest in the optimal state will have 100 pines. If there are, say, 150 pines on our server, excessive pines will slowly die out, whereas in case there are just 50 pines instead of 150, "missing" pines would be spawned over the course of several game days.

Once the optimal forest state is reached, there should be trees of all ages with nicely distributed wood quality values. The "factory" settings of cm_forest_maintenance.xml should give you a beautiful and diverse forest that lives, changes over time but never reaches the crazy overgrown state that was possible before.

The rules of determining WHERE to plant the new trees are complicated and I don't think that they are relevant to this discussion.

It should be noted that transition to the optimal state is likely to take a long time (something around 200 game days), but it depends on the current state of the forest.


Unchecked overgrowth of forest database table
Before 1.1.5.7 forest trees would never die on their own, so forest grew uncontrollably and the only "legit" way of reducing its' size was just cutting trees down. The workaround that many admins use (as far as we know) is applying "clearing" SQL scripts that remove trees from server database based on some criteria (e.g. remove all trees with quality < 90).

This is not needed anymore and the usage of such scripts will likely result in servers with a very small amount of trees.

Speeding growth up
Right now growth speed-up is not possible because the new forest growth algorithm does not support it. The method of changing
Code: Select all
$CmMaintenance::forestMaintenanceDayCount

that was discussed here will do something but it is probably not what you expect. Indeed, trees would age faster, which means that they would die faster. Due to implementation details setting this parameter to, say, 2 will result in a forest that has twice smaller number of trees than the number indicated by the density settings in cm_forest_maintenance.xml. This behavior may suit your needs but this variable was not intended for such usage.

That said, seeing these discussions, we recognize that there should be a way to configure the speed of the forest growth for server admins. We plan to provide a solution that plays well with the rest of forest growth logic in future.

Return to General Discussion

cron