Before you start making packs, you need a basic understanding of JSON files and how to make and edit them. You can learn about them at W3 schools.
When you make a JSON file, you can use JSON lint to validate and "clean up" the file (clean just means you add indentation).
All of your packs should be in the "packs" folder and have unique names. To ensure it has a uniqe name to every other pack out there, you can add your name or username to the end of the folder (ex: "packname-user").
Inside your pack, you will need a manifest.json file and a textures folder. If you are using any scripts you will need a folder titled scripts.
Inside your textures folder, you will have all the PNG files that will make up your maps. All of these should be squares of equal size, otherwisea the map won't turn out quite right.
NOTE: This guide will be using the default "Basic Forest" pack as an example.
Your manifest.json file will have four (4) things inside of it: the header, credits, scripts, and the tiles.
Your header is what tells Mapinator and the users what your pack is about. It contains title, which is your title, and description, which should be a short, one-sentence description of your pack. Your manifest file should now look something like this:
{
"header": {
"title": "Basic Forest",
"description": "A tileset for a random forest"
}
}
The credits are important to the pack, as it tells everyone who made the pack, and both names show up whenever someone looks at the credits. It contains a space for code and art. Please put the correct names/usernames for the people who worked on it. You can put anything in the spaces for them, so if you have multiple people working on the code, you can sepparate them with commas, as long as this is all in the quotations: "first name, another name"
With the header and credits, you shoud be looking somehting like:
{
"header": {
"Basic Forest",
"description": "A tileset for a random forest"
},
"credits": {
"code": "Connor Layson",
"art": "Connor Layson"
}
}
The tiles section is possibly the most important part. It is what actually makes up the map. The tiles is a list, which will contain a JSON object for each tile. Each tile has name, value, and weight.
name is the file name inside your textures folder. If your image is inside another folder, you will need to include that in the name. DO NOT include the file extention in the name.
value is just a number or single-character identifier. This is what the software uses to generate and display the map.
weight is the percentage (in decimal form) for how likely that tile is to generate. NOTE: All weight values in the whole pack should add up to 1.0 (100%)
With this addition, your manifest file should look something like:
{
"header": {
"Basic Forest",
"description": "A tileset for a random forest"
},
"credits": {
"code": "Connor Layson",
"art": "Connor Layson"
},
"tiles": [
{
"name": "small_tree",
"value": "0", //make sure you add this in quotes
"weight": 0.2
},
{
"name": "grass",
"value": "1",
"weight": 0.8
}
]
}
At this point, your manifest.json file can be done! It is done enough to make a basic pack, and it is done enough for most packs. If you are using scripts, you will need one more thing.
If you want to make your pack a liitle more advanced, you can get into scripts. Scripts are made with Python files, and run a function once after the map generates, and another runs constantly when the map is being displayed, after the tiles are drawn to the screen.
NOTE: Learn python before you do this.
You will need to add one more thing to your manifest.json file. You will need to add a scripts section. This is a list of each script filename in the scripts folder. Like the tiles, you will want to add any subfolders in front of the name, and leave off the .py extention. This makes the file look like:
{
"header": {
"Basic Forest",
"description": "A tileset for a random forest"
},
"credits": {
"code": "Connor Layson",
"art": "Connor Layson"
},
"tiles": [
{
"name": "small_tree",
"value": "0", //make sure you add this in quotes
"weight": 0.2
},
{
"name": "grass",
"value": "1",
"weight": 0.8
}
],
"scripts": [
"scriptName"
]
}
Your actual script file needs two functions: loop, and generate. Loop needs to have a screen in the parentesis (see the example). This will allow you to add pygame elements to the screen. Your script file should look like this, and you can add anything python inside the functions.
#Define imports and global variables here
def loop(screen):
#Stuff happens on loop while displaying the map
def generate():
#Stuff happens at the begining of generation
File tree:
-> packs
-> textures
grass.png
small_tree.png
manifeset.json
manifest.json:
{
"header": {
"Basic Forest",
"description": "A tileset for a random forest"
},
"credits": {
"code": "Connor Layson",
"art": "Connor Layson"
},
"tiles": [
{
"name": "small_tree",
"value": "0", //make sure you add this in quotes
"weight": 0.2
},
{
"name": "grass",
"value": "1",
"weight": 0.8
}
]
}