Post your L-system trees here!

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Post your L-system trees here!

by Wuzzy » Mon Jan 26, 2015 19:55

I want to kick off a community effort to build a collection of L-system trees which serve as good examples or can be re-used in mods. No matter if simple or complex, ordinary or weird, anything goes!

If you want to post your L-system tree, please:
  • Make sure your tree actually works
  • Provide the tree definition table (2nd parameter of minetest.spawn_tree) of your tree in Lua code

It is not neccessary, but it would be nice if you:
  • Optionally show a screenshot (4:3 aspect ratio preferred)
  • Optionally leave a comment or description of your tree
  • Optionally assign a name to the tree; you could use the title of your post for this

Eventually I want to list the best examples in this wiki page:
http://dev.minetest.net/L-system_tree_examples

Useful links:
Last edited by Wuzzy on Mon Jan 26, 2015 22:35, edited 3 times in total.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Apple tree

by Wuzzy » Mon Jan 26, 2015 19:58

I start the collection with an example: The apple tree found in lua_api.txt.

Tree definition:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
treedef = {
   axiom="FFFFFAFFBF",
   rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
   rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
   trunk="default:tree",
   leaves="default:leaves",
   angle=30,
   iterations=2,
   random_level=0,
   trunk_type="single",
   thin_branches=true,
   fruit_chance=10,
   fruit="default:apple"
}


Screenshot:
Image
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Post your L-system trees here!

by Krock » Wed Jan 28, 2015 19:57

\o/

Great stuff! I'll try to make some trees in the next days.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your L-system trees here!

by Linuxdirk » Wed Jan 28, 2015 20:23

I din’t know … Wow. This looks like something to dig in to! Since it does not need any mods and since I’m not that deep into “Minetest internals” how do I actually make a tree spawn?

Do I need to create a simple mod doing nothing more than spawning a tree and doing it all over again and again with quitting the game, modifying the mod and starting the game again while testing?
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Post your L-system trees here!

by Wuzzy » Thu Jan 29, 2015 03:46

@Linuxdirk: No. You can use the L-System Tree Utilty, a mod programmed by me. If you install this mod, you can enter all the values using a nice formspec, you can save your definition for later use and plant it at an absolute or relative position. You can also request a special sapling of that treedef, which, when placed, will spawn the tree at that position 5 seconds after you placed it.

When you are happy with your tree definition, you can then finally use the tree definition in your mod. Or post it here. :-)

However, you do have to understand how L-System trees work in Minetest, see the other links in 1st post. But don't worry, the tool comes with a simple built-in help system including above example tree to help you get started.
Comments about this mod should go into the other thread, please.


Another possibility which is closer to Lua would be to use the luacmd mod. This mod allows you to enter Lua commands from inside the game. You could say in chat “/lua treedef = --[[ your treedef goes here ]]”, followed by something like “/lua minetest.spawn_tree({x=1,y=3,z=4234}, treedef)” in the chat. You can use the up and down keys to cycle through the command history. It is probably more complicated than using the other mod, but luacmd can be great if you already have data coming from existing mods, and you want to examine or modify it.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your L-system trees here!

by Linuxdirk » Sat Jan 31, 2015 18:53

Wuzzy wrote:However, you do have to understand how L-System trees work in Minetest, see the other links in 1st post.

I just checked them. Seems like the usual turtle drawing thing :) I learned COMAL in 5th or 6th grade. Even if it’s a long time since then I still know how this basically works, only the syntax differs a lot :)

Wuzzy wrote:Another possibility which is closer to Lua would be to use the luacmd mod.

I just overlooked your mod – I think I’ll stick with that. Thanks!
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

Re: Post your L-system trees here!

by VanessaE » Tue Mar 31, 2015 20:57

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
moretrees.acacia_model={
   axiom="FFFFFFccccA",
   rules_a = "[B]//[B]//[B]//[B]",
   rules_b = "&TTTT&TT^^G&&----GGGGGG++GGG++"   -- line up with the "canvas" edge
         .."fffffffGG++G++"               -- first layer, drawn in a zig-zag raster pattern
         .."Gffffffff--G--"
         .."ffffffffG++G++"
         .."fffffffff--G--"
         .."fffffffff++G++"
         .."fffffffff--G--"
         .."ffffffffG++G++"
         .."Gffffffff--G--"
         .."fffffffGG"
         .."^^G&&----GGGGGGG++GGGGGG++"      -- re-align to second layer canvas edge
         .."ffffGGG++G++"               -- second layer
         .."GGfffff--G--"
         .."ffffffG++G++"
         .."fffffff--G--"
         .."ffffffG++G++"
         .."GGfffff--G--"
         .."ffffGGG",
   rules_c = "/",
   trunk="moretrees:acacia_trunk",
   leaves="moretrees:acacia_leaves",
   angle=45,
   iterations=3,
   random_level=0,
   trunk_type="single",
   thin_branches=true,
}
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

by Hybrid Dog » Thu Apr 02, 2015 15:32

Last edited by Hybrid Dog on Tue May 24, 2016 20:12, edited 1 time in total.
 

User avatar
luizrpgluiz
Member
 
Posts: 17
Joined: Thu Mar 19, 2015 18:11
IRC: luizrpgluiz
In-game: luizinho

Re: Post your L-system trees here!

by luizrpgluiz » Tue May 19, 2015 02:00

pos = {x=230,y=20,z=4}
stone_tree={
axiom="FFFFFAFFBF",
rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
trunk="default:mese",
leaves="default:stone",
angle=30,
iterations=2,
random_level=20,
trunk_type="single",
thin_branches=true,
fruit_chance=10,
fruit="default:wood"
}
minetest.spawn_tree(pos,stone_tree)
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your L-system trees here!

