[Mod] L-System Tree Utility [1.4.2] [ltool]

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

[Mod] L-System Tree Utility [1.4.2] [ltool]

by Wuzzy » Sat Jun 07, 2014 15:17

I present to you: The L-System Tree Utility!

This mod aims to help mod developers experimenting with L-system tree definitions. It provides a simple formspec which is a wrapper around minetest.spawn_tree with a lot of additional features. If you don’t know how this function or L-systems work, then this mod is not for you. However, you can learn both here:


Say “/treeform” in the chat to open the formspec or click on the extra button in your inventory menu when using Simple Fast Inventory Buttons or Unified Inventory.

Here, have a screenshot:
Image

And another one:
Image


See this post for more generic information about the mod (screenshots are slightly outdated there).
The mod also has a built-in help system which should you help in getting started with this mod (knowledge of how to use L-system trees in Minetest is required).

Planned features:
  • Exporting and importing L-tree specifications to/from disk

If you have made a nice L-system tree, feel free to share it with the world in this thread: Post your L-system trees here!

Current version: 1.4.2 (This is a SemVer)
License of everything: MIT License
Works with: Minetest 0.4.16 and later
Depends on: Nothing!
Mandatory dependencies: None!
Optional dependencies:
Download: See attachment
Project page (Git): http://repo.or.cz/w/minetest_ltool.git
Attachments
ltool1.4.2.zip
(93.61 KiB) Downloaded 4 times
Last edited by Wuzzy on Thu May 17, 2018 19:32, edited 24 times in total.
 

User avatar
Krock
Developer
 
Posts: 3880
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] L-Tree Tool [0.1] [ltool]

by Krock » Sun Jun 08, 2014 10:43

Wait... I know this one from somewhere.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Sokomine
Member
 
Posts: 3460
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] L-Tree Tool [0.1] [ltool]

by Sokomine » Sun Jun 08, 2014 15:30

Yes, there's been a mod like this before.

A nice addition for this one would be to be able to delete the creation if it wasn't up to expectations. It'd also be fine if the text entered the last time would show up at subsequent calls (plus a clear button). And some node that stores the data used for creating an L-Tree object so that you can write it to file and use in your own mod. Cut&paste doesn't work well with MT under Linux.
 

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

Huge update! Version 0.2.0 released.

by Wuzzy » Sun Jul 27, 2014 16:32

In the past week of my unintentional (almost) full Internet abstinence, I have worked very hard on this tool.

