JSON Structure - MechMK1/DBDRandomizer GitHub Wiki
JSON Structure
Overview
The file assets/data/data.json
contains all information about killers, survivors, perks, offerings, items and add-ons.
This document aims to give an overview why the file is structured the way it is, what each property means and how to add new content.
Root Structure
{
killerData: {
killers: [...],
perks: [...],
offerings: [...]
},
survivorData: {
survivors: [...],
itemGroups: [...],
perks: [...],
offerings: [...]
}
}
The file is split into two objects: killerData
and survivorData
. This is due to the fact that killers and survivors have nothing in common to each other. Even though some offerings can be used by both the killer and the survivor, I considered it easier to make two seperate lists than to make one list and keep track who can use what.
Killer Data
Killer Data contains three properties: killers
, perks
and offerings
. Each of them is an array of objects, of which their properties can be found below.
Killers
{
name: "The Trapper",
image: "Trapper.png",
description: "There is a vast monster of a man with a hideous grin torn across the mask that keeps stalking my every move. Similar to a hunter, he tracks us, priming devastating traps amongst the greenery.",
addons: [...]
},
{...}
killers
is an array of objects, with every killer having the following properties: name
, image
, description
and addons
.
The name
-property is a simple string and refers to the display name of the killer. Only the canonical names of the killers were chosen, even though some killers are better known under alternative names (e.g. "The Cannibal" is most often refered to as "Leatherface", "The Shape" is most often simply called "Michael" or "Myers").
The image
-property is a simple string and refers to the filename of the killer's portrait. It is searched for in assets/images/killers/
. If it is not found, a placeholder will be used instead.
The description
-property is a simple string which adds flavour text from the wiki.
The addons
-property is an array of add-ons, which are described below. Since add-ons are killer-dependant, I considered it useful to make add-ons a property of the selected killer.
Killer Add-Ons
{
name: "Trapper Gloves",
image: "TrapperGloves.png",
description: "Protective padded leather gloves."
},
{...}
Add-Ons consist of three properties - name
, image
and description
- each of them being a simple string.
The name
-property is the display name of the add-on.
The image
-property is the filename of the add-on's icon. It is searched in assets/images/addons/killers/
. If it is not found, a placeholder will be used instead.
The description
-property is flavour text from the description of the add-on.
Perks
{
name: "A Nurse's Calling",
image: "ANursesCalling.png",
description: "Unlocks potential in one's Aura reading ability. [...]"
},
{...}
perks
is an array of objects, each with a name
, image
and description
-property.
The name
-property refers to the display name of the perk.
The image
-property refers to the filename of the perk's image. It is searched for in assets/images/perks/killer/
and a placeholder is used if not found. Please note that the image does not contain the coloured diamond used to indicate the "rarity" of the perk. It is solely the grayscale image within the diamond.
The description
-property is the actual description of the perk, formatted and colour-coded like the wiki.
Offerings
{
name: "Ebony Memento Mori",
image: "EbonyMementoMori.png",
description: "I could swear It spoke to the beast. It came to a halt, as if calmly listening to the leaves rustling, and then... grinned."
},
{...}
offerings
is an array of objects, each with a name
, image
and description
-property.
The name
-property refers to the display name of the offering.
The image
-property refers to the filename of the offerings's image. It is searched for in assets/images/offerings/
and a placeholder is used if not found. Please note that the image does not contain the coloured hexagon used to indicate the "rarity" of the offering. It is solely the grayscale image within the hexagon.
The description
-property is the flavour text of the offering.
Survivor Data
Survivors
{
name: "Dwight Fairfield",
image: "Dwight.png",
description: "Dwight isn't the typical guy [...]"
},
{...}
survivors
is an array of objects, with every survivor having the following properties: name
, image
and description
.
The name
-property is the display name of the survivor.
The image
-property refers to the filename of the survivor's portrait. It is searched for in assets/images/survivors/
and a placeholder is used if not found.
The description
-property is a simple string which adds flavour text from the wiki.
Item Groups
{
group: "Flashlights",
items: [...],
addons: [...]
},
{...}
itemGroups
is an array of objects, each with a group
, item
and addons
-property. They are used to group items with the same addons together, such as flashlights, med-kits, toolboxes, etc. Please note that the selection of items is based on the item group, not the individual items. As such, items from large item groups (e.g. toolboxes) are less likely to be drawn individually than an item from a small item group.
The group
-property is currently unused and only useful for debug purposes.
For more information, see Item Groups.
Items
{
name: "Flashlight",
image: "FlashlightItem.png",
description: "A standard Flashlight."
},
{...}
Items consist of a name
, image
and description
-property.
The name
-property refers to the display name of the item.
The image
-property refers to the filename of the item's image. It is searched for in assets/images/items/
and a placeholder is used if not found.
The description
-property is the flavour text of the item.
Item Add-Ons
{
name: "Battery",
image: "Battery.png",
description: "A standard battery of unknown brand."
},
{...}
Item Add-Ons consist of a name
, image
and description
-property.
The name
-property refers to the display name of the add-on.
The image
-property refers to the filename of the add-on's image. It is searched for in assets/images/addons/items/
and a placeholder is used if not found.
The description
-property is the flavour text of the add-on.
Perks
{
name: "Ace in The Hole",
image: "AceInTheHole.png",
description: "Lady Luck always seems to be throwing something good your way. [...]"
},
{...}
perks
is an array of objects, each with a name
, image
and description
-property.
The name
-property refers to the display name of the perk.
The image
-property refers to the filename of the perk's image. It is searched for in assets/images/perks/survivor/
and a placeholder is used if not found. Please note that the image does not contain the coloured diamond used to indicate the "rarity" of the perk. It is solely the grayscale image within the diamond.
The description
-property is the actual description of the perk, formatted and colour-coded like the wiki.
Offerings
{
name: "New Moon Bouquet",
image: "NewMoonBouquet.png",
description: "Better go back to sleep, there is no moon this night."
},
{...}
offerings
is an array of objects, each with a name
, image
and description
-property.
The name
-property refers to the display name of the offering.
The image
-property refers to the filename of the offerings's image. It is searched for in assets/images/offerings/
and a placeholder is used if not found. Please note that the image does not contain the coloured hexagon used to indicate the "rarity" of the offering. It is solely the grayscale image within the hexagon.
The description
-property is the flavour text of the offering.