Skip to content
Benedikt S. Vogler edited this page Mar 12, 2019 · 2 revisions

A chunk is a three-dimensional array containing map data. The dimensions of a chunk are stored in the static fields blocksX, blocksY, blocksZ. The fields are set by the map cvars chunkBlocksX, chunkBlocksY & chunkBlocksZ;

By default a chunk is 40m*10m*10m*3=12000 byte by a size of 400 m² area and 4000m³ volume.

Wurfel Engine's approach

A traditional way to arrange the tiles is to create a square chunk and turn it around 45° degrees. This is called "diamond map". Square Map But when you do this you have 50% out of the screen and x- and y-coordinates are also turned around 45°.

Using the "staggered map" format it is easier to use nine chunks for the map scrolling. It looks a bit like a brick wall.

With this, X and Y can be found in every normal coordinate-system (Y mirrored).

The size of the chunks is very important because with higher chunks you get in danger that the highest blocks of the lower chunks reach into the viewable area. Because of a 3 chunk limit if your chunk has a too small (Y-direction) it could happen that the highest blocks suddenly appear during scrolling.

Generators

Every chunk can be loaded from a file or generated. Wurfel Engine has some more or less simple chunk generators built in. You can set the generator with GENERATOR.

Loading

A map consists of the chunk files and a metafile. The metafile includes the name of the map, the version and more information to come. Every game can set it's own suffix' with: CHUNKFILESUFFIX 'METAFILESUFFIX'

Clone this wiki locally