I am now proud to present you version 0.2.0. I switched to using a SemVer (http://www.semver.org/). The mod is now called “L-System Tree Utility” (short name: still “ltool”) by me.

You find the download in the attachment of the first post.

Overall, version 0.2.0 has a lot of work in it and it is a massive update compared to version 0.1. Briefly, I think this mod now has finally become to something which is actually useful. It is now easy and quicker (in my opinion) to experiment with L-system trees without restarting the server for every tiny change. I say this because I managed to painlessly create a simple L-tree. You see the result on these screenshots:
Image
Click here for full size.

Image
Image
Image

You can stop reading from here if you don’t want to know all the gory details.



Giant dry shrub: tree definition
In case you want to know, here is (sorta) the tree definition table for these strange looking "giant dry shrubs" from the first screenshot:
Code: Select all
{
   axiom = "A/A/A/A/A/A/A/A/A/A/A/A",
   rules_a = "[B+B+B+B]",
   rules_b = "[FFFFFFFFFF]",
   trunk = "default:tree",
   angle = 30,
   iterations = 1,
   random_level = 0,
   trunk_type = "single",
   thin_branches = true
}


Current state of this mod
There is no changelog this time, I better describe this mod in the state it is now, because so much has changed.

The heart of this mod, the tree formular has four tabs now. It still can be accessed with the chat command “treeform”.

The four tabs are: Edit (… a tree), Database (… of trees), Plant (… a tree) and a simple help.

The basic workflow in this mod is this:
  1. Create tree in "Edit" tab and save it.
  2. Select it in "Database" tab.
  3. Plant it with help of the "Plant" tab.

The first one is the “Edit” tab. This is used to enter the tree definition, which is still a wrapper around the tree definition data structure required by minetest.spawn_tree. When you are done editing, hit "Save" to store the tree to the database. Trees now can have a name. This tab quite agressively enforces correct parameters. If you think your input was rejected for stupid reasons, please write a message here.
Tree names have to be unique server-wide. If there is a name-clash, you have to change the name. If the clash is with one of your own trees, you can choose to simply replace said tree.

The second tab is the "Database" tab. This has a list of all installed trees on the server. Your own trees are in yellow font. You have to select a tree here first so you can plant it later. Currently the list also shows the unique tree ID. This is only there for debugging at the moment and I may remove it later.

"Tree" is a data structure in this mod. It contains the tree definition (for L-systems), a name and the name of the "owner".
Ownership is weak in the L-System Tree Utility. The owner of a tree may rename, delete and change his/her trees, everyone else is prevented from doing that. However, everyone can still copy and plant it. Copying a tree is a way to gain ownership … to a copy of that tree. Maybe this is interesting for collaborative projects. In theory, you could collaborate without interfering with the work of others. This has never been tested in practice yet, however.

The third tab is for actually planting/spawning the trees. You can choose to spawn the tree immediately by providing absolute or relative coordinates. The relative coordinates are relative to your position.
You can even request a sapling. If you place this sapling, the tree will spawn at this point with a delay of 5 seconds.
You can see said sapling in the first screenshot. Saplings continue to work even if the tree definition has been deleted.

The fourth tab is contains some help for using the mod. It also contains a cheat sheet which contains a quick overview over all the symbols you can use in the axiom and rule sets.

Version 0.2.0 finally remembers the content of the formular, but only if you press a button or change tabs for the moment. I don’t know how to rescue the field contents when the player hits [Esc] to close the formular.

Known bugs
There is one extremely nasty bug in Minetest which is not blocked by this mod either: If you try to spawn a tree which tries to pop from an empty stack, Minetest blows up all over your face. This means, a tree which has, in extended form, more “]” than “[” will crash Minetest when spawned.
This bug has been reported, see issue #1525 on GitHub.

So anyone who uses this mod can crash your server!

Plans for the future
First of all, this mod needs more testing. Especially the part which involves multiple players is pretty much untested. I expect to have some bugs as soon as more than one player is on the server, using this mod.

I plan to make extensions to the in-game help. I want a full-blown in-game help, maybe, if I’m very good at this I could even manage to teach newbies the basics of L-systems and, of course, how they are used in Minetest.

I plan to provide a very basic API to add, remove, rename, copy, etc. trees in the database. (done!)

I plan to add more chat commands.

Using this mod requires no privileges whatsoever at the moment. I think I should change that, but I am still unsure how exactly. (done!)

Feedback request
Of course I’d like to hear feedback from you. Especially I want to know how useful you find this mod in regards to usability. Is it easy to use or still rather cumbersome? If you find something confusing or don’t understand something, please complain here.

Please remember this mod is currently aimed to people who already know the basics of L-systems.

Replies
Oh, and yes, it is true. Very very earlier there was another mod. I think you mean this one: viewtopic.php?id=4766
I consider the other mod to be outdated; L-System Tree Utility is now obviously miles ahead. :-)
Last edited by Wuzzy on Fri Oct 17, 2014 15:58, edited 1 time in total.
 

User avatar
philipbenr
Member
 
Posts: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi

Re: [Mod] L-System Tree Utility [0.2.0] [ltool]

by philipbenr » Mon Jul 28, 2014 00:52

This will speed the progress of my in-progress game exponentially, if I can figure it out... I'll try it out later...
 

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

Version 1.0.0 released!

by Wuzzy » Fri Oct 17, 2014 15:50

L-System Tree Utility version 1.0.0 is there, with a lot of changes! You can find the download in the attachment of the first post.

Changelog:
  • Simple privileges for editing and planting trees are now used
  • New planting method: You can now plant a tree based on your current viewing direction
  • Seed value is now stored in given saplings
  • Simple API functions for manipulating the tree database, plant trees, etc., all by mods (read API.md)
  • Reworked the entire formular so it works in resolution of 800×600 as well
  • Reordered the input fields in the edit tab
  • Added a new field “Clear fields”. It clears all fields.
  • Added tooltips to a couple of input fields
  • Automatically sort tree list in database tab by number
  • A “+” button in the edit tab opens a larger input field for the axiom and rule sets, includes a simple input help

