Jump to content

Concept for Forest Regeneration


Recommended Posts

Currently, when the player cuts down a tree, it has a chance of dropping the seed of the tree on the ground. This seed will either get picked up by the player or despawn. But I think it would be a good opportunity to introduce a mechanic for auto-regenerating forests, where if (1) the seed has not been picked up within 10 minutes (or whatever the entity despawn timer is set at), and (2) the block the seed fell on meets certain conditions, the seed will auto-plant and grow a new sapling.

This would avoid entity-spam or performance issues as it is entirely controlled by the player (only cut down trees drop seeds), and the trees would grow the same way wild crops do. If performance was not a concern, this mechanic could be expanded to living trees as well, dropping their seeds on the ground in specific seasons/months.

Conditions for if a seed can auto-plant would be the presence of medium or tall grass (so that forests do not overtake natural grasslands, only clearings created by the player and spots missed during worldgen), and light level (so that saplings don't grow in cramped conditions), in addition to the basic climate checks for each specific species of tree.

Edited by Oak_Goblin
  • Like 4
Link to comment
Share on other sites

I like the idea, but I'd be concerned about how much processing power it requires to accomplish. I recall playing with a mod that did similar(Wildcraft, I think?) and it used a lot of system resources. High end computers probably won't have issues, but I don't think older hardware would be able to handle it. It's probably best left as an optional world setting that you can enable if you have the hardware to handle it.

Link to comment
Share on other sites

Haven't looked at the coding, but I suspect junk on the ground is a linked list or some other implementation of a FIFO stack for each block, and a field for when that block was last unloaded. If so, when it increments through the list and comes time to despawn that piece of garbage, there would be one check to see if it's a seed, and if so, plant it. (And I'd propose not another existing seedling within, say, a 10 block radius.)

At least in a multiplayer setting, it would take a conscious effort to denude the forests so there was nothing left for new players, collecting all the seeds and tossing them down a cave or throwing them onto rock.

I don't know why Wildcraft dragged things so badly. Always meant to look at the code and see what it was doing differently, but the mod just seemed to be an Easy mode for VS. It needed to replace existing resources in mapgen, not add to them. But that is evidently not easy to do, as most mods seem to not affect the base game's allotment of similar resources.

Edited by Thorfinn
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.