A Superblock is a 128 x 128 section of the game data or "map." Lunacraft divides the game data by superblocks for efficiency, so that it can manipulate the data (Blocks, Mobs etc.) for one part of the moon without needing to load all of the data in the entire moon, which might be quite large. For further details, see the blogs Internal Data Format or As Far As the Eye Can See.
Superblocks in GameplayEdit
As you explore your moon, you will occasionally encounter terrain that looks like this:
- Sharp edge in terrain at a Superblock boundary
These sharp edges look like sheer cliffs and always occur at the edge of a 128 x 128 Superblock. They occur normally, and are also seen after a section of terrain has been erased and recreated by the Terrain regen bug.
The Superblock also affects the "infinite shooting bug" that often happens after the creation of a friendly Astronaut (either with Refined Gold or with a Beacon). When the unending shooting noise starts, the player can make it stop only by moving far enough away so that 1 superblok (128 blocks) lie between you and the place where the friendly astronaut was spawned.
Effects on ObjectsEdit
Plants and Astronaut Lairs never cross a superblock boundary. The terrain generation algorithm decides where to put the center of the plant or lair, and sometime this decision places it close enough to the edge of a 128x128 superblock that the object would need to cross over into a neighboring superblock. But since terrain is generated strictly on a "one-superblock-at-a-time" basis, the object simply gets cut off.
- A G4L plant clipped at the edge of a superblock
- An Astronait Lair stops abruptly at the south edge of a superblock
Superblocks in the Game SavefilesEdit
The blog article Internal Data Format describes the game data files in detail. This is how the existence of superblocks was discovered. For each 128 x 128 superblock, there are three files. The filename has four parts:
- 0, 1, 2, or 3 to select moon A, B, C or D respectively
- An east-west coordinate
- A north-south coordinate
- An extension "mw", "hm", or "dat".
The player begins in superblock (0,0), and the game creates terrain data for each of the 8 neighboring superblocks. Thus there are 27 files containing map data:
(-1, 1) | (0, 1) | (1, 1) 0_-128_128.mw | 0_0_128.mw | 0_128_128.mw 0_-128_128.hm | 0_0_128.hm | 0_128_128.hm 0_-128_128.dat | 0_0_128.dat | 0_128_128.dat ----------------+--------------+---------------- (-1, 0) | (0, 0) | (1, 0) 0_-128_0.mw | 0_0_0.mw | 0_128_0.mw 0_-128_0.hm | 0_0_0.hm | 0_128_0.hm 0_-128_0.dat | 0_0_0.dat | 0_128_0.dat ----------------+--------------+---------------- (-1, -1) | (0, -1) | (1, -1) 0_-128_-128.mw | 0_0_-128.mw | 0_128_-128.mw 0_-128_-128.hm | 0_0_-128.hm | 0_128_-128.hm 0_-128_-128.dat | 0_0_-128.dat | 0_128_-128.dat
The "mw" file is the largest (typically about 200K bytes) and contains the terrain for the 128x128 block area (the height is also 128 blocks: 64 above ground level and 64 below -- so it's a 128x128x128 cube). The "hm" file is 16 K bytes in size and contains a 128x128 map of the height or "altitude" of Topsoil or Sand block at each spot in the map. The "dat" file records the locations of Mini Lights, dropped items, and Mobs. It is 36 bytes for each object, typically less than 1K.