by Nyarg » Fri May 20, 2016 15:13

I am not familiar with L-System, but really want l-system rule for tall tree like here Image
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
lordfingle
Member
 
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle

Re: Post your L-system trees here!

by lordfingle » Thu Dec 01, 2016 07:38

Image

A rare Savannah tree to provide some variety for all those acacias...

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Boabab Tree
exotictrees.boabab_tree_model={
axiom="ATTTTTTc",
rules_a="[&&&G^^^TTTTTTF][&&&+++G^^^TTTTTTF][&&&---G^^^TTTTTTF][&&&-----G^^^TTTTTTF]",
rules_b="",
rules_c="[&--TF][&++++TF][&-----TF]",
trunk="moretrees:oak_trunk",
leaves="exotictrees:boabab_leaves",
angle=30,
iterations=3,
random_level=0,
trunk_type="crossed",
thin_branches=true,
}
exotictrees.boabab_tree_biome = {
   surface = { "default:dirt_with_grass", "default:dirt_with_dry_grass" },
   avoid_nodes = exotictrees.avoidnodes,
   avoid_radius = 10,
    check_air = true,
   seed_diff = 339,
   min_elevation = 1,
   max_elevation = 200,
   near_nodes_size = 15,
   near_nodes_count = 10,
   temp_min = 0.1,
   temp_max = -0.15,
   rarity = 40,
   max_count = 2,
}
minetest.register_node("exotictrees:boabab_planks", {
   description = "Boabab Planks",
   tiles = {"exotictrees_boabab_wood.png"},
   is_ground_content = true,
   groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
   sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("exotictrees:boabab_sapling", {
   description = "Boabab Sapling",
   drawtype = "plantlike",
   tiles = {"exotictrees_boabab_sapling.png"},
   inventory_image = "exotictrees_boabab_sapling.png",
   paramtype = "light",
   paramtype2 = "waving",
   walkable = false,
   selection_box = {
      type = "fixed",
      fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
   },
   groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
   sounds = default.node_sound_defaults(),
})
minetest.register_node("exotictrees:boabab_leaves", {
    description = "Boabab Leaves",
    drawtype = allfaces_optional,
    tiles = {"exotictrees_boabab_leaves.png"},
    paramtype = "light",
    is_ground_content = false,
    groups = {snappy=3, flammable=2, leaves=1, --[[moretrees_leaves=1]]},
    sounds = default.node_sound_leaves_defaults(),
})
 
biome_lib:register_generate_plant(exotictrees.boabab_tree_biome, exotictrees.spawn_boabab_tree_object)
Attachments
screenshot_20161130_151036.png
screenshot_20161130_151036.png (207.55 KiB) Viewed 1704 times
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford
 

User avatar
lordfingle
Member
 
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle

Jacaranda Tree

by lordfingle » Thu Dec 01, 2016 07:42

We use these in our game to highlight where dungeons (mossycobble) are...

Image

I'm rather fond of Jacaranda trees because I come from Grafton in Australia ;):

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Jacaranda Tree
minetest.register_node("exotictrees:jacaranda_trunk", {
   description = "Jacaranda Trunk",
   tiles = {
      "exotictrees_jacaranda_trunk_top.png",
      "exotictrees_jacaranda_trunk_top.png",
      "exotictrees_jacaranda_trunk.png"
   },
   paramtype2 = "facedir",
   is_ground_content = true,
   groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
   sounds = default.node_sound_wood_defaults(),
   on_place = minetest.rotate_node,
})
minetest.register_node("exotictrees:jacaranda_planks", {
   description = "Jacaranda Planks",
   tiles = {"exotictrees_jacaranda_wood.png"},
   is_ground_content = true,
   groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
   sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("exotictrees:jacaranda_sapling", {
   description = "Jacaranda Sapling",
   drawtype = "plantlike",
   tiles = {"exotictrees_jacaranda_sapling.png"},
   inventory_image = "exotictrees_jacaranda_sapling.png",
   paramtype = "light",
   paramtype2 = "waving",
   walkable = false,
   selection_box = {
      type = "fixed",
      fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
   },
   groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
   sounds = default.node_sound_defaults(),
})
minetest.register_node("exotictrees:jacaranda_leaves", {
    description = "Jacaranda Leaves",
    drawtype = "allfaces_optional",
    tiles = {"exotictrees_jacaranda_leaves.png"},
    paramtype = "light",
    is_ground_content = false,
    groups = {snappy=3, flammable=2, leaves=1, --[[moretrees_leaves=1]]},
    sounds = default.node_sound_leaves_defaults(),
})
exotictrees.jacaranda_tree_model={
   axiom="FFFFFFFAFFBF",
   rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
   rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
   trunk="exotictrees:jacaranda_trunk",
   leaves="exotictrees:jacaranda_leaves",
   angle=30,
   iterations=2,
   random_level=0,
   trunk_type="single",
   thin_branches=true,
}
exotictrees.jacaranda_tree_biome = {
   surface = { "default:dirt_with_grass", "default:dirt_with_dry_grass" },
   avoid_nodes = exotictrees.avoidnodes,
   avoid_radius = 10,
    check_air = true,
   seed_diff = 339,
   min_elevation = 1,
   max_elevation = 100,
    near_nodes = {"default:mossycobble"},
   near_nodes_size = 15,
   near_nodes_count = 10,
   temp_min = 0.1,
   temp_max = -0.15,
   rarity = 90,
   max_count = 1,
}

 
biome_lib:register_generate_plant(exotictrees.jacaranda_tree_biome, exotictrees.spawn_jacaranda_tree_object)
Attachments
screenshot_20161115_145439.png
screenshot_20161115_145439.png (283.62 KiB) Viewed 1704 times
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron