[Abandoned] [Mod] Round Tree Trunks [1.1.0] [round_trunks]

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

[Abandoned] [Mod] Round Tree Trunks [1.1.0] [round_trunks]

by Hamlet » Post

Image
Turns cubic tree trunks to cylindrical.

Ported from RealTest

Alternative:
Round Trunks by VanessaE

Version: 1.1.0
Source code's license: EUPL v1.2 or later.
Model's license: GPLv3
Textures' license: CC BY-SA 4.0 International

Dependencies: default (found in Minetest Game)

Optional features:
- Turn leaves' shape from cubic to "X" shaped (papyrus like).
- Toggle textures' overriders.
To activate it: Settings -> Advanced Settings -> Mods -> Round Trunks

API for third party mods:
See api.txt


Downloads:
Archives: .zip .tar.gz
Source code: Codeberg
Changelog: link


Installation
Unzip the archive, rename the folder to round_trunks and place it in
../minetest/mods/

If you only want this to be used in a single world, place it in
../minetest/worlds/WORLD_NAME/worldmods/

GNU+Linux - If you use a system-wide installation place it in
~/.minetest/mods/

For further information or help see:
https://wiki.minetest.net/Help:Installing_Mods
Attachments
round_trunk.png
(218.19 KiB) Not downloaded yet
Last edited by Hamlet on Fri Oct 02, 2020 17:33, edited 22 times in total.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

User avatar
Lone_Wolf
Member
Posts: 2412
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] Round Tree Trunks [0.1.0] [round_trunks]

by Lone_Wolf » Post

This looks cool

User avatar
GreenXenith
Member
Posts: 1329
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenXenith
In-game: GreenXenith
Location: The singularity
Contact:

Re: [Mod] Round Tree Trunks [0.1.0] [round_trunks]

by GreenXenith » Post

Y▹uTube | Mods | Patre●n | Twitter | Minetest Discord | GreenXenith#3232

Hey, you. You're finally awake.
You were trying to view their profile, right? Found the rest of their signature, same as us, and that guest over there.

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.1.0] [round_trunks]

by Hamlet » Post

GreenDimond wrote:This already exists. https://github.com/minetest-mods/round_trunks.
Amazingly it even has the same screenshot :-!
I wonder how many mods "already exist" but do not have a forum topic (I've searched on the forum before doing mine).

Anyway, good to know: I'm going to use that mod's textures for mine since that version doesn't allow to change the leaves' shape.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

User avatar
twoelk
Member
Posts: 1401
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Round Tree Trunks [0.1.0] [round_trunks]

by twoelk » Post

not to forget the altertrunks mod by mossmanikin.

btw, wouldn't it be better if you added to the mod on minetest-mods?
I havn't compared the code to see how easy this would be
but
from a player and users view I would think it more usefull when instead of duplicating features in parallel mods the mods allready adopted into a community driven maintainance system were expanded.

added to https://wiki.minetest.net/Mods:Nature anyways :-P

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.1.0] [round_trunks]

by Hamlet » Post

twoelk wrote:not to forget the altertrunks mod by mossmanikin.

btw, wouldn't it be better if you added to the mod on minetest-mods?
I havn't compared the code to see how easy this would be
but
from a player and users view I would think it more usefull when instead of duplicating features in parallel mods the mods allready adopted into a community driven maintainance system were expanded.

added to https://wiki.minetest.net/Mods:Nature anyways :-P
I've added mossmanikin mod's link for those who need support for other trees mods, thanks for telling me about it. :)

About minetest-mods (GitHub) and the duplicated mods issue, my point of view:

I believe that in minetest-mods there are just released mods, not work in progress ones, so if I am right this mod can't be added there - furthermore I don't have a GitHub account.

It is true that my mod, the mod on minetest-mods and mossmanikin's mod basically do the same thing, but there are differences between them which might let the end user choose one instead of another; e.g. this mod will support only the default Minetest Game's trees, so if you need extended support you should choose mossmanikin's; on the other hand this mod will not support cacti nodes, because I think that round trunks would not fit branched cacti.

To sum up, I think that having different different choices is better than forcing the end user on this or that mod; tastes, performance, etc.

I would like to make this mod change the buried trunk nodes to dirt nodes, this might be another little difference that one could consider when choosing.

Anyway thanks for adding my mod to the nature list :)
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.1.0] [round_trunks]

by Hamlet » Post

Lone_Wolf wrote:This looks cool
Thanks!
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Astrobe » Post

