Fish and Wildlife


Adds regrowing trees and respawning fish.

Content
4 years ago
0.15 - 0.18
53
Environment

g Growth rate & equilibrium factor

5 years ago

Hi, I'm not used to mod factorio, so I don't really know where to look in the mod's files :c but your mod seems to be the closest to what I'm looking for.
I would like to change 2 things:
Above all, the rate of spawn/growth/death of trees so that the forest evolves way faster.
Then I'd also like to change the factor for equilibrium so that the forest could spread and occupy 120%, 150%, 200%, ... of its original size.
Can you help me please?

5 years ago
(updated 5 years ago)

The mod keeps track of the "original" (when the chunk is generated, or when the mod is introduced to a save) tree density in the "initchunk" function, at

counter.amount = area.surface.count_entities_filtered{area=area,type="tree"}+1

The simplest way to increase the potential forest growth would probably be to change this to

counter.amount = 3*area.surface.count_entities_filtered{area=area,type="tree"}+10

or similar. There is no simple (read: anything I'm going to go into in this post :p ) way to control this so forests expand to a specific % of its original size (this would require readjusting the value as adjacent chunks are generated). Consider this an exercise for the reader :D

Growth speed calculations are based on a number of factors. Solar power and wood yield determines the "base" rate of growth and is handled in setuptables(). The easiest way to unilaterally increase growth time is to tweak the solar_index value that is calculated as a modifier. After it is defined a default value of 1, there is a loop that iterates through all the solar panel types in the game to find the most efficient one. Right after this loop, just adjust it by the amount you want to increase tree growth; e.g., if you want to double tree growth rate, solar_index = solar_index*2

I would provide line numbers for these things, but I'm not sure how closely my current local copy matches the uploaded version and I'm too lazy to dig it up :p

Alternately, you might want to look into other mods, of course. Most of the ones I've seen grow trees much faster than mine (which is one of the reasons I wrote it). That said, in future versions I will probably add mod settings to tweak some of these factors (growth rate, death rate, and now that you've brought it up, maybe a "forest spread size" type thing).

New response