Tuesday 21 June 2011

Slightly More Technical

Axis-aligned building blocks provide a number of advantages and cheap optimisations for collision, occlusion and rendering. This adds to the gameplay and development reasons for using building blocks.
The pioneer world is divided into chunks that are sixteen blocks square. Each chunk is processed atomically and owns a vertex buffer object that it maintains when a brick is added or removed from it.

Whole chunks are constructed/deconstructed by a Horizon object that keeps track of which chunk the player is standing in and ensures a few chunks in each direction are visible. This allows very large landscapes to be represented and to stream in and out to allow seamless travel over long distances. It also provides a base for distance culling to scale the renderer to match the performance of different computers.
Each brick is an arrangement of blocks that can be atomically added to or removed from a chunk.
Each chunk contains a list of the bricks inside it, and each time the brick list changes the brick list is iterated over to construct a Vertex Buffer Object for the chunk.

Because of the chunk architecture, its not yet possible to place a brick so that it spans two or more chunks. Each brick must lay entirely within one chunk. This restriction has proved pretty annoying when building, and does need to be resolved.

No comments:

Post a Comment