I also uploaded my git history here:
http://repo.or.cz/w/minetest_ltool.git

Here is the new and reworked editing formspec:
Image

The other tabs didn’t change significantly, see my previous post for an impression.

This is what you see when you click on a plus sign:
Image
Apart from a larger input field, there is a simple input help, provided by those small buttons. If you click one of these, the character is appended to the end of the text field. This is optional, you can still just type the symbols in manually, of course.

I addes this function because tree definitions can become very complex. I think this input field should be large enough, but tell me if you need more space.

And there are also new privileges:
  • ledit: Allows user to create, edit and delete his/her own trees
  • lplant: Allows user to plant trees in the real world and request saplings

This means, to be able to use this mod fully, you need to have both the “ledit” and the “lplant” privileges.
Server operators, better don’t give the lplant privilege lightly; A malicious or careless user can very easily crash your server thanks to an engine bug (it is still not really fixed).

Regardless of these privileges, all users still can open the formular with the “treeform” command and view the definitions, but they cannot edit or plant any trees.


Oh, and philipbenr: Did you already have some experience with using this mod? I would be glad to hear some feedback.
And everyone else: If you have problems in understanding this mod, do not hesitate to ask here. Don’t forget that the mod assumes basic knowledge about L-system trees and how to use them in Minetest, if you need help about that, better open a new thread about this.
 

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

Patch release: 1.0.1

by Wuzzy » Sun Feb 08, 2015 00:11

I have made a small bugfix concerning a slightly annoying error message appearing in recent Minetest version, it was about a variable I accidentally leaked into global space. I also fixed a typo.

I have now release version 1.0.1 and it can be downloaded from the attachment from the first post.

That's all!
 

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

Patch release: 1.0.2

by Wuzzy » Sat Mar 12, 2016 16:56

Another bugfix release: 1.0.2. Changes:

  • Properly align buttons with text fields on the edit page (thanks to addi!)
  • Increase some button sizes so the text fits in in small resolutions
  • Add missing mod metadata
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

Version 1.1.0

by Wuzzy » Fri Nov 18, 2016 23:21

Version 1.1.0 released! This release is mostly a GUI improvement. Changelog:

  • Add a button in Unified Inventory for easy access
  • Add Item Documentation [doc_items] help texts for the sapling
  • Shorten some edit field names
  • Use map generator aliases in example tree
  • Minor spell-checking
  • Hide some widgets when required privileges are missing, and add appropriate messages
  • Add screenshot
  • Add a short README
  • Fix crash after aborting a tree rename
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

Re: [Mod] L-System Tree Utility [1.1.0] [ltool]

by lordfingle » Thu Dec 01, 2016 07:35

Thanks Wuzzy! This looks freaking awesome.
We will definitely use this for our next trees.
----------------------------------------------------------------------------------------------
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
Wuzzy
Member
 
Posts: 3015
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.2.0

by Wuzzy » Sat Dec 03, 2016 16:30

Version 1.2.0 released!
Changes:

  • You now keep your sapling when you're holding down the sneak key while placing it. This makes it easier to place lots of trees without requesting the same sapling over and over again
  • If you have the ledit and lplant privileges, you can request a sapling directly in the editing tab. This makes it much more convenient to experiment with lots of tree definitions
  • Some tweaks for the sapling node: Sunlight propagates, better selection box, is no longer replaced by building to it
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

hajo
Member
 
Posts: 551
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: [Mod] L-System Tree Utility [1.2.0] [ltool]

by hajo » Mon Dec 12, 2016 08:36

Wuzzy wrote:I present to you: The L-System Tree Utility!

It looks like the forum-search doesn't like "L-system":
the "L" is ignored, and then lots of postings are found with "system",
that have nothing to do with "L-system".
 

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

Re: [Mod] L-System Tree Utility [1.2.0] [ltool]

by Wuzzy » Mon Dec 12, 2016 10:17

Not my fault. The forum search is very, very terrible at finding mods. Even searching for the exact shortname (e.g. “ltool”) often doesn't help either.

