Refactoring Tree Generation
#3
I had an idea that instead of generating the tree images on the fly, we would actually use .cubeset files with tree images in them. Unfortunately, I didn't do the math then, and when I did, I found out it was pretty much impossible, the cubesets would be really, really large to contain all the tree variants already in the code (I counted the number of trees to be on the order of thousands)

The problem with dual checking is that while the trees are being generated, there is no cChunk for the generated chunk yet (and there cannot be - it is created only after the data for it is known). And also, there needn't be cChunk instances for the neighboring chunks. The easiest idea for refactoring would be to use an interface, ChunkDataProvider, that would have the virtual methods to access individual blocks and query neighboring chunks; and the generator and the world both would provide a descendant with this interface, implemented on the underlying data.
Reply
Thanks given by:


Messages In This Thread
Refactoring Tree Generation - by SamJBarney - 08-03-2016, 06:17 AM
RE: Refactoring Tree Generation - by NiLSPACE - 08-03-2016, 06:21 AM
RE: Refactoring Tree Generation - by xoft - 08-03-2016, 05:44 PM



Users browsing this thread: 1 Guest(s)