Nodes are segments of the FortressCraft maps. Nodes are 16 blocks wide, 16 blocks long and 128 blocks high, which is 32,768 blocks in total. Nodes are generated around the player when they first enter the world.
The exact number of possible nodes in a FortressCraft world is 4096, as the FortressCraft world is 64 nodes long and 64 nodes wide. The largest possible amount of blocks is 32768*4096, a total of 134,217,728 possible blocks. The number of nodes loaded around the player is usually the same as the View Distance, set in the Graphics Settings.
Creation of NodesEdit
Nodes are created with the help of Perlin generation, and a seed randomly generated when you create your world. This allows FortressCraft to have natural landscape randomly generated every time, but all matching up, using the seed.
Before you reach a certain node close to the edge of the world, FortressCraft will send you flying back in order to prevent you from jumping off the world, or causing errors. These world boundaries are where the map is stopped from generating in order to conserve memory and disk space.
Node coordinates are used to specify the location of Nodes, they have an X and a Z, which both start at 1, and go all the way up to 64. The Spawn is located at node 32,32, the centre of the FortressCraft map. Boundaries are along X coordinate 64, X coordinate 1, Z coordinate 64 and Z coordinate 1.
World/Node File StructureEdit
Each node is stored in a folder named for it's X coordinate, this folder is in the "SinglePlayer" folder of your save directory. An example is: "/SinglePlayer/NodeX/". Nodes are stored in files in this folder, and have the filename format of "NodeX-NodeZ.dat".
Node Save FormatEdit
The Node save format is in two parts, the header and the data. The header (which is 8 bytes long) contains a bit of information about the node that is being read. The rest is the data, which is simply cubes with RLE compression.
|0x00||0x01||byte||Virgin Node (unused)|
|0x01||0x01||byte||Imported Map (unused)|
|0x02||0x04||int||Compressed Data Length|
|0x06||0x01||byte||Node X coordinate|
|0x07||0x01||byte||Node Z coordinate|
|0x01||0x01||byte||Cube Visibility Flags|
The compression is simple RLE compression which can be easily implemented for loading and saving. It works by repeating the cube following a cube with the ID of 255, but the amount of times is the same as flags.