cuberite / cuberite

A lightweight, fast and extensible game server for Minecraft
https://cuberite.org
Other
5.02k stars 640 forks source link

Too high probability of big tree growth #4560

Closed Xenoxis closed 1 year ago

Xenoxis commented 4 years ago

Client version: 1.12.2 Server OS: Ubuntu Server 16.04 i386 Cuberite Commit id: 2b32bb0b1928704499aa187ed3bff7433264e742

Expected behavior

Less big trees growth, more normal trees

Actual behavior

In my sense, the probability of getting a big tree growth is too high, indeed, approximatively more than one of two trees on approx 100 trees planted are big trees, which is a lot !

Steps to reproduce the behavior

Plants lot of trees

madmaxoft commented 4 years ago

Do you have any statistics for vanilla? Otherwise there's nothing to compare to.

Xenoxis commented 4 years ago

Yes you're right, i don't have any explicit numbers to give you :( But try to experiment it on cuberite server and then on vanilla, you should see a difference.

mathiascode commented 4 years ago

Tree type? What counts as a big tree in this case (there are the really big ones when placing saplings 2x2)?

Xenoxis commented 4 years ago

No, by "big trees" i mean Oak ones with branches, not ones in jungles or with 2x2 blocks base The probability to get ones with branches is too high i think, in comparison with vanilla behaviour

dead-like-roses commented 4 years ago

Can I take probability from original minecraft source or should I just test it?

dead-like-roses commented 4 years ago

@Xenoxis I tried reproducing it and I really can't

madmaxoft commented 4 years ago

You shouldn't look at the vanilla sources at all when developing Cuberite (for legal reasons).

There doesn't seem to be any data in the minecraft wiki regarding the probability of a larger (branched) trees. We assume that the probablility is the same for growing trees from saplings as it is for generating the trees in new chunks; this has been guesstimated at 3/16 (18.75 %): https://github.com/cuberite/cuberite/blob/d0f38f52cbd97828d9cadaf12d33c886b8d00383/src/Generating/Trees.cpp#L397-L404

mtan37 commented 4 years ago

Anyone actively working on this? I am new and want give it a shot

12xx12 commented 4 years ago

Hi, thank you for your interest in the project.

There is no open PR at the moment so go ahead.

If you need further help feel free to ask. Either her or on the discord or forums.

Stefan-TU commented 2 years ago

Hi, how does this issue look?

mtan37 commented 2 years ago

@Stefan-TU I am no longer planning to work on this, feel free to take it

tonitch commented 2 years ago

following this page https://www.minecraftforum.net/forums/minecraft-java-edition/survival-mode/223343-tree-science-definitive-guide-up-to-date-for-1

it should be 1/10 chance of big tree (so more like 10%)

LhAlant commented 1 year ago

There doesn't seem to be any data in the minecraft wiki regarding the probability of a larger (branched) trees. We assume that the probablility is the same for growing trees from saplings as it is for generating the trees in new chunks; this has been guesstimated at 3/16 (18.75 %):

I don't understand why the probability is 3/16. From the snippet of code you profided, a small tree will be spawned if the noise returns something less than 0x60000000. The IntNoise3dInt function returns an integer from 0x00 to 0x7fffffff. Shouldn't the probability of a large tree spawning be of 1 - 6/8 = 25% ?

https://github.com/cuberite/cuberite/blob/7e83dd073e0bc322b975df66d061a6f7fe059bf1/src/Noise/Noise.h#L254C1-L259C2

Anyway, if my math is right, this is an easy fix, just changing the 0x60000000 constant to 0x73333333. to match the 10% found by @tonitch

following this page https://www.minecraftforum.net/forums/minecraft-java-edition/survival-mode/223343-tree-science-definitive-guide-up-to-date-for-1

it should be 1/10 chance of big tree (so more like 10%)