rnd_trees

User avatar
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

rnd_trees

by rnd » Tue Oct 20, 2015 12:40

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.
Attachments
tree4.jpg
(345.14 KiB) Not downloaded yet
tree3.jpg
(274.2 KiB) Not downloaded yet
Last edited by rnd on Sun Feb 07, 2016 22:06, edited 5 times in total.
If you want to tell people the truth, make them laugh, otherwise they'll kill you. Oscar Wilde
 

User avatar
Don
Member
 
Posts: 1642
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: rnd_trees

by Don » Tue Oct 20, 2015 13:52

Cool!
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
MineYoshi
Member
 
Posts: 5369
Joined: Wed Jul 08, 2015 13:20

Re: rnd_trees

by MineYoshi » Tue Oct 20, 2015 14:54

Looks good!
nire patata zurea da, kide :-)
 

User avatar
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: rnd_trees

by rnd » Tue Oct 20, 2015 14:57

here is what happens if no growth limit or bad settings

Image

Image
Attachments
fail_2.jpg
(102.67 KiB) Not downloaded yet
fail_1.jpg
(109.32 KiB) Not downloaded yet
Last edited by rnd on Fri Oct 23, 2015 09:14, edited 1 time in total.
If you want to tell people the truth, make them laugh, otherwise they'll kill you. Oscar Wilde
 

User avatar
MineYoshi
Member
 
Posts: 5369
Joined: Wed Jul 08, 2015 13:20

Re: rnd_trees

by MineYoshi » Tue Oct 20, 2015 15:21

going to happend this!

Image
nire patata zurea da, kide :-)
 

User avatar
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: rnd_trees

by rnd » Wed Oct 21, 2015 09:55

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

Image
Attachments
tree0.jpg
(391.92 KiB) Not downloaded yet
If you want to tell people the truth, make them laugh, otherwise they'll kill you. Oscar Wilde
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

Re: rnd_trees

by Minetestforfun » Wed Oct 21, 2015 15:00

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 :)
 

User avatar
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: rnd_trees

by rnd » Fri Oct 23, 2015 08:59

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
Attachments
tree_large.jpg
(127.79 KiB) Not downloaded yet
If you want to tell people the truth, make them laugh, otherwise they'll kill you. Oscar Wilde
 

User avatar
Prot
Member
 
Posts: 36
Joined: Thu Apr 02, 2015 13:20
Location: SaratOFF
GitHub: EuPhobos
In-game: EuPhobos

Re: rnd_trees

by Prot » Fri Oct 23, 2015 12:05

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!
 

User avatar
MirceaKitsune
Member
 
Posts: 851
Joined: Sat May 21, 2011 22:31
Location: Romania, Bucharest
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: rnd_trees

by MirceaKitsune » Sat Feb 06, 2016 13:43

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?
 

User avatar
Hybrid Dog
Member
 
Posts: 2720
Joined: Thu Nov 01, 2012 12:46

Re: rnd_trees

by Hybrid Dog » Sun Feb 07, 2016 20:12

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)?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
rnd
Member
 
Posts: 218
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: rnd_trees

by rnd » Sun Feb 07, 2016 22:06

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
If you want to tell people the truth, make them laugh, otherwise they'll kill you. Oscar Wilde
 

User avatar
MirceaKitsune
Member
 
Posts: 851
Joined: Sat May 21, 2011 22:31
Location: Romania, Bucharest
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: rnd_trees

by MirceaKitsune » Sun Feb 07, 2016 22:51

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.
 

User avatar
ManElevation
Member
 
Posts: 896
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation

Re: rnd_trees

by ManElevation » Wed Jul 26, 2017 22:57

This gives a complete different look to minetest trees, this is awesome!
My Public Mods! Discord: Rottweiler Games#3368
 

BertrandtheHealer
New member
 
Posts: 3
Joined: Sun Mar 17, 2019 04:14
GitHub: BertrandtheHealer

Improvements

by BertrandtheHealer » Sun Mar 17, 2019 04:39

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
Last edited by BertrandtheHealer on Mon Mar 18, 2019 18:44, edited 5 times in total.
 

Astrobe
Member
 
Posts: 199
Joined: Sun Apr 01, 2018 10:46

Re: rnd_trees

by Astrobe » Sun Mar 17, 2019 10:54

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: 199
Joined: Sun Apr 01, 2018 10:46

Re: rnd_trees

by Astrobe » Sun Mar 17, 2019 11:19

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.
 

BertrandtheHealer
New member
 
Posts: 3
Joined: Sun Mar 17, 2019 04:14
GitHub: BertrandtheHealer

Re: rnd_trees

by BertrandtheHealer » Sun Mar 17, 2019 18:02

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
 

Astrobe
Member
 
Posts: 199
Joined: Sun Apr 01, 2018 10:46

Re: rnd_trees

by Astrobe » Sun Mar 17, 2019 19:38

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.
 

BertrandtheHealer
New member
 
Posts: 3
Joined: Sun Mar 17, 2019 04:14
GitHub: BertrandtheHealer

Re: rnd_trees

by BertrandtheHealer » Sun Mar 17, 2019 19:55

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
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests