Post your L-system trees here!

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

Post your L-system trees here!

by Wuzzy » Post

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: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Apple tree

by Wuzzy » Post

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

Tree definition:

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
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Post your L-system trees here!

by Krock » Post

\o/

Great stuff! I'll try to make some trees in the next days.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Post your L-system trees here!

by Linuxdirk » Post

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: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Post your L-system trees here!

by Wuzzy » Post

@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: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Post your L-system trees here!

by Linuxdirk » Post

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
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: Post your L-system trees here!

by VanessaE » Post

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 (64-512px)

User avatar
Hybrid Dog
Member
Posts: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

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

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

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

Re: Post your L-system trees here!

by luizrpgluiz » Post

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

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

Re: Post your L-system trees here!

by Nyarg » Post

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 and a little proof for fun PlantedTorch )))
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"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
Location: Australia
Contact:

Re: Post your L-system trees here!

by lordfingle » Post

Image

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

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 1152 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
Location: Australia
Contact:

Jacaranda Tree

by lordfingle » Post

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

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 1152 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
Zav
New member
Posts: 3
Joined: Tue Dec 26, 2023 10:39
In-game: Zavaglio

Re: Post your L-system trees here!

by Zav » Post

The topic may be a bit old, but this system still has a lot to say

Code: Select all

somewhat_believable_tree={
    axiom="TTT[//////^^^TTTTa][******&&&TTTTa][******^^^TTTTa][//////////////////&&&TTTTa][******************^^^TTTTa][//////&&&TTTTa]",
	rules_a="[///^^^TTTFb][***&&&TTTFb]",
	rules_b="[////^^^TFFc][****&&&TFFc]",
	rules_c="[////^^^FTFd][****&&&FTFd]",
	rules_d="[/////^^^FFf][*****&&&FFf]",
	trunk="default:tree",
    leaves="default:leaves",
    angle=10,
    iterations=26, --
    random_level=11, --
    trunk_type="double",
    thin_branches=false,
    fruit_chance=0,
    fruit="default:leaves"
}
-- licensed under MIT license
believable_trees.png
believable_trees.png (723.6 KiB) Viewed 249 times
photo is CC0

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests