Lunacraft Wiki


124pages on
this wiki
Add New Page
Comments0 Share

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 Gameplay

As you explore your moon, you will occasionally encounter terrain that looks like this:

Superblock boundary

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 Objects

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.

Superblock Clipped Plant

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 Savefiles

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.dat  | 0_0_128.dat  | 0_128_128.dat
     (-1, 0)     |   (0, 0)     |    (1, 0)     |     |     |     |
 0_-128_0.dat    | 0_0_0.dat    | 0_128_0.dat
     (-1, -1)    |   (0, -1)    |    (1, -1)  |  |  |  |
 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.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.