[Mod] More Trees! [git][moretrees]

Post Reply
User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

Hey why not you add, Coconut tree?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

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

by Sokomine » Post

Thanks for the bugfix on the vertical tree nodes! The small houses I did build for wood-traders look better now. Hopefully they can eventually be spawned and populated.
A list of my mods can be found here.

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Likwid: Palm trees have coconuts.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Inocudom
Member
Posts: 3096
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

If the jungle biome returns to Minetest, will your jungle trees appear in them and more heavily than they do normally? A jungle should be a wet place. Will the palm trees appear in them as well?
Last edited by Inocudom on Tue Feb 12, 2013 01:14, edited 1 time in total.
You can now find my videos at BitChute: https://www.bitchute.com/channel/some_cheeky_jinuskian/

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

no jungles appear in wet dirt places palm trees in beaches
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

I don't know what changes will take place if jungle trees are added back to the default game. That said, the ones provided by this mod aren't quite as prevalent as I wanted them to be. I'll fix this eventually.

In the meantime, new update just now:

Made leaves depend on the trunks they spawn with to avoid decaying rather than just any trunk being enough to stop just any leaves from decaying. Re-tuned the leaf decay interval/chance values accordingly. Changed a few variables to avoid possible conflicts. Added a setting to allow one to disable the new leaf decay code. Moved sapling growth code into its own file. Minor changes to comments here and there. Got rid of simple trees list (made the code do various checks in realtime instead, since it's just startup code anyway). Fixed messed-up crafting for jungle trees; condensed most of the crafting code into main craft registry loop. Mostly fixed broken aliases of default jungletrees.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

by jordan4ibanez » Post

Nice mod, I really like it, you should have a link to plant_lib in the main post though.
I've been gone for a long time

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

It's already there, in the "Dependencies" section.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

i have problem with saplings spawning. both default and yours, but i disabled default. tell me what info you need in order to find the solution. thanks in advance.

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

First you gotta tell me what the problem IS :-)

Moretrees saplings won't spawn on anything but sand for palms and dirt with grass for everything else.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

VanessaE wrote:First you gotta tell me what the problem IS :-)

well. as you probably fugured out (sorry for not mention the exact problem, my mind is total rubbish) saplings don't spawn.
VanessaE wrote:Moretrees saplings won't spawn on anything but sand for palms and dirt with grass for everything else.
what do you mean?

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

I mean they won't *grow* except if planted on those surfaces, sorry. They take quite a while to grow, but this is intentional, given the average size of the trees.

Are you sure you have the very latest plants_lib and moretrees? Usually when I update one, some related update has been done to the other, so you usually have to keep them both up-to-date.

Is there anything in your install that could keep ABMs from running?
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

Oh ok.

Pretty sure.

I was thinking something like that, but as far as I understand there shouldn't be an abm which could do this at all. If you could look through latest dwarves... Yes, I understand you may not have time, but just give a fast glance on mods which may cause the problem, I'll look into it more deeply, if I can.
Thank you

EDIT: do i have to have whole plantlife or is just the plants_lib is enough?

EDIT2:

Code: Select all

minetest.register_node("default:leaves", {
    description = "Leaves",
    drawtype = "allfaces_optional",
    visual_scale = 1.3,
    tiles = {"default_leaves.png"},
    paramtype = "light",
    groups = {snappy=3, leafdecay=3, flammable=2},
    drop = {
        max_items = 1,
        items = {
            {
                items = {'default:sapling'},
                rarity = 15,
            },
            {
                items = {'default:leaves'},
            }
        }
    },
    climbable = true,
    after_destruct = function(pos, node, digger)
        pos.y = pos.y + 1
        local nodename = minetest.env:get_node(pos).name
        if nodename == "snow:snow" then
            minetest.env:remove_node(pos)
        end
    end,
    sounds = default.node_sound_leaves_defaults(),
    walkable = false,
})
code for my leaves.
Last edited by Mito551 on Mon Feb 18, 2013 19:14, edited 1 time in total.

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Only plants_lib is required to run moretrees. An ABM is really the only way to handle saplings, since after a sapling grows, there's nothing to trigger on anymore in that spot. Regarding leaves, I might consider this code in future, as I do want to make sure moretrees plays nicely with the snow mod. I just haven't had much time lately.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

VanessaE wrote:Only plants_lib is required to run moretrees. An ABM is really the only way to handle saplings, since after a sapling grows, there's nothing to trigger on anymore in that spot. Regarding leaves, I might consider this code in future, as I do want to make sure moretrees plays nicely with the snow mod. I just haven't had much time lately.
Yeah, well. Since I'm keeping a game which is a whole, there is just no need to redefine all the stuff hundreds of times. OK, I'll try to look into the problem myself then. Thank you anyways.

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

Code: Select all

    minetest.register_abm({
        nodenames = {"moretrees:jungletree_leaves_red","moretrees:jungletree_leaves_green","moretrees:jungletree_leaves_yellow"},
        interval = moretrees.leafdecay_delay,
        chance = moretrees.leafdecay_chance,
        action = function(pos, node, active_object_count, active_object_count_wider)
            if not minetest.env:find_node_near(pos, moretrees.leafdecay_radius, {"default:jungletree", "moretrees:jungletree_trunk"}) then
                minetest.env:remove_node(pos)
                                minetest.env:dig_node(pos)
            end
        end
    })
