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.
Darmo

Sapling spawns should be limited to nearby trees (Especially Willow)

11 posts in this topic

I'd suggest that the natural sapling spawning mechanics have some limitations.  Mainly that they only spawn near trees of their own type.  I've tried to observe the nature of sapling generation so far in my world (my first long term one).  I don't believe this mechanic is in now but if it is, feel free to just delete this topic.

 

Specifically, I think when the game thinks to itself 'lets put a sapling here', it should check to see if any of the native trees for that biome are nearby.  If there are no native trees nearby (my understanding is there can be a max of 3 native trees in each biome, though they can all come up the same type) then no sapling is placed.  Maybe 40 blocks or so.  This would especially help with creeping willow forests, where you return from a mining trip and suddenly wondering if you've arrived at Helm's Deep by mistake, or wake up in the morning in your house, look out the window, and realize how Saruman felt.   As near as I can tell right now, the native saplings can spawn anywhere, regardless of what trees are (not) nearby.

 

In fact, I think willows should have a further limitation of only spawning within a similar limited distance of fresh water, and moreover perhaps even planted willows should not grow beyond that distance.  This would both keep willows under control and keep them a bit more limited.  If you live in a willow forest area right now, it seems like charcoal is no problem at all, and that feels a bit wrong.  I think at least 2 of the three tree slots for my biome came up willow.

 

But in general this mechanic would make it so that the player could deforest their area if they're not careful.  It would give some incentive to leave some native trees about rather than clearcutting, if one doesn't want ot manually plant the saplings.  Or, if one wants controlled forestry, they could clear out the native trees and only plant non-natives.

0

Share this post


Link to post
Share on other sites

Saplings spawns are 100% determined by the type of trees that could spawn in that area in world generation. You will only ever find sequoia saplings in an area that A.) Had sequoia trees there when generated or B.) Has sequoia trees there as one of the 3 tree data layers of the area, and the climate has changed so it is now within sequoia parameters.

 

Edit: Saplings regenerating regardless of if there is trees in the area was explicitly added to prevent deforestation of the standard trees. To simulate the actual problems of deforestation, there are acacia and kapok trees, which have no saplings.

Edited by Kittychanley
0

Share this post


Link to post
Share on other sites

Right, but my point is the actual spot it wants to put a specific sapling should have another tree of the same type within a certain distance.  It seems right now like they can spawn anywhere they like in the biome.  It makes it hard to control undesireable trees (like willows) because the saplings appear out of thin air even if you've cut the rest of the willows back a hundred blocks or more, and running around checking for saplings is sort of annoying. I figured requiring an actual tree of the same species to be nearby was both realistic and would allow for a bit better forest control.

0

Share this post


Link to post
Share on other sites

It's actually somewhat the opposite. Saplings won't generate within range of other trees to prevent super dense forests. There's a post somewhere that I've listed out everything you can do if you don't want to keep clearing saplings, let me see if I can go find it.

 

 

 

If you're talking about the saplings and tall grass regrowing, this is intentional because straw is required for pretty much your entire lifetime, and to help with deforestation. Especially on servers, areas tend to get cleared out really quickly, making it really hard for newer players to gather those essential starting materials if they don't have some way to regenerate. Note that it makes sense for the saplings and tall grass to regenerate, but not for the rocks to regenerate as erosion would take a very very long time to expose more rocks, and it would be a way to exploit the fact that some of those rocks are ore. The saplings regrowing is also the only way to obtain saplings for some of the trees such as sequoia, and without the saplings regenerating every single sequoia tree you chop down will just decrease the number available.

 

Also keep in mind that there already are special requirements in place in order for the tall grass and saplings to grow. For example, if the rainfall is too low or the temperature is too cold, or the grass blocks don't have enough access to sunlight, nothing will grow. Saplings also need proper space in order grow into trees, and they have to be planted for a fairly long time before actually turning into a tree, which gives you more than enough time to pick them up if you don't want them to grow. We've also taken steps to make sure that when a tree does grow, it doesn't destroy buildings or replace any essential blocks.

 

If you are tired of having to mow your lawn, you really have two options:

  • Move to a colder climate. One of the trade offs of a warmer climate and longer growing season is that you have to deal with grass and saplings regrowing too.
  • Make a pair of shears and harvest a bunch of short grass to cover your lawn with. If there is short grass in a spot, tall grass or a sapling cannot grow there.

 

 

Before answering all of these directly, I'll try to explain who the mechanic works as a whole. Let me know if I missed anything and if you still have questions.

 

