Let’s build… a Worldmap!

Space Map

Design the Space Map as shown below:

It’s one column with an adjustable length. The number and distribution of tiles are not fixed; you can have, e.g., more or fewer grass tiles. It is also not required to have exactly 3 different tiles; you can pick more or fewer tiles, especially when using a custom tile sheet with more sea or land levels.

That’s it for the generation. Feel free to put invisible Events for background effects, e.g., screen toning or weather.

Additional Maps

Additional Maps can be put as a child map below your Space map to add new features. They are optional.

This feature is optional. If active, every island will be filled with one randomly-picked tile from the right. You can use a tile multiple times to get a ratio.

This feature is optional. If active, mountains are drawn on the map.

You can define one mountain tile for each biome or skip a biome. This plugin does not support multiple kinds of mountains for one biome.

This map is optional. If given, the plugin will spawn towns on every island. The larger the island, the more villages will appear.

Here you can find a more detailed explanation of how assets are defined. You can skip biomes, e.g., don’t spawn towns on volcano islands.

This feature is optional and requires having a „towns“ map to work. It connects every town with roads that are not separated by the ocean or mountains.

You can have different road styles for different biomes. You can skip biomes, e.g., don’t create roads in the desert.

JavaScript Call

Using this code, you can enter your map and have a first look.

const args = { }

$mapGenerator.custom("worldmap", args)
.spawnPlayerAt("here")
.generate()
.finalize()

Arguments

You can add arguments to the „args“ instance in the code above. All arguments are optional.

ArgumentExample(s)Description
scale30The higher this value, the more zoomed in a map looks like
groundLevel3The plugin checks the possibility of the tiles to determine the ground level. You can manually override this value.
n_islands5
[4, 6]
The number of islands on the world map, either as a fixed value or as an array [min, max]. Warning: The algorithm achieves this query by trial-and-error. Requesting unrealistic numbers may cause the game to crash.
minSizeToHaveABiome15Every island that is smaller than this argument will remain a grassland.
drawRiverstrue
false
When true, the algorithm draws rivers. Default: true
riverTileStack[ MK.tileFromEditorsTable(‚A1‘, 0, 0), 0, 0, 0, 0, 0 ]The tile stack that the algorithm uses to draw the rivers1
townsVariable400The algorithm calculates island size / townsVariable (but at least 1) to determine how many towns an island will have.

A tile stack is the combination of all 4 layers, the shadow layer, and the region layer on a single cell on your map. Technically, it’s an array

[
  ground-layer 1,
  ground-layer 2,
  b-layer 1,
  b-layer 2,
  shadows,
  region Id
]

The method MK.tileFromEditorsTable(sheet, x, y) returns the tile id by passing a sheet, the x, and the y-coordinate from the editor’s table.

  • sheet: Choose from 'A1', 'A2', 'A3', 'A4', 'A5', 'B', 'C', 'D', 'E'
  • x: x coordinate in the editor’s table
  • y: y coordinate in the editor’s table
const args = {
  scale: 50
}

$mapGenerator.custom("worldMap", args)
.spawnPlayerAt("here")
.generate()
.finalize()

Let’s continue

Now you can continue by drawing, e.g., events.