Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
Balthizarlucien

Dynamic Tree Growth

6 posts in this topic

TFC Dynamic Tree Generation

I wanted to make a suggestion regarding how trees are generated in TFC. Right now the diversity in shape that the trees have is really good but you still occasionally get trees that spawn weird. When you are generating a world and spawning in pre-made trees you are always going to get things like trees that spawn to close to cliff sides or trees that spawn in spots that would normally be to shady for them etc. There is little room for improvement to this type of tree generation which is why I will leave well enough alone in regards to these types of trees.

Growing trees that come from spawned in saplings on the other hand do not need to be as ridged. Within the TFC world we have examples of trees which are mildly dynamic. Fruit trees grow in stages by slowly adding a branch here or a trunk there based on some determining function.

So what are the components which make up a tree? I am sure we can all agree on the following list:

Leaves

Branches

Limbs

Trunk

Roots

But these are not what make up a tree in Minecraft. Here is a list for the standard Minecraft tree:

Leaves

Trunk

Seems a bit too simplistic doesn't it? How about a fruit tree in terrafirmacraft? This is in fact the tree I am saying is a better model, right? Well here is its list:

Leaves

Branches

Trunk

Just one extra block and we already have a major improvement on the vanilla tree because it shows some basic level of structure. But none of these trees have a foundation nor are any of them dynamic in any way. With fruit trees the lack of variation is even more pronounced than it in in the vanilla tree because every fruit tree is precisely the same shape and every tree is also the same diameter.

How can this be improved? Will increasing complexity mean that we will be increasing processor lag too?cause that's not cool man!

Don't worry because honestly the answers have been hidden within even Minecraft's core code since they introduced blocks that connect dynamically like fences for example. I actually am also not the first person to notice this because I read this forum post [ http://www.minecraftforum.net/forums/minecraft-discussion/suggestions/84568-improving-trees-and-player-behaviour-around-trees] a while back but heard nothing further about any development being done. The post had solid ideas for tree growth as well as seasonal changes etc but there was a few things of importance missing so let me layout my idea using the current TFC environment and block statistics to demonstrate my concept for you.

What information does a block in Minecraft store apart from its position? Quite a lot actually. It can store its type, light level, hydration and with TFC it also can represent three distinct nutrient levels. All of these factors can directly impact how the tree chooses where to grow. Each category can also hold a specific value from 0 to 16 as well. Trees need food from the soil (nutrient type based on tree type), water (hydration value based on type), and most importantly light regardless of type.

A tree should have each type of block I listed initially and they should be placed correctly to make the tree look right as well. Every block in Minecraft has 6 sides which means there are 5 potential connection points from which a new block can spawn but we can simplify this by adding specific limiters to every part of the tree or tree block type. We can also reduce the potential for strange generation by restricting the origin point block by type and ensure we do not end up with a trunk block floating amongst the branches. Lastly, to ensure each type of tree looks like it is supposed to there should be a type modifier present for each decision made by the growing tree.

Now to the nitty gritty. How does all of the above correlate to create a dynamic tree? I will explain by walking you through the growth of a tree. Let's say it is the quintessential oak we all know and love from vanilla.

Let me introduce bill the oak tree. Bill, like most of his family loves to grow tall and spread his limbs wide to gather as much sunlight as possible. Bills family is also known for having broad strong trunks in their old age as well as massive but shallow root systems that cover beyond their leafy crowns like fingers hungry for nutrients but right now bill is but a tiny sapling.

[translation: horizontal growth received a slight modifier over vertical growth, both are preferred over downward and the height limit and limb length in perfect conditions is preset to a fixed block count of 43 blocks tall and 22 blocks from the trunk to the end of the branch]

The first job of a sapling is to expend their energy growing a deep taproot looking for ground water. Bill's taproot can range anywhere from 8 - 12 meters deep unless rock is found first but rock is ok because rock layers usually collect the water bill is looking for anyway. You see, bill is a very thirsty sapling and without his water he will die.

This taproot is like Bill's underground trunk. It varies in size just as the trunk above ground does but doesn't care about the light level at all. Once bill has found either rock or significantly moist soil he begins to stretch his branches.

[translation: depending on the tree species the moisture level requirement will vary slightly but the roots will behave the same as the branches above. They will weight the nutrient level and moisture level of each neighboring block to determine which block will be converted from fine roots (underground equivalent to leaves) to simple roots from simple roots to medium and from medium to large following the same growth formula as the branches above except using hydration and nutrients to drive growth rather than light.]

As Bill grows and adds more leaves he begins to lean away from the shade of the other trees so he can get to the precious sunlight. He does form a bald spot on one side because Bill isn't going to waste time trying to keep those leaves alive when they do so little for him.

[translation: at every growth tick the tree measures the light levels of the faces of the leaf blocks to find the highest light value available. If that light level is above the threshold of growth then the original leaf block converts to a branch and spawns leaves on four of the five sides leaving out the bottom. If a branch block has a neighboring leaf block convert to a branch it subsequently converts itself to a limb block. If the limb ends up with a limb branching off it will convert to a trunk segment. If a trunk block has another trunk sprout off of it then the trunk shifts from a 1x1 to a 2x2 and so on down the line depending on its species and their max girth.]

Now that bill is old enough he can start producing acorns. These seeds will be the next generation of his family but they are also food for many of the wild animals that call Bill home. Even though bill grew slightly askew and bald on one side he looks amazing and he is especially proud of his leaves as he drifts off to sleep for the winter.

[translation: each tree produces seeds in some way and each has their own germination rate as well as potential for food. The oak drops acorns which are delicious roasted whole or roasted then ground into flour. The leaves of any tree should continue to change color but should be able to phase between two textures minimum; leaf buds and fill leaves. The leaf bud block would be almost completely transparent where as the full leaves would be a thick canopy.]

I hope you could make sense of what I am talking about with the story of Bill. Each tree in nature is unique and special but the majesty of a forest is sometimes lost within Minecraft because of sameness.

2

Share this post


Link to post
Share on other sites

I just Love all this. I specially like the idea of incorporating acorns, Is part of an old suggestion I made. 

1

Share this post


Link to post
Share on other sites

Amazing post! This would add so much diversity to the landscape.

If you cut down a tree you will be still left with its trunk, which you need to remove, depending on size either with a shovel or a blackpowderbarrel :D

1

Share this post


Link to post
Share on other sites