There are a several glitches caused by the fact that the model doesn't "fill" the collision box; glitches that are probably present in the other mods too. I'd like to suggest to try a "cylinder with octagonal base" (basically cut the corners of a square and extrude) as the model. It should eliminate most of the glitches and preserve the frame rate (not that I had FPS issues, but I guess not everyone has a good GPU).

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Hamlet » Post

Astrobe wrote:There are a several glitches caused by the fact that the model doesn't "fill" the collision box; glitches that are probably present in the other mods too. I'd like to suggest to try a "cylinder with octagonal base" (basically cut the corners of a square and extrude) as the model. It should eliminate most of the glitches and preserve the frame rate (not that I had FPS issues, but I guess not everyone has a good GPU).
Unfortunately I don't know how to create a model, I've never used CAD programs. If you know how, I will gladly switch to the new model.
Out of curiosity, which glitches? I'm aware that the collision box stops you where it shouldn't, i.e. corners, but I haven't noticed any else.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Astrobe » Post

Hamlet wrote:Unfortunately I don't know how to create a model, I've never used CAD programs.
So am I, or else I would have tried it myself :-(
Out of curiosity, which glitches? I'm aware that the collision box stops you where it shouldn't, i.e. corners, but I haven't noticed any else.
Yes this one is the most noticeable. It applies to mobs too. the rest is minor: water doesn't fill the node (you can see it in mangroves) and the fact that you can see e.g. an apple between a branch and a trunk, you sometimes try to pick it but your hand hits the collision boxes of the tree (maybe one eventually get used to it).
Last edited by Astrobe on Tue May 01, 2018 10:03, edited 2 times in total.

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Hamlet » Post

Astrobe wrote:
Hamlet wrote:Out of curiosity, which glitches? I'm aware that the collision box stops you where it shouldn't, i.e. corners, but I haven't noticed any else.
Yes this one is the most noticeable. It applies to mobs too. the rest is minor: water doesn't fill the node (you can see it in mangroves) and the fact that you can see e.g. an apple between a branch and a trunk, you sometimes try to pick it but your hand hits the collision boxes of the tree (maybe one eventually get used to it).
Well I could "fix" the collision issue by reducing the collision's box boundaries, leaving the node corners free (but this would also mean that mobs would pass through the trunk's outermost part); about water, there's currently no solution: that would be two nodes into one, that's not currently possible. It's the reason why there is no water flora (kelps, etc.), although they've worked around it in 0.5-dev.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Astrobe » Post

Sorry, my quotes were messed up and parts of my message didn't display.

Reducing the collision box is an interesting idea. I think I'd prefer players and mobs passing a little bit through trunks rather than seeing them "moonwalk". I'll try that and see how it goes.

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Hamlet » Post

Astrobe wrote:Sorry, my quotes were messed up and parts of my message didn't display.

