Skip to content

MapFile beta ​

Interface of @v12-engine/engine

ts
export interface MapFile

A map the way it is written to a file: JSON, with the layers packed

Members ​

author ​

ts
author?: string;

Who made the map (GameMap.author)

bounds ​

ts
bounds?: CellRect;

The part of the map play happens in, in cells (GameMap.bounds)

cameras ​

ts
cameras?: MapCamera[];

The saved views of the map (GameMap.cameras); left out when there are none

camps ​

ts
camps: MapCamp[];

The creeps that guard spots (GameMap.camps)

cells ​

ts
cells?: Record<string, string[]>;

The game's layers of cells (GameMap.cells), by id, a line of text for each row as the layers above. Left out for none

cliffHeight ​

ts
cliffHeight: number;

How much higher a level stands than the one below (GameMap.cliffHeight)

data ​

ts
data?: Record<string, unknown>;

Left out when the game keeps nothing with the map

day ​

ts
day?: MapDay;

The hour the game starts at and whether it moves (GameMap.day)

definitions ​

ts
definitions?: GameData;

The map's own definitions (GameMap.definitions)

depth ​

ts
depth: number;

The map's depth in cells

description ​

ts
description: string;

The map's description (GameMap.description)

doodads ​

ts
doodads?: MapDoodad[];

The scenery of the map (GameMap.doodads); left out when there are none

editor ​

ts
editor?: Record<string, unknown>;

Left out when the editor keeps nothing with the map

environment ​

ts
environment?: MapEnvironment;

What the map looks like beyond its ground: its water, light, sky (GameMap.environment)

explored ​

ts
explored?: boolean;

Whether the whole map starts explored (GameMap.explored)

forces ​

ts
forces?: MapForce[];

The map's teams, named (GameMap.forces)

format ​

ts
format: number;

The file format's version (MAP_FORMAT when written), which the reader brings older files up from

game ​

ts
game?: string;

The game the map was made for, by the id of its module (GameMap.game); any game when left out

generated ​

ts
generated?: GeneratedWith;

How the map was made when a generator made it: the seed and options (GameMap.generated)

ground ​

ts
ground: string[];

The layers of the ground, a line of text for each row (since format 3: before, one line for the whole layer): two people who change different rows change different lines, which git merges. The heights by corner, a row of the corners along x for each z; the rest by cell, a row of cells for each z

itemTables ​

ts
itemTables?: MapItemTable[];

The tables of what drops when something dies (GameMap.itemTables)

levels ​

ts
levels: string[];

The cliff levels, a line of text per row of cells (GameMap.levels)

loading ​

ts
loading?: string;

What the loading screen says (GameMap.loading)

meantFor ​

ts
meantFor?: string;

Who the map is for, as lists show it (GameMap.meantFor)

name ​

ts
name: string;

The map's name (GameMap.name)

objects ​

ts
objects: MapObject[];

What stands on the map when the game begins (GameMap.objects)

pathing ​

ts
pathing?: string[];

What is kept off cells by hand (GameMap.pathing), a line of text for each row as the layers above. Left out for none

paths ​

ts
paths?: MapPath[];

The named lines of the map (GameMap.paths); left out when there are none

players ​

ts
players: MapPlayer[];

The players who can take part (GameMap.players)

points ​

ts
points?: MapPoint[];

Left out when there are none

preview ​

ts
preview?: string;

A small picture of the map as a data URL, for lists of maps (GameMap.preview)

races ​

ts
races?: string[];

The races a lobby offers on the map, by id (GameMap.races)

ramps ​

ts
ramps: string[];

The ramp flags, a line of text per row of cells (GameMap.ramps)

randomGroups ​

ts
randomGroups?: MapRandomGroup[];

The groups that placed things can be drawn from (GameMap.randomGroups)

regions ​

ts
regions?: MapRegion[];

Left out when there are none, as files made before regions were have none

silence ​

ts
silence?: string[];

The map's checks it does not want, by their rules' ids (GameMap.silence)

tiles ​

ts
tiles: string[];

The paint layer, a line of text per row of cells (GameMap.tiles)

tileset ​

ts
tileset: string[];

See GameMap.tileset. Since format 2

water ​

ts
water: string[];

The water layer, a line of text per row of cells (GameMap.water)

width ​

ts
width: number;

The map's width in cells