I’ve spent much of the day today working on world terrain generation, with an emphasis on tree placement during game startup. The big thing I’ve been struggling with has been a strange bug which resulted in trees being placed in strange patterns; often in north-south or in diagonal stripes across a forest, instead of uniformly within a region.
Eventually I found the issue; some uninitialised memory which was causing the game to think that forest was already present in some positions on the map. Fixing that resulted in getting a lot more trees in the world; now a standard default world has around 10,000 trees, where previously it had about 2,000 to 3,000. In order to keep reasonable performance, I made some simplifications to the tree model generation, some visible, and some imperceptible. Oddly enough, I think I like the simpler trees more; the faceted, low-polygon appearance gives them some character that they were lacking, before. Still no substitute for proper, artist-created models, but they’ll do for the moment.
The really interesting thing here is that I’m finally having the problem that I’ve been predicting I’d have for years. Ages back I did some testing, flying around in World of Warcraft to try to gauge what a tycoon game set there would look like. Flying above Goldshire (a heavily forested town), I noted that when looking from above, you can’t even see that there’s a town there — the trees completely hide the settlement from the air. This is going to be a tricky interface issue to solve, but I’m thrilled to have finally reached a point where I need to solve it. :)