Reducing the collision box is an interesting idea. I think I'd prefer players and mobs passing a little bit through trunks rather than seeing them "moonwalk". I'll try that and see how it goes.
Don't worry, typos happen; try these changes, they seem acceptable:
("0.2" are the corners, I've tried 0.25 but seems too much)

init.lua:44

Code: Select all

local collision = {
	collision_box = {
		type = "fixed",
		fixed = {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
	},
}
init.lua:123

Code: Select all

for n = 1, 5 do
	minetest.override_item(tree_nodes[n], round_trunk)
	minetest.override_item(tree_nodes[n], collision)
end
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Astrobe » Post

Hamlet wrote: ("0.2" are the corners, I've tried 0.25 but seems too much)
Back with more nitpicking ;-) 0.2 is too much because you can see "inside" the trees. Also, we have adjust the selection box. After some tree hugging, I've settled on this:

Code: Select all

local round_trunk = {
	drawtype = "mesh",
	mesh = "round_trunks_trunk.obj",
	paramtype = "light",
	paramtype2 = "facedir",
	collision_box=
	{
		type="fixed",
		fixed={-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
	},
	selection_box=
	{
		type="fixed",
		fixed={-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
	}
}
(we can do that in one override_item() pass.)
That's a minor improvement, I think.

Also, I've tried the plant-like leaves and they don't look good to me, as one can see gaps between the leaf nodes. I suggest this:

Code: Select all

local alternative_leaves = {
	drawtype = "plantlike",
	visual_scale = 1.45,
}
"gaps" start to be visible at 1.35. 2 looks nice, but the mismatch between the node and its selection box is bigger. I don't want to play with selection boxes in this case, because it might cause problems when picking apples.

The plant-like leaves look far from the distance and seem to award a FPS bonus. The cases were they don't look so good is when one stands right below a tree and look up, or when you stand on a tree and look down (I typically "jump" on top on a tree in my subgame to chop it down). Still, I like how they still get in the way when you are inside a leaf node.

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Hamlet » Post

Astrobe wrote:Back with more nitpicking ;-) 0.2 is too much because you can see "inside" the trees. Also, we have adjust the selection box. After some tree hugging, I've settled on this:
Save for the corners, I can see inside the trunk even with 0.4; the mesh is 0.5 so I fear that any value under that will give this issue.
EDIT: I didn't changed the code properly, your setting works fine.
Astrobe wrote: Also, I've tried the plant-like leaves and they don't look good to me, as one can see gaps between the leaf nodes. I suggest this:
I've tried it, but anything above 1.0 creates an issue: textures overlapping and flickering.
The worst situation is when there's an apple somewhere between the leaves, in the tree's upper part: the leaves textures overlap on the apple's.

However this made me look for an alternative drawtype (http://dev.minetest.net/Node_Drawtypes) which had an X shape, thus I've tried "firelike". Try it, I think it might be a good choice, there are no gaps between the nodes or overlapping textures, furthermore if a node has an apple above it and air below it, it only draws leaves under the apple (i.e. the leaves' node top) leaving the rest transparent (hard to explain, you've got to see it).

In my subgame I've set leaves to phantom-climbable, this prevents headbutting into them and allows to climb on trees; maybe I could add that feature as well, as another option, what do you think?
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Astrobe » Post

Hamlet wrote: I've tried it, but anything above 1.0 creates an issue: textures overlapping and flickering.
The worst situation is when there's an apple somewhere between the leaves, in the tree's upper part: the leaves textures overlap on the apple's.
I didn't notice any flickering. I guess it depends on graphics settings or hardware, which makes it unreliable and therefore not usable outside of single player games. Too bad.
However this made me look for an alternative drawtype (http://dev.minetest.net/Node_Drawtypes) which had an X shape, thus I've tried "firelike". Try it, I think it might be a good choice, there are no gaps between the nodes or overlapping textures, furthermore if a node has an apple above it and air below it, it only draws leaves under the apple (i.e. the leaves' node top) leaving the rest transparent (hard to explain, you've got to see it).
"firelike" looks more like default leaves, but apparently is lighter on the FPS and is weird sometimes. Like when an aspen is next to an apple tree, the leaves of the apple tree surround the trunk of the aspen in weird ways (well, like fire - we asked for it after all :-).

I don't dislike it, it's part of the strange things that make the Minetest world fun to explore.
In my subgame I've set leaves to phantom-climbable, this prevents headbutting into them and allows to climb on trees; maybe I could add that feature as well, as another option, what do you think?
Well in my subgame I don't have this kind of problem because one can jump on top of trees, but I did have to disable the default "hard leaves". It might make sense for MTG, but it's probably a bad default for everything else. Your alternative looks interesting but it seems to me it is a little off-topic for this mod which is primarily about graphics, not gameplay. Maybe include the related lines as comments?

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Round Tree Trunks [0.2.0] [round_trunks]

by Hamlet » Post

Astrobe wrote: "firelike" looks more like default leaves, but apparently is lighter on the FPS and is weird sometimes. Like when an aspen is next to an apple tree, the leaves of the apple tree surround the trunk of the aspen in weird ways (well, like fire - we asked for it after all :-).

I don't dislike it, it's part of the strange things that make the Minetest world fun to explore.
Yes, that drawtype behaves dynamically like fire nodes would do; I prefer it over plantlike, but I'll leave this mod using the former because ->
Astrobe wrote:
Hamlet wrote: In my subgame I've set leaves to phantom-climbable, this prevents headbutting into them and allows to climb on trees; maybe I could add that feature as well, as another option, what do you think?
Well in my subgame I don't have this kind of problem because one can jump on top of trees, but I did have to disable the default "hard leaves". It might make sense for MTG, but it's probably a bad default for everything else. Your alternative looks interesting but it seems to me it is a little off-topic for this mod which is primarily about graphics, not gameplay. Maybe include the related lines as comments?
I often forget the K.I.S.S. principle, and that other principle that tells: "Do ONE thing, and do it well." :)
I'll clean up the code some more, then I'll leave the mod as it is; by the way, thanks for your feedback and tips!
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: [Mod] Round Tree Trunks [0.2.1] [round_trunks]

by Astrobe » Post

One thing I've noted is that with firelike the leaves are not moving in the wind anymore. I've reverted to the standard leaves in the end. But thanks to this, I've discovered that firelike works pretty well with cobwebs.

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by ThorfinnS » Post

According to git remote, I cloned this from:

https://github.com/minetest-mods/round_trunks.git

but it appears to no longer exist there. I changed it subtly to make it an API, so I could put in support for runs' Cool Trees. Unfortunately, I don't know where to file a PR, since I seem to be unable to find the repo.

Any suggestions?

[EDIT]
To whom it may concern, I've pushed my changes to https://github.com/ThorfinnS/round_trunks.git
[/EDIT]

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by Hamlet » Post

ThorfinnS wrote:According to git remote, I cloned this from:

https://github.com/minetest-mods/round_trunks.git

but it appears to no longer exist there. I changed it subtly to make it an API, so I could put in support for runs' Cool Trees. Unfortunately, I don't know where to file a PR, since I seem to be unable to find the repo.

Any suggestions?

[EDIT]
To whom it may concern, I've pushed my changes to https://github.com/ThorfinnS/round_trunks.git
[/EDIT]
https://github.com/minetest-mods/round_trunks.git was not my mod: it was a mod not having its own thread.
I'll attach a .zip archive of my mod to this thread's first post.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by ThorfinnS » Post

Oh, it's accessible on the net. I was just kind of hoping this wasn't an orphan, that you were bringing it back, since for whatever reason, minetest-mods crew isn't doing anything with it.

With an optional dependency, other mods can easily opt in. For instance, locally I'm using a round_cool_trees mod which is just

Code: Select all

register_round_trunk({"birch:trunk", "birch_trunk_top.png" })
register_round_trunk({"cherrytree:trunk", "cherrytree_trunk_top.png" })
register_round_trunk({"chestnuttree:trunk", "chestnuttree_trunk_top.png" })
register_round_trunk({"clementinetree:trunk", "clementinetree_trunk_top.png" })
register_round_trunk({"ebony:trunk", "ebony_trunk_top.png" })
register_round_trunk({"jacaranda:trunk", "jacaranda_trunk_top.png" })
register_round_trunk({"lemontree:trunk", "lemontree_trunk_top.png" })
register_round_trunk({"mahogany:trunk", "mahogany_trunk_top.png" })
register_round_trunk({"palm:trunk", "palm_trunk_top.png" })
with the textures copied into the texture folder. Obviously, if runs wanted to offer round_trunks support, he'd not have to copy the texture, just put the single line into the appropriate tree's init.lua.

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by ThorfinnS » Post

Oh, wait, I think I misunderstood you. It's not that minetest-mods took over support when you abandoned it. It's something completely different. Is that what you are saying?

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by Hamlet » Post

ThorfinnS wrote:Oh, wait, I think I misunderstood you. It's not that minetest-mods took over support when you abandoned it. It's something completely different. Is that what you are saying?
That's correct.
The minetest-mod round_trunks mod existed before mine.
I didn't know that it existed because it didn't had its own forum thread.
So I ported that functionality from Real Test.
Then I just linked the minetest-mods version for those who wished to use an alternative solution.

:)

PS
I will put it back on Git as soon as possible, so if you want to fork and make an API out of it it will be easier to view the code and so on.
I would not even know where to start to make it an API.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by ThorfinnS » Post

Sure. I'll either tweak yours or you can just look at the subtle change that was required in the one on my git. In most cases, it's absurdly easy to do. Instead of:

Code: Select all

--begin main code
iterate_over_these_nodes/recipes/whatever
       codeblock_that_does_the_work
end
you just do

Code: Select all

function my_cool_new_functionality(param1, param2, etc.)
       codeblock_that_does_the_work
end

--begin main code
iterate_over_these_nodes/recipes/whatever
       my_cool_new_functionality(param1, param2, etc.)
end
Basically, just turning the codeblock into a function call lets other mods access it by including a depend and adding the code

Code: Select all

if test_to_see_whether_mod_is_installed
          my_cool_new_functionality(param1, param2, etc.)
end

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Abandoned Mod] Round Tree Trunks [0.2.1] [round_trunks]

by Hamlet » Post

ThorfinnS wrote:Sure. I'll either tweak yours or you can just look at the subtle change that was required in the one on my git. [...]
I will do, I didn't even knew about "unpack"; there really always is something new to learn. :)
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests