Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree size variation #2026

Open
TekhnaeRaav opened this issue Jan 23, 2018 · 26 comments

Comments

Projects
None yet
8 participants
@TekhnaeRaav
Copy link

commented Jan 23, 2018

Many of the forests in minetest can start to get a little repetitive sometimes. The forests (of all types) would be much more exciting with a larger tree size variety, height, width and so on.

@Ezhh

This comment has been minimized.

Copy link
Member

commented Jan 23, 2018

Hmm, also see #1750, which is this, but for a specific tree type.

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 24, 2018

All trees do have varying height. For a single schematic width cannot be varied.
It would be good to add extra schematics for more variation, i am keen to reduce the desire for servers to add unsuitable tree mods, especially the intensive 'moretrees'.
I would like each forest to have at least 2 different trees, even if of the same species.

Apple trees could have a second size that has a width of 7 nodes and slightly taller.
Small pines of width 3 could be added.
I am working on a larger (emergent) jungletree with a 3x3 trunk, ideal for treehouses.

Remember any new species adds a new wood and therefore many new items, so different shapes of existing species is a good idea.
Since i designed our trees i'll assign this to myself for design consistency.

@paramat paramat self-assigned this Jan 24, 2018

@Fixer-007

This comment has been minimized.

Copy link
Contributor

commented Jan 24, 2018

I think I've posted another issue about that, basicly minetest game needs more trees schematics, used randomly at mapgen time.
No need to make more species, just add few (say 5) schematics for each type of tree with random variations.

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 24, 2018

Yes there's a request for random chosen schematic decorations minetest/minetest#4485
I'll need help with that, i would have coded that by now if i could.

@TumeniNodes

This comment has been minimized.

Copy link
Contributor

commented Jan 24, 2018

consider also making the lowest default_tree (or apple tree, whatever) at least one node higher.
They cause issues where the is snowfall, as well as just a pain when traveling uphill.

I agree with fixer but, even just 3 schematic variants per tree would suffice. They could be labeled "young", "mature", and "old"?
The young trees could be what currently exists, the mature a taller variety, and the old is when the width kicks in
This will make it easy to keep the current trees assigned at higher elevations because IIRC going much taller can create a cutoff at certain elevations? (I may be mistaken)
(just some suggestions)

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 25, 2018

Trees can be up to 16 nodes tall before they need to be restricted in altitude.

@4w

This comment has been minimized.

Copy link

commented Jan 26, 2018

Since we have L-system trees do we even need schematics?

@MarkuBu

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2018

L trees are still buggy and slower than schematics

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 26, 2018

L system trees are not yet designed to be added during mapgen, as each one has a separate light update. Even if that is fixed, as is intended, they are intensive and slow due to the generation method.
Schematics are essentially a small volume of world database, just mapnodes with nodename, params 1 and 2, so load in almost as fast as world does.

@TumeniNodes

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2018

I was thinking about all of this last night, and a thought popped into my head.

What is the possibility of looking at sapiers old "growing_trees" mod (I think addi has modified it some)

But, just looking at the code, and seeing if the normal "tree" nodes could be used rather than the current nodeboxes it uses (though I have to say I do prefer the nice branches etc) but, even those could be reworked to use cubic style, opposed to the current round.

That mod produces a variety of tree sizes
(Just a thought to pass by here) it could be a profitable venture (not in terms of monetary)

link: https://forum.minetest.net/viewtopic.php?f=13&t=978&hilit=growing_trees

[edit] I should mention I do not mean to use the "growing" aspect, as this would be extremely hard on resources. Just the layout/schematic style of the trees

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

It uses a sequence of node additions to create a tree, the initial tree is placed as a small 2-node structure and the ABMs then grow it step by step. So to create complete trees on mapgen each tree would need to progress through many growth steps, this makes it similar to L-system and no less intensive, too slow for mapgen.

@TumeniNodes

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2018

This is why I mentioned modifying the growth system to more match what is used now, and other tweaks. Not focusing purely on how the mod itself is written, but looking beyond that to figure a way to make it integrate with the current trees.lua

I was looking more about the full tree results

I have to look at it more thoroughly

@Ezhh

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

For small variations, can't we randomise the height the schematic is placed at relative to ground level? I know this wouldn't give us big variations, but it could help.

