What is the best way to manage large 3d worlds (i.e minecraft style)?
Posted
by
SomeXnaChump
on Game Development
See other posts from Game Development
or by SomeXnaChump
Published on 2011-05-31T09:21:34Z
Indexed on
2011/06/24
8:32 UTC
Read the original article
Hit count: 191
After playing minecraft I was marvelling a bit at their large worlds but at the same time finding it extremely slow to navigate, even with a quad core and meaty graphics card.
Now I assume its fairly slow because:
A) Its written in Java, and as most of the actual spatial partitioning and other memory management activities happen in there it would be slower than a native C++ version.
B) They are not partitioning their world very well
I could be wrong on both assumptions, however it got me thinking about the best way to manage large worlds. As it is more of 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 performant 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 if the blocks within the scene 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.
© Game Development or respective owner