why do you have this:

Code: Select all

minetest.env:remove_node(pos)
having both

Code: Select all

minetest.env:dig_node(pos)
and

Code: Select all

minetest.env:remove_node(pos)
makes game dig only air, empty space, judging by debug.

Code: Select all

ACTION[ServerThread]:  digs air at (446,34,-457)
maybe that is the problem?
Last edited by Mito551 on Tue Feb 19, 2013 15:34, edited 1 time in total.

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

The purpose of that code is to force a node update, which causes "attached" items such as pine cones to fall in the case of a pine tree. If you just dig_node() first, you end up digging a leaves node, which takes a tiny bit longer than doing a remove_node() followed by digging the resultant air. This just seemed like the easiest way to do it without any side effects.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

VanessaE wrote:The purpose of that code is to force a node update, which causes "attached" items such as pine cones to fall in the case of a pine tree. If you just dig_node() first, you end up digging a leaves node, which takes a tiny bit longer than doing a remove_node() followed by digging the resultant air. This just seemed like the easiest way to do it without any side effects.
I don't understand how that helps cones fall. Could you expand on it a bit?

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Just executing remove_node() by itself doesn't cause them to fall. Adding the dig_node() call right after is what does it, probably because that call is intended to simulate a player actually digging the node (even if it's air), which triggers the engine's attached-item-falling code and also forces the engine to update the lighting in the immediate area, which tends to be a necessity with these huge trees.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

2013-02-20: Made jungle trees more numerous and able to spread further from water, took leaves out of the avoidnodes table, there's really no reason to have them there and having them causes too much spacing between trees. Reduced the prevalence of sequoias.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
dsalt
Member
Posts: 12
Joined: Wed Feb 20, 2013 13:13

by dsalt » Post

VanessaE wrote:Just executing remove_node() by itself doesn't cause them to fall. Adding the dig_node() call right after is what does it, probably because that call is intended to simulate a player actually digging the node (even if it's air), which triggers the engine's attached-item-falling code and also forces the engine to update the lighting in the immediate area, which tends to be a necessity with these huge trees.
I think that you should be patching the engine, creating a Lua function to do just the update-triggering part of digging.

Speaking of falling items etc., I sometimes see trees suspended in mid-air. Presumably, at map generation time, soil was placed there but later removed or dropped by some cavern generation code.

It could be useful to have the game handle groups of nodes much like it handles falling sand and gravel, but retaining shape – with some ‘attached to’ information: more than just which side, though, such that adjacent leaves aren't considered connected unless they share a (possibly indirect) attachment to a trunk node. Intent is that if all in the group can fall, then and only then will they fall.

(Implementation: I'd probably have it such that both spawning node and spawned node reference each other if part of a group.)

User avatar
dsalt
Member
Posts: 12
Joined: Wed Feb 20, 2013 13:13

by dsalt » Post

[img=Trunk eaten by leaves!]http://www.moreofthesa.me.uk/minetest/moretrees-20130221-trunk-oops.jpg[/img]

Looks like one tree trunk has been ‘eaten’ by leaves from another…

(Current moretrees git; current minetest git; blossom provided by the ‘nature’ mod.)

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Patching the engine to automatically trigger the falling code is beyond my skills at this point.

Parts of the trees just randomly getting erased is indeed a cave generator bug, which is expected to be fixed soon.

About the other falling stuff, I'm not sure I understand what you're getting at - are you suggesting causing an entire tree to drop down a bit in the case of the bottom being erased?

The leaves cutting a trunk due to an oversight/missing feature in the tree spawning code in the engine, which should also be fixed soon.

offtopic: Noting your mention of nature mod, I take it that mod works okay alongside current plants_lib then? What about bushes and the others from nature pack?
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
dsalt
Member
Posts: 12
Joined: Wed Feb 20, 2013 13:13

by dsalt » Post

VanessaE wrote:Patching the engine to automatically trigger the falling code is beyond my skills at this point.
I may be able to do that; I've not looked at the relevant code, though, so I can't say any more than that.
[…] About the other falling stuff, I'm not sure I understand what you're getting at - are you suggesting causing an entire tree to drop down a bit in the case of the bottom being erased?
Basically, yes, if it's not blocked in some way. (It occurs to me that leaf blocks could be randomly broken off if they would otherwise stop the tree from falling.)
[…] offtopic: Noting your mention of nature mod, I take it that mod works okay alongside current plants_lib then? What about bushes and the others from nature pack?
’bushes’ doesn't work at present, but ‘irontrees’, ‘legacy’, ‘nature’ and ‘plants’ seem fine so far.

Code: Select all

…/bushes/init.lua:39: attempt to call global 'spawn_on_surfaces' (a nil value)
Looks like the furnace needs some tweaking – it's picky about which leaves it can use. I've not tried different wood yet.

User avatar
VanessaE
Moderator
Posts: 4529
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Moving a whole tree down is doable and not too terribly hard to detect when it needs to happen, but it would be slow given the sheer number of nodes in a tree, even if the engine did all the work.

Bushes should be easy to fix, just add "plantslib:" in front of that function call, e.g. "plantslib:spawn_on_surfaces(...."

Actually, the furnaces are fine - I just needed to add fuel recipes for the leaves (and saplings). Fixed in git.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 12 guests