Sapling spawning is handled primarily within the code of grass blocks, and therefore only occurs when a grass block has received a random tick (similar to what triggers grass spreading). When the block triggers, it first checks if it able to directly see the sky. If it cannot see the sky (even if it is blocked by just leaves), nothing will happen. The grass block then checks that it is regular grass, and not dry grass, that it is not underwater, and that there is an air block above it. Finally it checks to make sure that the temperature is higher than 20, and it runs a random number generator, with a 1 in 15,000 chance of spawning a sapling. If the RNG is successful, it calls a specific method to determine what kind of sapling to spawn. This method first checks if the sapling will have space to grow. It scans 8 blocks in each direction (NSEW) and 6 blocks up. If within this scan a trunk of a tree or another sapling is found, it exits and no sapling is generated. If there is space, it runs another RNG to pick which tree type it should spawn. For the three different tree types, the chances are 40/30/30, so the primary tree has a very slight preference than the other two. The sapling will also only spawn if the climate is correct for that type of tree to generate there, meaning that if you've never seen that tree in the area on world generation, then that sapling will not spawn.

 

So to answer your questions:

  • All saplings are weighted equally, sequoia is no more likely to spawn than willow as a whole. Either sequoia is one of the tree layers and was found there naturally on world generation and the sapling will spawn, or it wasn't, and it won't. Keeping the chunks loaded is indeed necessary as it requires the grass blocks to receive random ticks. Rather than focusing specifically on spring-summer months, keep an eye on the temperature. If it's 20 or lower, don't bother hanging around because the saplings will not spawn.
  • The primary/secondary tree will have a slight effect on which sapling spawns, but not much, and they will both spawn.
  • Yes. The grass block requires direct line of sight to the sky (which could be blocked by sequoia leaves) and it cannot be within 8 blocks of a sequoia trunk.
Edited by Kittychanley
1

Share this post


Link to post
Share on other sites

I actually like this feature and find it realistic and believable. You do not need to have a Oak tree in your backyard to see little Oak sapling sprouting from the ground. How they get there? many ways, squirrels, birds whatever. If the new trees are a bother for you in your town? just see then as maintenance, have an empty charcoal pit ready and go around town chopping down the unwanted trees.

0

Share this post


Link to post
Share on other sites

Ok, I guess if this was put in as a feature, I'd best defer to those with a lot more experience then me - I was mainly concerned about willows and I'd still suggest their natural sappling spawns limited to a certain radius of water - they are irl a very water-needy tree.  In TFC they're a dangerous tree given the amount of shade they provide, inhibit travel, and have an annoying habit of overshadowing my crops.   I even once chopped one down, warily trying to figure out where was the skeleton I was hearing, and lo and behold he was on top of the willow, plopped down in front of me and killed me!  (Ok that one was actually humorous)  They also ruin majestic vistas, and made it easier to get lost until I finally got a map mod, because they change/obscure the landscape so drastically.  Other trees are much less a problem.  With all the talk of tree farms I see in videos, I didn't think deforestation was such a problem. 

 

I would say though that irl most trees don't just show up randomly miles from others - TFC is a compressed scale so I was thinking in a relatively compressed scale.  Similar to how the vertical 'scale' (in terms of the temperature simulation) increases the higher you go, in a non-linear fashion, from what I understand.   I was imaging the TFC world to be maybe 1/10,000 real world?   So when I suggested 40m radius, that'd be like over 200 miles irl.  Kind of.  I know that logic breaks down at some point, but the point is the worlds are not 1:1 scale.

Trees spread by birds can spread long distances (cedars and mulberry notoriously where I live)  But most I think don't spread like that.  Squirrels live in trees, so you won't find oak saplings sprouting beyond the range a squirrel will go from their trees, which is not terribly far if they can help it.  A lot of trees spread through wind, like maples, but those don't really go all that far unless they happen to drop during a windstorm.

 

Thanks for those detailed explanation of spawning though Kitty.  I tried searching for sapling posts but did not pick up on those explanations.  I had picked up that trees won't spawn within a certain radius of one another, but I think it works better for other trees than willows, because they have such spread, that even this limitation still makes for a pretty dense willow forest.

0

Share this post


Link to post
Share on other sites

The water requirement for willow trees is actually already accounted for in the climate spawning requirements. Climate isn't just temperature, it's also rainfall and evapotranspiration. Willow trees have the highest possible values for minimum and maximum required rainfall and the lowest possible values for minimum and maximum evt, so essentially they will only ever spawn in what would be considered the wettest climate that can generate.

0

Share this post


Link to post
Share on other sites

Ya, I figured they had a pretty high climate moisture requirements.  I think I treked through 3km of arid forest and plains to get to my settlement spot and didn't see them on the way iirc.  I was actually super happy when I first found them as they're easy to harvest twigs from, and give lots of wood.  They were one reason I chose to settle where I did.   It was only later their insidious nature became apparent. 

 

