[Mod] Living (dynamic) trees [living_trees] [WIP]

Post Reply
RichardTry
New member
Posts: 4
Joined: Fri Oct 16, 2020 13:26
GitHub: RichardTry
In-game: RichardTry

[Mod] Living (dynamic) trees [living_trees] [WIP]

by RichardTry » Post

Hi everybody, this is my first mod.
It adds roots, branches and smooth tree growth:
https://www.youtube.com/watch?v=3JJ-5R2PjPo
(Growth is fast just for demonstration!)

Screenshots:
branches.png
(975.84 KiB) Not downloaded yet
tree.png
(727.67 KiB) Not downloaded yet
pine.png
(742.23 KiB) Not downloaded yet

GitHub: https://github.com/RichardTry/living_trees

How it works?
For every tree type (apple, pine, etc.) there is a node of roots (can be several: pine_roots_in_dirt, pine_roots_in_sand, etc.) During mapgen (or planting a sapling), every root gets unique L-system string, which generates from axiom for it's tree type. ABM, which runs for every root node, parses its string, and update corresponding node, if it is smaller (or air/leaves), than branch at string (branch getting blocked by other nodes).
Breaking a branch with axe/piston/TNT will recursively break its childs. Leaves will disappear with standart Minetest Game ABM.

Warning: Mapgen and l-string generation parts are not implemented yet!
+ L-system notation

API:
To register a living tree run:

Code: Select all

living_trees.register_tree({name, roots, texture, trunk, leaves})
where:
name — tree's name.
roots — table of node names on which the tree grows.
texture — trunk and branches texture.
leaves — name of leaves node.
Example:

Code: Select all

living_trees.register_tree({
	name = "Apple",
	roots = {"living_trees:apple_roots"},
	texture = "default_tree.png",
	trunk = "default:tree",
	leaves = "default:leaves"
})
Will be implemented:
Mapgen,
L-string generation,
Branch adaptation (growing around obstacles).

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

Re: [Mod] Living (dynamic) trees [living_trees] [WIP]

by Krock » Post

This growth mechanism already looks very good. Keep up the good work!
It would be possible to use faster node timers on the next lower trunk node to spawn new branches. ABMs are quite slow and do not scale well when there's neighbour nodes to check.

PS: There's an L-tree/system implementation in Minetest, but it might not contain enough features for your needs.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

cuthbertdoublebarrel
Member
Posts: 275
Joined: Tue Apr 14, 2020 16:03
GitHub: cuthbert

Re: [Mod] Living (dynamic) trees [living_trees] [WIP]

by cuthbertdoublebarrel » Post

nice , really like the idea of the trees taking over the world and changing the terrain into woodland and forest . could you do the same with brambles and creeping vines or root systems ? so that they obstruct paths and passages and smother buildings .
Project BrutalTest...hide your Petz

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

Re: [Mod] Living (dynamic) trees [living_trees] [WIP]

by philipbenr » Post

Very interested to see how this progresses. I like the idea of a dynamic environment, and even just the branches is a nice addition.

User avatar
v-rob
Developer
Posts: 828
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [Mod] Living (dynamic) trees [living_trees] [WIP]

by v-rob » Post

This is very nice! I really like the idea of real branches, but I've never been able to think of a proper way to make them look good. Yours are better than I imagined.

(I wish my first mod was half as cool as this one...)
GUI Core Developer | My Best Mods: Bridger - Slats - Stained Glass | To contact me, send a PM

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests