GameMap
Interface of @v12-engine/engine
export interface GameMapA map: the ground and what stands on it when the game begins, as data. The editor makes them, scenes play them.
The ground is kept in layers that are edited apart and put together into a Terrain: the height of the land, cliff levels, ramps between levels, water and paint. The layers are what a map file stores, the terrain is derived from them whenever one changes.
Members
author
author?: string;Who made it
bounds
bounds?: CellRect;The part of the map play happens in, in cells, when it is not all of it: nothing on foot goes outside it, nothing is built there, the camera keeps to it, and the screen darkens what is beyond. Scenery around the edge
cameras
cameras: MapCamera[];Views of the map saved under names (see MapCamera)
camps
camps: MapCamp[];The creep camps of the map
cells
cells?: Record<string, Uint8Array>;The game's own layers of cells (CellLayerDef), by id: where the bushes are. A value per cell, row by row. Left out, or a layer left out, for none
cliffHeight
cliffHeight: number;How much higher a level stands than the one below
data
data: Record<string, unknown>;What the game keeps with the map, for its rules to read: a difficulty, the waves of this level. Plain data, as in a save. The engine never looks inside
day
day?: MapDay;The hour the game starts at, and whether it moves (see MapDay)
definitions
definitions?: GameData;The map's own definitions (campaign plan RC8), a data.json as the game's has it (GameData): laid over the game's data as a world is made from the map, before its rules are checked. A footman of 200 health on this map alone. Its rules hash has them, so a save of it is not one of another map with other definitions
depth
depth: number;The map's depth in cells
description
description: string;A line about the map, for lists of maps
doodads
doodads: MapDoodad[];Scenery, which the rules do not know of but where it blocks (see MapDoodad)
editor
editor?: Record<string, unknown>;What the map's editor keeps with it of its own (what is hidden or locked, its groups, its views, the instances of prefabs): saved with the map as plain data, read by no game, world or rule, and taken away for play (withoutEditor). The engine never looks inside: the editor says what it holds
environment
environment?: MapEnvironment;What the map looks like beyond its ground: its water, light, sky (see MapEnvironment)
explored
explored?: boolean;Whether the whole map starts explored for everyone, the fog over it all the same: its ground, and what stands on it and belongs to no player (trees, mines, neutral buildings), seen from the first moment. Yes or no over the game's (FogSettings.startExplored); the game's when left out
extra
extra?: Record<string, unknown>;What the file held that this reader does not know, as it was: written back when the map is saved, so that a map from a newer editor loses nothing by passing through an older one
forces
forces?: MapForce[];Its teams, named, and what their players share (see MapForce). Teams by number only when left out
game
game?: string;The game the map was made for, by the id of its module (Rules.id): a world is not made from it for another. For any game when left out, like the maps made before maps said
generated
generated?: GeneratedWith;How it was made, where a generator made it (generateMap): the seed and the options, for the same again or another
ground
ground: Float32Array;Height of the land per vertex, row by row, before cliffs and water
itemTables
itemTables?: MapItemTable[];The tables of what dropped things come from, by name (MapObject.drops)
levels
levels: Uint8Array;Cliff level per cell
loading
loading?: string;What the loading screen says while it loads
meantFor
meantFor?: string;Who it is for, as lists show it: "2 players", "2 v 2"
name
name: string;The map's name, as lists and the editor show it
objects
objects: MapObject[];What stands on the map when the game begins: units, buildings, trees, mines
pathing
pathing?: Uint8Array;What is kept off each cell by hand, as the editor's pathing brush paints it: BLOCKS_BUILD (no building there), BLOCKS_WALK (nothing walks or builds there), 0 for nothing. With what doodads keep off, into Terrain.blocked: no-build zones, invisible walls. Left out for none. While the game runs, a game blocks the way with obstacles (world.nav.addObstacle) and keeps buildings off with the canPlace hook
paths
paths: MapPath[];Lines the rules know by name: a road, a patrol route (see MapPath)
players
players: MapPlayer[];The players who can take part. Neutral and the creeps are always there on top of these
points
points: MapPoint[];Spots the rules know by name: where a wave comes in, where a hero waits (see MapPoint)
preview
preview?: string;A picture of it, for lists of maps: a small PNG as a data URL, made from its ground in the editor
races
races?: string[];The races a lobby offers its players who have none fixed (MapPlayer.race), by id. All of the game's when left out
ramps
ramps: Uint8Array;1 where a cell is part of a ramp: the levels around it are joined by a slope instead of a cliff
randomGroups
randomGroups?: MapRandomGroup[];Groups what is placed can be drawn from when the game starts, and tables of what drops (see MapRandomGroup)
regions
regions: MapRegion[];Parts of the map the rules watch by name: who walks in and out (see MapRegion)
silence
silence?: string[];The map's checks it does not want, by their rules' ids (MapProblem.rule): a desert map with no path to its mines
tiles
tiles: Uint8Array;Paint per cell: 0 for none, otherwise 1 and up into tileset
tileset
tileset: string[];The tiles the paint of tiles is, by name: index 1 is the first. The game's own list, as the map is opened with a game (adoptTileset); names the game does not have come after it, kept for the file
water
water: Uint8Array;WATER_* per cell
width
width: number;The map's width in cells