Skip to content

Game Data: Maps

Mark Eliasen edited this page Feb 11, 2018 · 1 revision

Map Data files

The map file found in ./game/data(.new)/maps/ are the maps, which the players can go to. They consist of a list of NPCs, buildings and other details which define each map.

Composition

This is the content of the London map file (./game/data(.new)/maps/london.json).

{
    "id" : "london",
    "name": "London",
    "gridSize": {
        "y": 30,
        "x": 30
    },
    "structures": [
        {"id": "hospital", "x": 26, "y": 7},
        {"id": "pawnshop", "x": 1, "y": 22},
        {"id": "bar", "x": 28, "y": 4},
        {"id": "bank", "x": 5, "y": 3},
        {"id": "airport", "x": 30, "y": 29}
    ],
    "npcs": [
        {
            "id": "police-officer",
            "amount": 2
        },
        {
            "id": "bum",
            "amount": 2
        },
        {
            "id": "pedestrian",
            "amount": 3
        },

        ... etc
    ],
    "respawn": {
       "y": 7,
       "x": 26 
    }
}

General

  • id: A unique ID for the map, must be a string
  • name: The name of the map, this is what players will see
  • gridSize: This is the size of the map (x * y).
  • respawn: The coordinates where any players who dies on this map, should respawn.

NPC List

The list of NPCs which will spawn on the map, are defined in the array npcs. Each NPC object, consists of the following:

  • id: The ID of the NPC, defined in the ./game/data(.new)/npcs.json file, that you want to spawn.
  • amount: How many of a given NPC to spawn in the map
  • location: (optional) an object with a x and y coordinate, eg: location: {"x": 16, "y": 4}, where the NPCs will spawn. If a location object is not defined, the NPCs will randomly spawn on the map.

Structures

The list of structures which will appear on the map, are defined in the array structures. Each structure object, consists of the following:

  • id: The ID of the structure, defined in the ./game/data(.new)/structures.json file, that you want to spawn.
  • x: The x (east) coordinate of where the structure should spawn
  • y: The y (north) coordinate of where the structure should spawn

Clone this wiki locally