I'll just make one more case:  I'm not suggesting natural sapling spawning be removed. Just that it has another limit.  TFC already takes liberties with a lot of things (128 smooth stone blocks in a vessel) for the purpose of the overarching goal of the game - allowing the player to build things they want.  Folks like to create their buildings, and also I think, a certain plot of ground, a certain vista.  I picked 40 blocks as a multiple of 8 - I thought it might be convenient, but certainly could be more.  (How far do chunks even load from the player?)  All a player would have to do to maintain natural tree spawning would be to have the natural biome trees planted every 80 (or whatever) blocks or so.  Which to me seems simple enough.  It wouldn't be taking anything from people that want natural spawning.  

 

But requiring the same tree be within a certain range would also allow the player to manipulate the environment and maintain their certain setting if they so desire, and keep out undesireable trees.  I would expect the lower limit of spawning to be what, 5 blocks from another tree? (I often see willows that have overidden the leaves of a nearby tree).  Easily leaves another 30+ radius (60+ between two of the same) for them to spawn in. Wouldn't require any new graphics or anything.  Just, I would think, a couple dozen lines of code? 

 

I thought it a small thing to give players more control over their build, which I think they'd like, and still allow them to easily maintain a large area for natural sapling spawning if that's what they desire.  It would also allow them to remove a source of aggravation for some - aggravation which doesn't really serve any other purpose imho.   That was my thought process.  More player control over their creation, for what I thought would be a minimal time effort for coders.  Farily realistic mechanic. Now if running around swatting saplings is considered one of the challenge mechanics of the game, ok then.  Otherwise I thought it a good idea that gives options without taking the existing away.

0

Share this post


Link to post
Share on other sites

Willows that have "overridden" the leaves of other trees should be initial world generation only. They should not be doing that when growing from saplings. The idea of "keeping out undesireable trees" seems a bit off to me, considering there literally can only be 3 types of saplings spawning there, and the vast majority of the time, those trees were already there on world generation. If you don't want a specific tree popping up around your base, don't build your base on what used to be a forest of those trees.

 

Non-native saplings spawning will not happen. Tree farms are OP enough as it is, if it's not native you will always have to gather and replant the saplings. As stated in my above posts, there are already measures that you can take if you don't want saplings to keep popping up on your lawn. The simplest of these is to go make a pair of shears, gather a whole bunch of short grass, and cover your lawn with that. Saplings can only appear in spaces that are air blocks. If you haven't chosen a home base yet, you can take into consideration the fact that saplings need the fairly warm temperature of 20C before they will appear. So if you don't want saplings showing up, you can set up base in an area with a colder climate. Saplings also won't generate on top of dry grass, so you can pick an area that has dry grass to set up your base. There's also the fact that the game looks around for nearby naturally grown logs of trees and won't generate a sapling if there is one nearby. That scan isn't just level, it's also up and down. So you can dig a hole, grow a tree, chop down everything but the bottom log and then cover it back up with dirt and no saplings will ever appear within 8 blocks X and Z and 4 blocks up.

 

*Edit: Screwed up the range on logs. The sapling itself scans 8 blocks +/- for X and Z making a 16x16 block square, and it scans 3 blocks below itself and 5 blocks above it.

Edited by Kittychanley
0

Share this post


Link to post
Share on other sites

Non-native saplings spawning will not happen. Tree farms are OP enough as it is, if it's not native you will always have to gather and replant the saplings.

It was never my intent to suggest non-natives spawn naturally.  Sorry if I gave that impression somehow.

 

There's also the fact that the game looks around for nearby naturally grown logs of trees and won't generate a sapling if there is one nearby....The sapling itself scans 8 blocks +/- for X and Z making a 16x16 block square, and it scans 3 blocks below itself and 5 blocks above it.

That's interesting. That could definitely help.  I'm kind of attached to my base area already due to the work put in.  Thanks for all the info!

0

Share this post


Link to post
Share on other sites

Saplings spawns are 100% determined by the type of trees that could spawn in that area in world generation. You will only ever find sequoia saplings in an area that A.) Had sequoia trees there when generated or B.) Has sequoia trees there as one of the 3 tree data layers of the area, and the climate has changed so it is now within sequoia parameters.

 

Edit: Saplings regenerating regardless of if there is trees in the area was explicitly added to prevent deforestation of the standard trees. To simulate the actual problems of deforestation, there are acacia and kapok trees, which have no saplings.

 

Woah, I didn't know that the climate could change.

0

Share this post


Link to post
Share on other sites