Use a proper search instead:
http://krock-works.16mb.com/MTstuff/modSearch.php

Bookmark this now! :D And tell your Minetest buddies about it. Seriously. It will save you lots of nerves.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

Version 1.3.0 released!

by Wuzzy » Mon Dec 19, 2016 22:02

Version 1.3.0 released.

This version adds optional support for sfinv_buttons by adding an extra button into your inventory menu for easier access.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

hajo
Member
 
Posts: 551
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: [Mod] L-System Tree Utility [1.3.0] [ltool]

by hajo » Thu Dec 22, 2016 11:03

From the last time I had a look at this mod, I have a hazy memory
that there was a button that would fill out the entryform
with some demo-tree, like that enormous apple tree.
But now I cannot find that button...

While that Apple- & Acacia-demo are good to show that it works,
they are less good at showing how designing trees work.

So, I'm suggesting some more simple demo-trees.

Also, tooltips for the entryfields trunk, leaves, fruit etc,
maybe even pulldown-menus.

BTW, what is the difference between trunk/branch/trunk-only ?

And I think there should be some more checks,
e.g. I managed to get a sapling that simply poofed after planting.
I guess without a name for the trunk, nothing grows (but no error:).

Also, I would like the database (at least for singleplayer) to be global,
not tied to a world.
So I could just try/modify/plant some tree in every new game,
without having to move/copy the database around.
 

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

Re: [Mod] L-System Tree Utility [1.3.0] [ltool]

by Wuzzy » Thu Dec 22, 2016 19:20

hajo wrote:From the last time I had a look at this mod, I have a hazy memory
that there was a button that would fill out the entryform
with some demo-tree, like that enormous apple tree.
But now I cannot find that button...


It's in Help > Introduction.

So, I'm suggesting some more simple demo-trees.

Give me a good tree definition.

Also, tooltips for the entryfields trunk, leaves, fruit etc,

I don't know what to explain here. I think the field names already explain it all. Suggest a tooltip, but I will not take it if it is redundant.

maybe even pulldown-menus.

Yes, this is an obvious suggestion and I fully agree. I have tried it several times to replace some of the text fields with drop-down list but I always failed because of the totally WTF way how formspec coordinates work. I never manage to align those widgets in a way that doesn't mess up

As far I know, there are two possible solutions:
- Someone sends me a patch
- Minetest developers finally fix the formspec coordinates chaos or at least write documentation for it. So that I can use this knowledge properly.

BTW, what is the difference between trunk/branch/trunk-only ?

Try it out or ask a core Minetest developer.
I basically just used the documentation from the Lua API documentation. I am not 100% sure.
Maybe “trunks and branches” means that it draws a trunk node at the main branches of the tree but it draws leaves at the higher iterations instead.
“trunk only” means that only trunks will be drawn (duh!).

e.g. I managed to get a sapling that simply poofed after planting.
I guess without a name for the trunk, nothing grows (but no error:).


Tree definitions which don't create any actual trees are allowed and supported. This behaviour is intentional.
The mod is explicitly aimed for advanced users and especially modders, so I won't stop them from creating weird, nonsensical or even empty trees. I still have checks included, but those are just for syntax errors or incorrect tree definitions which would cause errors. But maybe you can suggest some other checks.

Also, I would like the database (at least for singleplayer) to be global,
not tied to a world.
So I could just try/modify/plant some tree in every new game,
without having to move/copy the database around.


There is just a small problem: Different worlds mean different nodes, and different nodes mean not all trees will work everywhere. Another open question is what should happen with the existing world-specific tree definitions after this change is implemented.

But the general idea is fine. It would indeed make it much easier to use.


Please note that this mod is totally not on my radar right now.
While I agree with most on your comments, it is unlikely I will update this mod anytime soon. But I'll gladly accept patches (if they're good).

Oh, a final question to you and everyone else who used this mod: Do you think this mod is (overall) useful to you?
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

hajo
Member
 
Posts: 551
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: [Mod] L-System Tree Utility [1.3.0] [ltool]

by hajo » Wed Dec 28, 2016 11:09

Wuzzy wrote:
hajo wrote:So, I'm suggesting some more simple demo-trees.