(I'm not sure if this is already being done somewhat - because I do see some variations in height, but surely there could be more?)

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

Tumeninodes, yes that's what i mean, on mapgen each tree would be rapidly progressed through many growth stages to become instantly full-grown. This is exactly what L-system does, so would be much slower and much more intensive than current schematics. A variety of schematics is a much better idea.

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

For small variations, can't we randomise the height the schematic is placed at relative to ground level?

Random 'y offset'? That would be identical to the already present trunk height variation. Currently each schematic has horizontal slices randomly removed to alter structure and height.

@Ezhh

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

Doesn't seem to do much though; surely more variation could be produced? I am thinking of the way you added roots to emergent jungle trees - part of the schematic can be concealed underground where needed to provide greater possible variation.

@paramat

This comment has been minimized.

Copy link
Member

commented Jan 29, 2018

I could add a little more variation to some trees.
Appletrees have as much as they can, if the trunk gets any longer they will look out of proportion.
Acacia only has 1 node of height variation, i'll make it more.
You can see the 'y slice probabilities' here https://github.com/minetest-mods/saveschems/blob/master/init.lua
Adding to my TODO list.

@paramat

This comment has been minimized.

Copy link
Member

commented Feb 15, 2018

I looked through all trees again, many have a fair amount of variation already:

Aspen variation 5. Has a maximum height dictated by needing to be significantly shorter than both jungle tree and pine. Any more variation will make it too low to walk under.

Acacia tree variation 1. PR #2049 increases this to 3.

Apple tree variation 2. Any higher will be unsuitable for it's form. Any more variation will make it too low to walk under.

Jungle variation 4. These are intentionally high without extreme variation to create the canopy. I could add another node of variation.

Pine variation 5. I can make the maximum height 1 node higher and also add another node of height variation.

@paramat

This comment has been minimized.

Copy link
Member

commented Feb 15, 2018

More height variation in #2049

For randomly selecting schematics we need engine feature minetest/minetest#4485

@Fixer-007

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2018

I looked through all trees again, many have a fair amount of variation already

It is not just height, but also shape and branches of those trees.
default

@Fixer-007

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2018

I still don't get it, can't you have several tree schematics as of now, here is code I found in MTG:

function default.grow_new_apple_tree(pos)
	local path = minetest.get_modpath("default") ..
		"/schematics/apple_tree_from_sapling.mts"
	minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
		path, "random", nil, false)
end

and this function:

	minetest.register_decoration({
		deco_type = "schematic",
		place_on = {"default:dirt_with_grass"},
		sidelen = 16,
		noise_params = {
			offset = 0.036,
			scale = 0.022,
			spread = {x = 250, y = 250, z = 250},
			seed = 2,
			octaves = 3,
			persist = 0.66
		},
		biomes = {"deciduous_forest"},
		y_min = 1,
		y_max = 31000,
		schematic = minetest.get_modpath("default") .. "/schematics/apple_tree.mts",
		flags = "place_center_x, place_center_z",
		rotation = "random",
	}) 

And instead of one path, just insert a function that randomly chooses "/schematics/apple_tree_1,2,3,etc" from provided list?

@paramat

This comment has been minimized.

Copy link
Member

commented Feb 16, 2018

I looked through all trees again, many have a fair amount of variation already:

Here i was referring to height variation.

'grow new apple tree' etc. are sapling growing functions, nothing to do with mapgen.

In the decoration registration if you had a random path that random path would be randomised once only on registration, so only 1 schematic would be used.
Random schematics are high priority will try to code that.

@paramat

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

#2049 merged but keep open for other requests.

@paramat

This comment has been minimized.

Copy link
Member

commented Mar 3, 2018

screenshot_20180303_234150

Experimenting with small pines.
I like these, will probably add as a second pine, and use noises to create a varying mix.

@paramat

This comment has been minimized.

Copy link
Member

commented Mar 4, 2018

screenshot_20180304_162445

Smallest and largest.

screenshot_20180304_163315

These are lovely, can't wait to add them.

@paramat

This comment has been minimized.

Copy link
Member

commented Mar 11, 2018

#2068 merged.

@paramat paramat removed their assignment May 15, 2018

@paramat paramat self-assigned this Sep 14, 2018

@paramat paramat removed their assignment Mar 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.