Skip to content

Concepts

Emiel van Rooijen edited this page Aug 5, 2018 · 9 revisions

Layer

A slice of the entire Minetest world limited on the XZ axis by the maximum world size and limited on the Y axis by multi map's global layer height setting. Each layer is stacked on top of another automatically based on the global settings. This means that every layer has the same height and whenever you want to go to the next layer, you need to move to the layer above the current one. Also, for each layer you must specify the generator that must be used for the terrain generation, or specify a fallback generator that is used in case no generators for a layer can be found.

Current Layer

The current layer that is being processed by the multi map engine or the mapgen or, in case of a player, the current layer that the player is in.

Zone

In-game representation of the current layer, e.g. it can say: "Zone 10: Desert World" in the HUD. For all intents and purposes, it is just a label for a layer to display to the end user and can actually be changed to something else.

Y Centerpoint a.k.a. Centerpoint

The middle of a layer on the Y axis. E.g. for a layer 0 starting at -30912 (start chunk = 0) that is 20 chunks high, the Y centerpoint is at 10 chunks. Which is 80 * 10 = 800 nodes above -30912 = -30112. So the centerpoint of layer 0 is -30112, and the offset/ relative Y at this point is 0.

Offset Y a.k.a. Relative Y

This is the Y coordinate relative to the current layer's Y centerpoint. E.g. for the above example, if we are in layer 0 at Y = -30100, the Y relative to that layer's centerpoint is 12.

Map Generator Plugins a.k.a. Generators

The multi map engine only does the management of the layers and the creation of bedrock, skyrock and shadow casters. The terrain inside the layers is actually created using pluggable map generators that are configured programmatically. In this configuration, you can specify which map generator function to use for which layer. During the generation by the engine, the current layer that is generated is determined and based on that the plugin's function is called.

Map Generator Chains a.k.a. Generator Chains

Multi map allows you to register more than one generator plugin per layer. This can be done to e.g. separate terrain generation logic from other logic such as village creation, biome decorators, dungeon generators, etc. The order in which generators in the chain are called is the order in which they are registered. In addition, since map generator registration is done per layer, these chains are on a per layer basis as well. This allows for one layer to have e.g. terrain and dungeons, another to have terrain and village creation and yet another to only have terrain.

Fallback Generator

The fallback map generator is called when no generator for a layer can be found. E.g. suppose you have a world with 4 layers and register generator A for layers 1 and 2 and generator B as fallback generator. Now if you are in layer 1 or 2, generator A is used as the map generator. If you are in layer 3 or 4, no layer was registered and the fallback is used.

Bedrock

Bedrock is a one mapchunk high plane of impenetrable rock (cannot be pointed at, cannot be dug, etc.) at the bottom of a layer, to avoid falling from one layer to the layer below or otherwise allow travel between these two layers by digging down.

Skyrock

Skyrock is a two mapchunk high plane of impenetrable airlike nodes at the top of a layer to avoid one from reaching the next layer by climbing up. In addition, it avoids the bottom of the bedrock to be visible, it stops shadows from propagating and restores proper lighting in the layer.

Shadow Caster

An invisible airlike node that has sunlight_propagates set to false, so that it can cast shadows inside large underground caves. Since the mapgen requires the global water_level to be set to -31000, this leads to improper day lighting in areas below the Y centerpoint of a layer (since that is always above the global water level). A single node high plane of shadow caster nodes is placed above mapchunks during the map generation when these mapchunks are underground within the current layer. This casts a shadow on the mapchunk below and makes sure these areas are properly darkened.

Global Noises

A global noise is an easy way to have per layer unique noises managed by multi map rather than managing them in the map generator plugins. This makes it easier for map generator plugin developers to have uniquely seeded 2D terrain for each layer instead of having to keep track of it in the plugin itself. In addition, multi map will try to manage the noises as efficiently as possible by caching the noises while generating map chunks that are all within the same layer. In addition, once a (flat) map is retrieved, it is cached for the duration of the generatrion of the current map chunk (for the entire on_generated call) so that chained generators would get a cached version instead of creating the same one again and again per generator in the chain.

Global 2D noises have a unique seed per layer (since otherwise each layer would result in the same terrain). Global 3D noises do not need this as each layer is on a different Y resulting in different noise values anyways.

That said, global noises are optional to use and a plugin could very well keep track of its own noise and noise maps. However, care must be taken when using LuaJIT and keeping many different noise maps in memory, as you can easily run out of available memory that way.

Noise Mixing

Noise mixing is the process of taking noise from the current layer and noise from the next layer and then averaging them out in order to create a smooth transition from one noise map/ terrain to the next. This can be used to "wrap" a layer to a next layer and allow a player to be teleported to that next layer when nearing the world X or Z boundary, all the while making sure that the player does not notice a thing as far as the terrain is concerned. That way you truly make the world area appear larger on the XZ axis, albeit in a makeshift/ virtual manner of course.

Noise Mirroring

Noise mirroring is taking the noise of the next layer from the opposite side of the world and using it to generate the terrain at the border, instead of using the current layer's noise. If a player then approaches the border and is teleported from the current layer to the next, it is as if the terrain continues, allowing for a seamless transition between layers.

Wrapping

Wrapping is the transition of one layer to the next by means of noise mixing one layer with the next and teleporting a player from that one layer to the next. It is as if, as you reach the world border, the layer wraps seamlessly to the next layer as far as terrain is concerned as well as the player experience.

World Extension

World extension is to give the player the impression that the world is larger on the XZ axis than the Minetest limitation of 61840 x 61840. This is achieved by varous means: The exploration of much more new terrain using the Y axis to its fullest potential, this terrain being similar as far as map generation logic is concerned and a means to move between the layers. The means to move between layers is either using a teleportation device (e.g. portals, teleporters, etc.) or by wrapping (automatically merging the terrain between two layers on the world border and teleporting the player from one layer to the next).

World extension using wrapping is done in three stages: 1) When the player approaches the border (3 mapchunks), noise mixing mixes the terrain of the current layer with the terrain of the next layer. 2) Even closer to the border (2 mapchunks), noise mirroring takes the noise of the next layer from the opposite side and uses that to generate the terrain. 3) At the very edge of the world (1 mapchunk), the player enters a teleportation area and is automatically teleported to the next layer and the opposite side.

Multiple Worlds

Multiple worlds is an special case of world extension, whereby you achieve the goal of making the world appear larger, but you do so by providing different types of terrain, e.g. a nether, a cloud land, an ocean world, an alien planet or moon, etc. Since these offer vastly different terrains and use completely different noises, noise mixing and wrapping is not possible. As such only teleportation (portal, teleporter, space ship structure acting as portal, etc.) should/ can be used to move the player between layers.

You can’t perform that action at this time.