slipcor / TreeAssist

https://www.spigotmc.org/resources/treeassist.67436/
GNU General Public License v3.0
34 stars 19 forks source link

Suggestion, feature: dynamic forest spreading #56

Open iperrealistico opened 4 years ago

iperrealistico commented 4 years ago

So, this is a thing i always loved in Minecraft servers. I got the inspiration in the good old days when plugin UberForest was still active and maintained.

Essentialy: make so that forests do spread over time

The difficult part: do not annoy players that want to be submmerged in the woods πŸ˜† (and make it lag free)

What could you do is try to do something similar to what UberForest did: sometime, on a cycle, a tree has a chance to spawn a sapling nearby. This sapling has a chance to become a tree or an uber-tree (bigger tree, that has the ability to spawn more saplings).

Now: players would get instantly annoyed by this. Like as soon as they see the forest spread without any control over their claims. For this reason, saplings should not get replanted in claims, and near claims. The nearest a sapling is to a claimed land, the lowest is the chance for it to get planted. Inside claimed land, the chance is zero.

Also: forests should not over-populate themselves. A sapling should look how many saplings are around the location before getting planted. So that we don't have overcrowded forests (and prevents also overpopulation near claim borders over time). Each biome should have it's chances too. For example plains should have a very low chance.

Here comes the difficult part: this should happen in areas where there are actually less or no players. You might be tempted to do this in already loaded chunks, or in chunks that get loaded very often. That was the mistake that UberForest did back in the days! Essentially, the more a player stays in an area, the more this area goes out of control with forest spreading πŸ˜† looking at this from a real-life perspective, makes no sense. And it's annoying for gameplay. All what i am suggesting, should happen in the areas that are less visited by players. Don't tell me how tho! That's magic. And should happen also asynchronously! Because it could lag everything down to death!

Is this challenging enough for you? lol

slipcor commented 4 years ago

This sounds exciting and doable with WorldGuard! There is a worldguard custom flag - "treeassist-replant" - this can be used atm already to prevent saplings from being planted. So basically if we add a new feature that "drops saplings that might override disabled auto plant" they still would be subject to this plugin (worldguard) cancelling the placement and thus... yeah this could work :D The trees will potentially grow into uninhabited areas... the only thing is.. how do you make this, physically?

I am not sure I want to go with a "we have super spreader trees" but somehow we do have to start this. It could be like an invisible forest fire that gets ignited by a player.

Let's say a player moves into uncharted territory and settles next to a forest. Then we would have to think about a sensible way of calculating what chance a "neighbor of a fallen tree" should have to be "infected" with the spreading-virus and how high the survivability is. Because the next neighbor does not grow itself, but it would have to infect next neighbors in the direction away from claimed territory. So maybe there has to be a "distance from claimed territory" - and the trees would look for neighbors and f they have found a neighbor, spread the "virus" to them.

As soon as we found a forest edge, we can then think about how many trees are at an edge and how much space is there to grow to. If there is a lot of space, we might want to grow. if there is a tree, especially a different KIND of tree, in the same chunk, do not grow, but spread the virus. By doing this we basically already make a big list of "valid trees" going forward. This might have to be thought through well though to not constantly be checking for distances and going in all directions. It really needs to work like an individual virus infecting neighboring trees but dying down fast otherwise we have all trees marked at all times :D

Also what happens if a tree is growing neighbors, does it do that twice and then the virus dies?

This is very exciting and I agree that it is a valid thing to think about and also to do properly, and not grow to where it was because then deforestation is impossible and players cannot build where forests were :D

Well they can always fight the saplings, if your server allows it... but the system should make some sense and not try to fill the world with trees. Maybe a "game of life" kind of rule, if the tree is surrounded by more than 3 trees that are infected, its virus dies?

I think this could be exciting :D But it needs extensive testing and debugging about how many trees are infected where and dying and replanting. Also... we need to talk about how saplings spread.. a tree mighit basically have to "poop out" a sapling "in the direction of a clearance" --- this might look funny xD

But yeah TL;DR: I like the idea and will think about it!

iperrealistico commented 4 years ago

This is very exciting and I agree that it is a valid thing to think about and also to do properly

happy to hear that! really! when i understand that i have the ability to code something and that something triggers me, my brain is instantly excited about the thing πŸ˜† i think this is something that programmers have in common lol however this is totally out of my ability range!

Maybe a "game of life" kind of rule

yup this remembers me a lot GoL, but with trees! this would actually make minecraft forests alive, a living being. we need a set of basic rules, and a very well coded way to loop through the trees in an async way

a tree mighit basically have to "poop out" a sapling

at the end of the day, that's what spreads the forest, yeah 🀣