rnd_trees

rnd_trees

Postby rnd » Tue Oct 20, 2015 12:40 pm

Growing trees using natural growth process. Growth proces only occurs through air/leaves, the trunk shell can grow into other things too

GITHUB: https://github.com/ac-minetest/rnd_trees/wiki

LICENSE: LGPL

Image

Image

Image

Usage: place rnd_trees:tree on ground.

Algorithm sketch:

Start with one piece of living wood. Assign it life energy and let it grow. With each growth energy decreases. Depending on energy it can randomly branch in random direction with length of branch depending on energy; living wood remembers the branching stage. Randomly add leaves above trunk height with random sizes depending on if we are in end growth stage or not.

If not in branch thicken the living wood a bit to make thicker main tree trunk. The growth stops when living wood is out of life energy.
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24 pm
GitHub: ac-minetest
In-game: rnd

Re: rnd_trees

Postby Don » Tue Oct 20, 2015 1:52 pm

Cool!
Don
Member
 
Posts: 1642
Joined: Sat May 17, 2014 6:40 pm
GitHub: DonBatman
In-game: Batman

Re: rnd_trees

Postby MineYoshi » Tue Oct 20, 2015 2:54 pm

Looks good!
MineYoshi
Member
 
Posts: 5371
Joined: Wed Jul 08, 2015 1:20 pm

Re: rnd_trees

Postby rnd » Tue Oct 20, 2015 2:57 pm

here is what happens if no growth limit or bad settings

Image

Image
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24 pm
GitHub: ac-minetest
In-game: rnd

Re: rnd_trees

Postby MineYoshi » Tue Oct 20, 2015 3:21 pm

going to happend this!

Image
MineYoshi
Member
 
Posts: 5371
Joined: Wed Jul 08, 2015 1:20 pm

Re: rnd_trees

Postby rnd » Wed Oct 21, 2015 9:55 am

more complex branching process for better looking trees (open image in new tab)

Image
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24 pm
GitHub: ac-minetest
In-game: rnd

Re: rnd_trees

Postby Minetestforfun » Wed Oct 21, 2015 3:00 pm

This is beautiful and soo real, really great work, i like it so much !

Can't wait to see this for all trees in a mapgenV7 :)
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 2:09 pm
GitHub: Darcidride
In-game: Darcidride + MinetestForFun

Re: rnd_trees

Postby rnd » Fri Oct 23, 2015 8:59 am

large trees

+ settings used

Image

what remains to be done:
-rewrite code so that it uses http://dev.minetest.net/VoxelManip,
-save "DNA" into each tree seedling so that we can have different types of trees
-few fine tweaks
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24 pm
GitHub: ac-minetest
In-game: rnd

Re: rnd_trees

Postby Prot » Fri Oct 23, 2015 12:05 pm

Wow! This is amazing idea! And looks very impressive!
You can do some new biomes with this trees.. Like getting settings from mapgen, and plant somewhere big trees, or somewhere little..
I like it!
Prot
Member
 
Posts: 36
Joined: Thu Apr 02, 2015 1:20 pm
GitHub: EuPhobos
In-game: EuPhobos

Re: rnd_trees

Postby MirceaKitsune » Sat Feb 06, 2016 1:43 pm

Took a quick look at the screenshots and code. I like both the idea, and how simplistically it seems to be implemented! I might use this for the trees of a Minetest game I'll be making, but need to test it a bit first.

Can you please specify what license the script is under? May I include it as LGPL like most mods are?
MirceaKitsune
Member
 
Posts: 851
Joined: Sat May 21, 2011 10:31 pm
GitHub: MirceaKitsune
In-game: MirceaKitsune

Re: rnd_trees

Postby Hybrid Dog » Sun Feb 07, 2016 8:12 pm

You want to make it use vmanip, do you want a whole tree to appear immediately (faster) or the current way (being able to see it growing, vmanip may decrease speed because of low nodes count)?
Hybrid Dog
Member
 
Posts: 2724
Joined: Thu Nov 01, 2012 12:46 pm

Re: rnd_trees

Postby rnd » Sun Feb 07, 2016 10:06 pm

MirceaKitsune wrote:Took a quick look at the screenshots and code. I like both the idea, and how simplistically it seems to be implemented! I might use this for the trees of a Minetest game I'll be making, but need to test it a bit first.

Can you please specify what license the script is under? May I include it as LGPL like most mods are?


ok, LGPL
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24 pm
GitHub: ac-minetest
In-game: rnd

Re: rnd_trees

Postby MirceaKitsune » Sun Feb 07, 2016 10:51 pm

rnd wrote:ok, LGPL