Give me a good tree definition.

Working on it...

hajo wrote:Also, tooltips for the entryfields trunk, leaves, fruit etc,
I don't know what to explain here.
Just a list of 2-3 valid strings for each field would be very useful,
to avoid having to backtrack to the documentation.
E.g. writing "leave" instead of "leaves" gets funny results...

BTW, there are secondary leaves, can there be secondary fruits too ?

a final question to you and everyone else who used this mod:
Do you think this mod is (overall) useful to you?

Well, it's nice to play around with those trees, and come up with one that looks good,
and perhaps to put the recipe on the wiki.
But I'm not sure how to actually use a finished one - make a mod, a new game, or what ?

Eg. it might be nice to give a sapling of a 'starter tree' to a new player,
which would provide some starting materials.
But would that sapling work a designed, without the lplant-priviledge ?
 

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

Re: [Mod] L-System Tree Utility [1.3.0] [ltool]

by Wuzzy » Wed Dec 28, 2016 13:51

hajo wrote:
hajo wrote:Also, tooltips for the entryfields trunk, leaves, fruit etc,
I don't know what to explain here.
Just a list of 2-3 valid strings for each field would be very useful,
to avoid having to backtrack to the documentation.

The real problem is that the user is required to enter itemstrings. Not that those are that hard to understand, but they are hard to memorize, so it is bad usability even for power users. A quick improvement might be mentioning that these fields require itemstrings but there must be a better way in the long run.

I am planning a mod which adds a formspec to select an item out of a list of items more easily. This will make it much easier to select items, compared to requiring the user to remember 1000s of cryptic itemstrings. And ltool would definitely benefit from it, but I am also sure many other mods could make use of it, too.

BTW, there are secondary leaves, can there be secondary fruits too ?

No.

But I'm not sure how to actually use a finished one - make a mod, a new game, or what ?

Use minetest.spawn_tree. Currently, you have to copy and paste all the fields manually as there is no real data export feature.

For other L-system questions, read the stuff I linked to in the first post, read lua_api.txt or ask a core developer. I have NOT implemented actual support for L-system trees, this mod just gives a formspec to play around with L-system trees. So I am not exactly the right person to ask about all things L-system trees.

Eg. it might be nice to give a sapling of a 'starter tree' to a new player,
which would provide some starting materials.

Rejected. This mod is a mod for mod developers and maybe power users. The main goal is to make it a bit easier to experiment with lots of trees in order to add them later to mods. Without this mod, modders have to constantly restart Minetest only to test their new trees, which gets tedious very quickly.
This mod is NOT meant for gameplay other than pure sandbox (maybe).
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

Version 1.4.0! Version 1.4.1!

by Wuzzy » Thu May 17, 2018 15:27

Hey!
It's time for a new update! This time, I release version 1.4.0!

Updates:
  • Add optional node selection dialogues in the tree editor. Requires Select Item mod (viewtopic.php?f=9&t=20109&p=318665)
  • Add server command “lplant” to plant a tree with commands
  • L-system tree saplings can now be stacked
  • Tooltip of sapling now shows tree name
  • Rightclicking a sapling makes it grow instantly (only with “lplant” privilege)
  • Add compability with Inventory++
  • Fix fruit not being correctly copied into tree editor

This mod is now officially under MIT License.


EDIT:
Version 1.4.1 released!
Change:
  • Remove useless buttons when Select Item mod is not enabled (whoops!)
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

Version 1.4.2!

by Wuzzy » Thu May 17, 2018 19:41

Another bugfix release! Version 1.4.2! Changelog:

  • Mod no longer allows the creation of trees with unbalanced brackets in axiom or rule sets
  • Fix crash when trying to save tree without clicking on database tab first (in current player session)

The first bugfix is quite important. Each of the axiom and the 4 rule sets now must have balanced brackets.
In previous versions, any combination of brackets was allowed and unchecked.
It was possible to crash a server by submitting a tree with unbalanced brackets and then planting it.

If you're using this mod on a server, check all your tree definitions for bracket errors and delete or correct them. It's unlikely that you encountered this, but not impossible. Sorry for the inconvenience. :-8
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 5 guests