Page 1 of 1
Forest aging
Posted: Sun Jun 23, 2019 7:28 pm
by BenGoldberg
This idea is fairly simple: intercept the event which occurs when pollution causes a live tree to become a dead tree, scan the area around the tree for empty spaces, and for each space, try to spawn a new, live tree.
By "try," I mean generate a random number between 0 and 1, and if it's less than some configurable "tree spawn chance%" then spawn a new tree.
The more pollution you produce, the faster the forests, your true enemies, grow!
If you want sustainable wood, simply chop down only dead trees.
Re: Forest aging
Posted: Sun Jul 14, 2019 10:04 am
by sinropa
Well give this a go and let me know what you think:
https://mods.factorio.com/mod/ForestAging
There are several issues with implementing your concept. Mostly that the event you mention with a tree dying doesn't exist.
A tree would die if I shot it to death, for example. Chopping wouldn't count. Pollution "death" is just an unhealthy tree.
So a tree changing stage from pollution would be complicated to track. I would basically need to store a reference to every tree I care about and then iterate them all, which is a bad idea. So maybe someone else has a thought on it, but this was my attempt to create a similar result.
Basically I instead punish you for letting pollution grow unchecked. If your pollution keeps growing, I find a proportionate about of trees and duplicate them near their patch. So in theory, the distant forests should creep your way if you don't control pollution. However you should be able to push them back by clearing near woods.
I've added some throttles to prevent total insanity and a decay to make sure its likely to be noticeable toward longer games.
So I know this is a far off from what you requested. But its what I had time to do tonight and I welcome your feedback.