Thanks. I actually wrote my own tree growth function from scratch, since this mod wasn't working well for me. But it was inspired by its idea, and uses the same life-based mechanism. I'm not sure if I'll publish it as an individual mod, but it will be featured in my game.
MirceaKitsune
Member
 
Posts: 851
Joined: Sat May 21, 2011 10:31 pm
GitHub: MirceaKitsune
In-game: MirceaKitsune

Re: rnd_trees

Postby ManElevation » Wed Jul 26, 2017 10:57 pm

This gives a complete different look to minetest trees, this is awesome!
ManElevation
Member
 
Posts: 896
Joined: Tue Aug 02, 2016 10:04 pm
GitHub: ManElevation
In-game: ManElevation

Improvements

Postby BertrandtheHealer » Sun Mar 17, 2019 4:39 am

I submitted a pull request to add a few improvements:

Chat Commands:
Code: Select all
/treespec <tree size> <trunk size> <branch length>
/trunkmat -- sets trunk material from currently wielded item
/leafmat -- sets leaf material from currently wielded item


Using a negative generation parameter randomizes that parameter for each tree created. For example:
  • /treespec -20 -6 -10 would make trees with random TREE_SIZE between 10 and 20, random TRUNK_SIZE between 3 and 6, and random BRANCH_LENGTH between 5 and 10.
  • /treespec -30 -5 8 would make trees with random TREE_SIZE between 15 and 30, random TRUNK_SIZE between 3 and 5, and BRANCH_LENGTH 10.

"DNA":
Growth nodes 'remember' the settings the tree was created with, so when the parameters or materials are changed they do not affect trees that are currently growing.

Persistent settings:
Each player has their own separate tree generation settings which persist when logging out.

Thicker trunks:
Taller trees with spreading canopies have bigger trunks.
Trees with tree size + branch length greater than 40 have a 1.5 radius trunk section; greater than 60 have a 2 radius circular section.

https://github.com/BertrandTheHealer/rnd_trees/

Image
I made all these trees in a few minutes, including the Dr. Seuss monstrosity in the background
Image
BertrandtheHealer
New member
 
Posts: 3
Joined: Sun Mar 17, 2019 4:14 am
GitHub: BertrandtheHealer

Re: rnd_trees

Postby Astrobe » Sun Mar 17, 2019 10:54 am

Actually... Metal or stone blocks could be interesting (petrified trees?). With some changes to the algorithm, connecting blocks (SDwalls, columnia, fences,...) could yield interesting structures too.
Astrobe
Member
 
Posts: 212
Joined: Sun Apr 01, 2018 10:46 am

Re: rnd_trees

Postby Astrobe » Sun Mar 17, 2019 11:19 am

Curiously this mod is posterior to the introduction of L-systems, which hasn't been much used AFAICT. In 4.17 docs there was a note that it had lighting bugs, but it is gone in 5.0 so I guess that it has been fixed. Perhaps petrified trees could be a good fit to the rather empty and dark new permafrost biome.
Astrobe
Member
 
Posts: 212
Joined: Sun Apr 01, 2018 10:46 am

Re: rnd_trees

Postby BertrandtheHealer » Sun Mar 17, 2019 6:02 pm

Astrobe wrote:Actually... Metal or stone blocks could be interesting (petrified trees?)


I agree, however I haven't found a good way of determining which blocks will work. For example the game crashes if you try to make the trunk out of minecarts or clay bricks. Excluding such blocks indivudually isn't feasible. If you know of a way short I'll be happy to implement it.

To disable the material restrictions you can comment out lines 55, 58-60, 80, and 83-85 in init.lua
BertrandtheHealer
New member
 
Posts: 3
Joined: Sun Mar 17, 2019 4:14 am
GitHub: BertrandtheHealer

Re: rnd_trees

Postby Astrobe » Sun Mar 17, 2019 7:38 pm

Oh, that's because minecarts are entities and bricks are craft items. You can check that the thing is the node by trying to index the registered nodes table with the name: minetest.registered_nodes[name] ~= nil or something like that.
Astrobe
Member
 
Posts: 212
Joined: Sun Apr 01, 2018 10:46 am

Re: rnd_trees

Postby BertrandtheHealer » Sun Mar 17, 2019 7:55 pm

Astrobe wrote:You can check that the thing is the node by trying to index the registered nodes table with the name: minetest.registered_nodes[name] ~= nil or something like that.


Thanks. I'm new to this.

I fixed it
https://github.com/BertrandTheHealer/rnd_trees/
Image
BertrandtheHealer
New member
 
Posts: 3
Joined: Sun Mar 17, 2019 4:14 am
GitHub: BertrandtheHealer



Return to WIP Mods



Who is online

Users browsing this forum: Bing Bot [Bot] and 0 guests