Map Properties and Layers

Map Properties


Maps have a few custom properties that can be added to them.

A map's properties panel can be accessed from the top ribbon, under "Map" > "Map properties...".

The following are all the custom properties that can be added to a map, read this tutorial to undertand the naming convention of custom properties:

  • name: string -> The name of the map. Mainly used to display the map you're on when saving and loading the game.
  • music: string -> The name of the background music that plays inside of this map. If the name of the music is the same as in the previous map the player was in, the music will continue instead of starting over.
  • keepmusic: boolean = false -> If true, Kristal will not change the music from the previous map, even if the music track is diferrent.
    If false, Kristal will transition the music from the previous map to the music of this map, only if that music track is different.
  • light: boolean = false -> If true, the map will be in the light world and Kristal will use the inventory, textboxes and Game Over from Undertale. If any member of the party has a lightworld variant it'll be used intead of the normal dark world version.
    If false, the map will be set in the dark world and Kristal will use the systems from Deltarune.
  • border: string -> The name of the border to use when the player changes the Border option from Kristal to Dynamic. Kristal already defines some borders you can use, which are castle, city, cyber, leaves, mansion and simple and are stored in assets/sprites/borders in the Kristal source code.

Map Layers


Everything placed into a map has to be placed onto a layer. As well as being for their namesake (layering), Kristal uses layers to differentiate between different types of map data.

This works based on the layer type and layer name, so if a specific layer type and name are present in the map, Kristal will treat the data on it as a specific feature such as paths, markers, or objects.

Layer names are case-sensitive, and they can also include a suffix. This means you can have a layer named something like objects_enemies, and the suffix _enemies will not prevent it from loading as an objects layer, and a layer called Objects will not be treated as objects, because the casing does not match.

List of Map Layers


Generic Tile Layers

  • A Tile layer with no specific name will be treated as regular tiles.

battleborder (Tile)

  • Only visible when the player is inside a battle area.

objects (Object)

  • Objects layers are used for placing events into a map.
  • These can place engine events, any objects registered using Game:registerEvent(), and any legacy events in scripts/world/events.
    • Either the Class or Name property of the object must reference the ID of the registered event you want to spawn.

objects_party (Object)

  • If an objects layer exists with this name, the party will always spawn on it.
    • If this layer does not exist, the first objects layer that exists above the markers layer spawns the party instead.

controllers (Object)

  • Controller layers are used for placing controllers into a map.
    • These are special event-like objects that have no physical presence in the map. They are designed for controlling other events, hence their name.
    • (See Using events for more information about controllers)
  • User-registered controllers should be stored in the scripts/world/events/controllers folder of the project.

collision (Object)

  • The shapes on this layer will be used as the collision for each map.

enemycollision (Object)

  • The shapes on this layer will be used as collision that only affects enemies (ChaserEnemy).
  • Enemies will still be affected by the collision of the standard collision layer, regardless of this layer's presence
    • (See the tutorial dedicated to the Chaser Enemy for more information about this layer)

markers (Object)

  • The shapes on this layer create markers that reference specific points or regions of a map. Each marker must be given a name so it can be referenced later.
  • Markers for the current map are stored in Game.world.map.markers, and can be gathered with Game.world.map:getMarker(name).
    • Sometimes, events will need markers for certain properties.
    • Additionally, the world uses the spawn marker, if it exists, to determine where to place the party when the map is loaded from a savefile or without an entry position.

paths (Object)

  • The perimeter of each shape on this layer is treated as a path. Each path must be given a name so it can be referenced later.

battleareas (Object)

  • When the player enters any object on this layer, it will cause them to enter a "World Battle". This causes the battleborder layer to become visible, and the world to darken.

blockcollision (Object)

  • The shapes on this layer will be used as collision for the pushblock event.

Generic Image Layers

  • Any layer using the Image type is treated as-is.