And I maintain that CTD due to running out of memory is due to poor programming (not checking the pointer returned after allocation because you [implicitly] assume you'll never run out, which a CTD proves was an incorrect assumption), as well as tree generation for the embark would have very little effect on the memory consumption. Any embark that would run out of memory due to tree generation on embark would run out of memory very shortly after embark as items are produced, if there is any memory effect at all.
Let's see if I can summarize what I think GoblinCookie is saying, including some unstated inferences (which I may have gotten wrong, of course).
A. Embark tree generation is the way it is because that's what the embark looks like in adventure mode, which also means the tree generation process is/was the same (I would assume the tree generation either took place during world generation, or, quite possibly, dynamically as an adventurer or embark party enters an area for the first time).
B. There is some kind of tree competition radius that can/will kill off saplings within it over time, if the saplings don't hurry up and mature before getting throttled. It's unstated/unknown what this radius is, what the "mature at the same time" time window is, and if the radius is dependent on tree species, biome, both, or is fixed.
1. Yes, basically. The reason we start of with so few trees (and so small and boring ones) is not that the devs wanted it but that the memory constraints of modelling the realistic growth of all the forests in the world would crash the game. The present situation where the number of trees rapidly increases until we end up with a proper forest is a compromise between what the devs would like (a realistic spread of trees) and the memory constraints preventing those trees from simply being already there.
2. That is definately the case. What I am unsure of is whether the kill radius is anything other than the area in the shade of the tree but it appears to be the case that the map is randomly divided up into forested and non-forested zones, with trees only growing in the former.
I don't buy that how it currently works is intended even if it is the result of mechanics implemented by the devs. You would expect a range of sizes and ages represented in the trees of an active ecosystem.
Somebody other than the devs clearly did not implement the mechanics Vattic. Since it obviously not what the devs wanted to have, it is clearly something they were forced to do by the memory constraints of world-gen. The way that the trees expand rapidly after embark is clearly intended as a compromise between the number of trees that the devs were able to implement and the number of trees they wanted to be there.
Trees are just a drop in the bucket for the embark size issue. There are 100+ z-levels worth of tiles for every single surface tile.
At the moment there is nothing between world-gen and embarking. This means that the total number of trees that we want to be there have to be created everywhere at once in order for us to be able to embark in a particular place and see those trees. The more trees there are, the more memory is required to generate them in world-gen potentially causing that to CTD and the more memory is required to load the map in the first place since all that information has to be transferred to render the embark area, the more detailed our forest the more information we have to transfer.
The only solution is to have a seperate embark gen between the two, a replay of the world history of that particular map area in order to populate it with trees and other details appropriate to the area without those things having previously existed outside of the world-gen.
That's not very convincing. It's just as likely the tree growth is overzealous. The size of the trees doesn't seem relevant other than to point out it doesn't consider age (or that the increased sizes were causing problems with placement.)
I would instead assert that tracking the density of trees after embark is more difficult than creating a spread of trees from scratch. It also takes years in-game to test the end result. IMO, the fault is more likely to lie here.
If it were easy the devs would have already done it Bumber.
I have concerns that the search area might not be able to be increased much without performance hits (as a square area is 2xN^2 the kill distance.) In addition, any randomization in the growth area (too tired to think of example) would have to be stored for consistency. Furthermore, player orchards would be either fixed to this density, or have no effect on the health of the nearby trees (beyond the distance limit) when packing a bunch together.
We already have randomised tree-growth and no-tree growth areas on the map randomly generated. Players who plant their orchard trees too close together would suffer the consequences, I cannot see how that is anything but realistic.
II don't see that as an issue. If you have a bunch of nearby trees, they're still taking the resources. Furthermore, it's a good thing since it varies tree placement, giving you something like this. In the kill-zone model, those trees are too close to one another. Any density that allowed that would end in this throughout the zone. The result is also dependent on zone size. Larger zones offer more flexible placement. Map features are currently divided into 16x16 tile areas, so take that how you will.
The trees are not taking the resources from randomly designated zones but from the general area around them within a given distance. Kill-zones is a realistic depiction of this, tree-caps within arbitery zones is not.
Being devoid of trees is a result of no trees being defined for a biome. It has nothing to do with kill zones.
Indeed it doesn't have anything to do with kill zones, that is what regulates the density within the areas of the map where trees are allowed to grow. The biome itself is however divided up into random patches, some of these allow trees to grow in them and some of them do not. This means that if we leave an area of the map completely alone we will find a patchy distribution of trees, with densely forested areas right next to treeless zones.
At present the biome is divided up into random patches, some of them allow the biome's trees to grow in them (and the few initial trees are placed in them) and the other are empty or trees with trees refusing to grow in them. The more forested the biome is, the greater the number of forest patches and the fewer the number of open patches defined invisibly on the map before any trees grow. What appears to be lacking however is any variation of the kill zone between the biomes and individual patches within the biomes. This is what is leading to complaints of 'treesplosion', the forested patches in an open area biome are ending up just as dense as a regular forest because there is no difference between the kill zones of trees in different biomes.
That does nothing to prevent uniformity within the zone itself.
As is intended, the zone represents a set of uniform conditions. It is an extension of what exists already, but is not binary in the way that what exists already is.
Again, it has nothing to do with millions of trees growing. Density is a property of biomes. I don't know what world you live in where an explosion (rapid increase in number) of trees in an area creates interesting shapes.
It does when the memory cannot handle growing millions of interestingly shaped trees. The rapid increase in the number of trees is a neccesery compromise between the inability of world-gen to handle the quantity of the trees when combined with the quality and the desire to have this situation arise on the map.
We do not start off with the situation we should have in the biome so that in the end we end up with that the perfect situation in the end. The 'tree-farm' solution would give us the correct number of trees to start with but would never give us a realistic forest setup which is what we get as the result of the present situation but not immediately.This is the first I've heard of a 'tree-farm' solution.
The tree-farm solution is what the devs rejected as an option, it is what having the correct number of trees that are 'supposed' to be there would entail, given the limited memory available to world-gen. It can only cover the world with enough trees if all the trees of the same type are identical and laid down in an identical pattern in relation to eachother, anything else would exhaust the memory of the game.