Death of flowers and grass

slopsbucket
Member
 
Posts: 235
Joined: Fri Oct 31, 2014 22:56

Death of flowers and grass

by slopsbucket » Sun Jan 11, 2015 07:20

This is really a Feature Wish.

When you've been playing the same map for a while the grasses and flowers keep reseeding more flowers and grasses but they never die. Eventully the whole landscape is completely covered.

My suggestion/wish is that flowers and grasses get a random length of life. If you did this with trees as well you could have a perpetually changing landscape.

Cheers,

Andrew.
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: Death of flowers and grass

by Gael de Sailly » Wed Jan 14, 2015 17:07

This is very interesting and I'm happy to not be alone to wish it.

The landscape will never be completely covered, because plants stops spreading when there are 4 plants in a radius of 4 blocks.
It's possible to change this. I've already thought about it but dropped my project, because of mods compatibility problems.

The idea is to remove plants with a small probability. Plants spreading uses an ABM (Active Block Modifier), a program which is run for every concerned block, with an adjustable interval and probability (in this case it's run every 50 seconds, with 1 chance over 25 for every plant block). This program (see here) checks all of the conditions (e.g. lighting or plants density) and duplicate the plant. We can easily add a probability to remove the plant in this program.
If you know a little LUA language and Minetest technical features, it's not very difficult.
But I want to rewrite it completely, because it's not really well made, I want to add a way to manage differents plants with differents characteristics.
I will perhaps make a subgame, one day. In this case I will include this improvement.

For trees, it's a little more difficult.
In Minetest, trees are completely inert. They don't spawn naturally after the map generation, except if you plant a sapling, and they never disappear. So to implement this feature, we must code it from zero. And it's more difficult, because a tree is not one block but a lot.

It would be a great enhancement.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

slopsbucket
Member
 
Posts: 235
Joined: Fri Oct 31, 2014 22:56

Re: Death of flowers and grass

by slopsbucket » Wed Jan 14, 2015 23:11

Thank you for replying Gael.

You're right of course, "completely covered" was an exaggeration but they do end up behaving like weeds.

If you know a little LUA language and Minetest technical features, it's not very difficult.


I had never even heard of LUA before I tried compiling my own Minetest a couple of months ago. To me it looks very much like C++ but my programming skills are very poor. I learnt Basic back in the early 80's then started teaching myself C++ in the late 90's but I never had the dedication or self discipline to keep at it. I know enough to be able to read and understand simple scripts such as the one you provided a link to but I don't have enough confidence to try and create my own.

For trees, it's a little more difficult.

In Minetest, trees are completely inert. They don't spawn naturally after the map generation, except if you plant a sapling, and they never disappear. So to implement this feature, we must code it from zero. And it's more difficult, because a tree is not one block but a lot.



Yes, I knew that trees would be an entirely new script for respawning but would it be that difficult? Although a tree is made up of many blocks it is still only a single object. Leaves and apples are separate objects but no recoding should be required there as they are called by the object _tree. But as I said before, my programming skills are very poor and there's a high probability that I'm completely wrong. And I only mentioned the trees as an after thought, it's the weeds coming up every where that I was more concerned with.

What made me come up with the idea in the first place was my farming technique, instead of making pens to keep animals in I create the right environment and they automatically spawn there. When you get too many grasses growing you get lots of little white ducks but all the sheeps and cows go away. I use this same technique in my own garden, no grasses means no termites to kill my fruit trees and glyphosate is a lot cheaper than bifenthrin, less damaging to the environment as well.

If you do get around to creating a subgame I would like to see it.

Cheers,

Andrew.
 

User avatar
indriApollo
Member
 
Posts: 144
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay

Re: Death of flowers and grass

by indriApollo » Wed Jan 14, 2015 23:43

one could simply spawn a sapling using minetest.place_node() and wait for it to naturally become a tree :)
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: Death of flowers and grass

by ArguablySane » Thu Jan 15, 2015 00:40

indriApollo wrote:one could simply spawn a sapling using minetest.place_node() and wait for it to naturally become a tree :)

That would be my preferred solution.

The reproduction and death code could be built into the nodes that make up the trunk. For a tree with a single node wide trunk then a node can know it's the bottom-most one if there are no trunk nodes below or to the sides of it, including diagonals. Only the bottom-most node should check for soil, leaves, and reproductive opportunities. If there is no soil below the tree then it dies and the leaves disappear. If there are no leaves, then it's already dead. If it's alive then it should pick a random block within, say, 20 nodes radius. If that node is air with soil underneath and light above, and if the temperature and humidity values are suitable, then it should spawn a sapling there. A sapling deprived of light or soil should die.

Using those rules and a relatively long ABM timer for tree trunk nodes, you'd see forests gradually expand over any available soil. By tuning the permitted temperature and humidity values, and by adding interactions with other plants, it should be possible to make a relatively stable but dynamic ecosystem of plants. It would be nice to see trees gradually grow back after I had been out gathering wood.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: Death of flowers and grass

by dgm5555 » Tue Feb 03, 2015 23:16

Enhancing the growing trees mod would be cool. perhaps once trees had grown to a certain size they could wither and die, or alternatively occasionally fall over (actually I was mulling over the idea of enhancing the weather mod with a wind storm which could blow over trees).
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 5 guests

cron