08-23-2020, 10:37 AM
xoft, do you recall why the terrain generator has a cache?
I can see it being used during tree placement, where trees attempt to generate chunks around them when they cross chunk borders.
As well during village generation, apparently so roads follow the lay of the original land, before any finishers changed the heightmap?
If we do need to preserve the original heightmap, I'm only seeing one call to UpdateHeightmap before the chunk concludes generation, in the tree generator. If this can be removed the heightmap in ChunkDesc should serve the purpose for village roads well.
Tree generation seems like it could be made to use the strategy of ore pocket features (that can also cross borders, but don't need to generate extra chunks to place properly), though the density of trees might make this difficult? If this is possible then we can eliminate the need to touch other chunks during tree generation.
I think achieving both of these would allow removal of the cache? Especially with the village road heightmap, it looks like we're regenerating an entire chunk just to get the height at one position; even with a cache there's still memcpy costs to consider, and it precludes threadpooling the terrain generator.
I can see it being used during tree placement, where trees attempt to generate chunks around them when they cross chunk borders.
As well during village generation, apparently so roads follow the lay of the original land, before any finishers changed the heightmap?
If we do need to preserve the original heightmap, I'm only seeing one call to UpdateHeightmap before the chunk concludes generation, in the tree generator. If this can be removed the heightmap in ChunkDesc should serve the purpose for village roads well.
Tree generation seems like it could be made to use the strategy of ore pocket features (that can also cross borders, but don't need to generate extra chunks to place properly), though the density of trees might make this difficult? If this is possible then we can eliminate the need to touch other chunks during tree generation.
I think achieving both of these would allow removal of the cache? Especially with the village road heightmap, it looks like we're regenerating an entire chunk just to get the height at one position; even with a cache there's still memcpy costs to consider, and it precludes threadpooling the terrain generator.