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

User avatar
Hamlet
Member
 
Posts: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Sat Apr 28, 2018 12:11

Image
Turns cubic tree trunks into cylindrical.
Ported from "RealTest" viewtopic.php?id=2671

Alternatively you can use this version: https://github.com/minetest-mods/round_trunks
That isn't mine; it supports cactus trunks, doesn't allow changing the leaves' shape.

If you need compatibility with other trees' mods, try this: viewtopic.php?f=11&t=6111

Version: 0.2.1
Source code's license: GPLv3
Model's license: GPLv3
Textures' license: CC BY-SA 4.0 International
Release 0.2.1: slightly reduced size to prevent the "moonwalking" mob effect, code cleaning.

Dependencies: default (found in Minetest Game)

Optional feature: turns leaves' shape from cubic to "X" shaped (papyrus like).
To activate it: Settings -> Advanced Settings -> Mods -> Round Trunks

Downloads:

Archives: .zip .tar.gz
Source: https://notabug.org/Hamlet/round_trunks

Installation

Unzip the archive, place the folder 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 Sun Dec 09, 2018 17:30, edited 9 times in total.
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

User avatar
Lone_Wolf
Member
 
Posts: 2177
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

User avatar
GreenDimond
Member
 
Posts: 1267
Joined: Wed Oct 28, 2015 01:26
Location: SCP-3008
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond
 

User avatar
Hamlet
Member
 
Posts: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Sun Apr 29, 2018 10:01

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.
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by twoelk » Sun Apr 29, 2018 10:56

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: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Sun Apr 29, 2018 12:04

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 :)
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

User avatar
Hamlet
Member
 
Posts: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Sun Apr 29, 2018 12:16

Lone_Wolf wrote:This looks cool


Thanks!
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by Astrobe » Mon Apr 30, 2018 17:21

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: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Mon Apr 30, 2018 18:45

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.
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by Astrobe » Mon Apr 30, 2018 23:32

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: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Tue May 01, 2018 06:50

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.
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by Astrobe » Tue May 01, 2018 10:17

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: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Tue May 01, 2018 12:26

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
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by Astrobe » Fri May 04, 2018 15:57

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: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Fri May 04, 2018 18:10

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?
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by Astrobe » Sun May 06, 2018 11:00

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: 499
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

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

by Hamlet » Sun May 13, 2018 10:46

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!
"It is not necessary to hope in order to undertake, nor to succeed in order to persevere." (Unknown)
 

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

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

by Astrobe » Sun May 13, 2018 14:05

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.
 


Return to Mod Releases



Who is online

Users browsing this forum: TenPlus1 and 3 guests