ChunkWorx V6 (rev. 787 compatible)
#40
I know this plugin is considered more or less finished, but still, I have to try this Smile Can I make a request for a change? Smile
Would it be possible to change the order of the chunks to one of the following patterns?
1, Spiral from the center to the outside
2, Spiral from the outside to the center
3, Zig-zag lines (one line from left to right, the next line from right to left)
4, Hilbert curve in the specified area (how to fit on non-2^N dimensions?)
Any one of these patters should provide a significant increase in chunk generation speed.

Reasoning (will get a bit technical):
Some of the chunk generator components use the knowledge of neighboring chunks. For example, the height generator looks through an 8x8 column area around the current column for biomes, and for each biome it encounters, it adds a bit of that biome's flavor to the height. So it needs a 3x3 area of chunks' biome data around the currently generated chunk. Another example - the tree stucture generator looks at neighboring chunks' composition to see if the tree would actually fit. Now combine these two: to generate trees for a single chunk, composition (and thus height) must be generated for a 3x3 chunk area; which in turn means biomes must be generated for a 5x5 chunk area. Then a next chunk is populated with trees, another 5x5 chunk area of biomes. BUT most of those have been already generated for the previous chunk!
So, in order to keep things feasible, I added a cache to those biome and height generators. Once generated, an item stays in the cache until it's too old and gets pushed out by newer data.
Now ChunkWorx comes, and it generates chunks by rows. Everything works fine as long as it's going on one row - for each chunk its 5x5 biome neighbors are calculated, but 4x5 are already in the cache - fast. Then ChunkWorx skips to next row. Ouch, a new chunk completely foreign to the data so far. The cache misses everything and has to be refilled.

You can actually see this behavior on slower computers (or debug builds), when they generate one row of chunks, they go quite fast. But then the first chunk on the next row takes about 8 times longer to generate.
Reply
Thanks given by:


Messages In This Thread
ChunkWorx V6 (rev. 787 compatible) - by Taugeshtu - 05-31-2012, 07:58 AM
RE: ChunkWorx - by FakeTruth - 05-31-2012, 08:15 AM
RE: ChunkWorx - by xoft - 05-31-2012, 04:33 PM
RE: ChunkWorx - by xoft - 05-31-2012, 09:30 PM
RE: ChunkWorx - by Taugeshtu - 05-31-2012, 09:36 PM
RE: ChunkWorx V2 - by xoft - 06-01-2012, 06:03 AM
RE: ChunkWorx V2 - by Taugeshtu - 06-01-2012, 06:32 AM
RE: ChunkWorx V2 - by xoft - 06-01-2012, 06:39 AM
RE: ChunkWorx V2 - by Taugeshtu - 06-01-2012, 06:49 AM
RE: ChunkWorx V2 - by xoft - 06-02-2012, 07:48 PM
RE: ChunkWorx V2 - by NiLSPACE - 06-02-2012, 08:03 PM
RE: ChunkWorx V2 - by xoft - 06-02-2012, 08:16 PM
RE: ChunkWorx V2 - by NiLSPACE - 06-02-2012, 08:24 PM
RE: ChunkWorx V2 - by Taugeshtu - 06-03-2012, 10:09 PM
RE: ChunkWorx V2 - by xoft - 06-03-2012, 10:39 PM
RE: ChunkWorx V2 - by Taugeshtu - 06-04-2012, 12:55 AM
RE: ChunkWorx V2 - by Taugeshtu - 06-04-2012, 08:03 AM
RE: ChunkWorx V3 - by NiLSPACE - 06-05-2012, 11:54 PM
RE: ChunkWorx V3 - by Taugeshtu - 06-06-2012, 01:39 AM
RE: ChunkWorx V3 - by xoft - 06-06-2012, 01:46 AM
RE: ChunkWorx V3 - by NiLSPACE - 06-06-2012, 02:23 AM
RE: ChunkWorx V3 - by xoft - 07-04-2012, 05:01 AM
RE: ChunkWorx V3 - by Taugeshtu - 08-25-2012, 03:20 AM
RE: ChunkWorx V3 (rev. 787 compatible) - by xoft - 08-28-2012, 03:32 AM
RE: ChunkWorx V3 (rev. 787 compatible) - by xoft - 08-28-2012, 05:06 AM
RE: ChunkWorx V3 (rev. 787 compatible) - by xoft - 08-30-2012, 10:39 PM
RE: ChunkWorx V3 (rev. 787 compatible) - by xoft - 08-30-2012, 10:53 PM
RE: ChunkWorx V3 (rev. 787 compatible) - by xoft - 08-30-2012, 11:41 PM
RE: ChunkWorx V3 (rev. 787 compatible) - by xoft - 08-31-2012, 12:30 AM
RE: ChunkWorx V6 (rev. 787 compatible) - by xoft - 03-25-2013, 01:55 AM
RE: ChunkWorx V6 (rev. 787 compatible) - by xoft - 12-10-2013, 06:29 AM



Users browsing this thread: 3 Guest(s)