I may try something like that eventually. My plan is to instead of using my task-based thread system to generate chunks, chunks that may map to the same volume, I will instead just divide my world into several large volumes, then make it so only one thread can work on it at a time. The trick is to still use the task-based thread system, just now when a task is done, it will mark that volume as free. This way basically still generate manageble chunks at a time, still use the task based threads, still use have interactivity, have larger chunks with compression, and without using locks. I'm just not sure whether this will work the way I hope it will work, especially WRT to performance.
Anyway, I did some quick timing of my code with various settings of shared block size and cache size and also polyvox without compression. I'm not sure whether the tests are valid or not, it's just quick test. Also, I don't think I will worry too much about this for now. I don't have any game play. I still don't have a clear picture of how my final game will work. Without knowing that it's hard to say how (and how big) I should make my world. I need to finish doing that first.
Here are some results (timing are done with Win32 QueryPerformanceCounter; time are in seconds.):
Code:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
World Map config:
on-screen map dimensions: 1024*2
unload radius: 544
Outputing Volume Map stats:
Shared Block Size: 32
Uncompressed Cache Size: 4
avgCompression: 0.64402
total volume size in kb: 189423
average graphics and physics upload time: 0.00851222
average generation time: 0.129216
average extraction time: 0.120105
average elapsed time: 0.257834
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
World Map config:
on-screen map dimensions: 1024^2
unload radius: 544
Outputing Volume Map stats:
Shared Block Size: 16
Uncompressed Cache Size: 8
avgCompression: 0.64402
total volume size in kb: 189423
average graphics and physics upload time: 0.00850891
average generation time: 0.117844
average extraction time: 0.107218
average elapsed time: 0.233571
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Without compression (polyvox trunk)
One chunk One volume (32 by 32 by 256 sized volumes)
Code:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
World Map config:
on-screen map dimensions: 1024^2
unload radius: 544
Outputing Volume Map stats:
Shared Block Size: 32
Uncompressed Cache Size: 1
avgCompression: 0
total volume size in kb: 0
average graphics and physics upload time: 0.00849916
average generation time: 0.0419583
average extraction time: 0.071266
average elapsed time: 0.121723
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Multipe pages per volume. Each volume is 1024x1024 in this case.
Code:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
World Map config:
on-screen map dimensions: 1024^2
unload radius: 544
Outputing Volume Map stats:
Shared Block Size: 32
Uncompressed Cache Size: 1
avgCompression: 0
total volume size in kb: 0
average graphics and physics upload time: 0.00849916
average generation time: 0.0419583
average extraction time: 0.071266
average elapsed time: 0.121723
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++