How to improve Minecraft-esque voxel world performance?
Posted
by
SomeXnaChump
on Game Development
See other posts from Game Development
or by SomeXnaChump
Published on 2011-05-31T09:21:34Z
Indexed on
2012/06/15
15:28 UTC
Read the original article
Hit count: 270
After playing Minecraft I marveled a bit at its large worlds but at the same time I found them extremely slow to navigate, even with a quad core and meaty graphics card.
Now I assume Minecraft is fairly slow because:
A) It's written in Java, and as most of the spatial partitioning and memory management activities happen in there, it would naturally be slower than a native C++ version.
B) It doesn't partition its world very well.
I could be wrong on both assumptions; however it got me thinking about the best way to manage large voxel worlds. As it is a true 3D world, where a block can exist in any part of the world, it is basically a big 3D array [x][y][z], where each block in the world has a type (i.e BlockType.Empty = 0, BlockType.Dirt = 1 etc.)
Now, I am assuming to make this sort of world perform well you would need to:
A) Use a tree of some variety (oct/kd/bsp) to split all the cubes out; it seems like an oct/kd would be the better option as you can just partition on a per cube level not a per triangle level.
B) Use some algorithm to work out which blocks can currently be seen, as blocks closer to the user could obfuscate the blocks behind, making it pointless to render them.
C) Keep the block object themselves lightweight, so it is quick to add and remove them from the trees.
I guess there is no right answer to this, but I would be interested to see peoples' opinions on the subject. How would you improve performance in a large voxel-based world?
© Game Development or respective owner