1. Basic knowledge of plugin file structure
First, you need to have a basic knowledge of the plugin's file structure.
To gain it, there are several forms that are important to plugin makers.
(First, we should know the elemental and simple kinds of them.)
1. PNG files
Picture files that are saved with a file name ending in .png.
Example:
xxx_house.png
That means you need to save it as a PNG file so the Theotown program can successfully read it.
You can draw any “frames” you want to see or show in Theotown —
for example: a building, decoration, or even a road.
Main functions
PNG files mainly provide visual frames for the game program.
They help the program understand what your building or object looks like.
(If you don’t have any PNG file, the game will send an error message.)
Rules
You need at least one picture for the game to render your object.
In theory, the image can look like anything you want — but it must follow certain rules:
Every building has a “base”, a kind of ground tile that belongs to the modular ground structure.
You can find those base grounds (PNG files) in the official plugin portal.
They usually look like small diamond-shaped green tiles.
You can safely use them when designing your plugin (and delete them later if you want).
2. JSON files
In addition to PNG files, you’ll need JSON files.
They define how both the properties and appearance behave in the game.
JSON is a kind of text file that is easy for both humans and computers to understand.
Example JSON file
Below is a simple example of a commercial building JSON structure:
Code: Select all
[
{
"id": "Seven_Taiwan_tin",
"author": "user383828228",
"frames": [{ "bmp": "7ven_Taiwan_tin.png" }],
"build_time": 6,
"width": 3,
"height": 3,
"level": 2,
"type": "commercial"
},
{
"id": "Seven_Taiwan_flat",
"author": "user383828228",
"frames": [{ "bmp": "7ven_Taiwan_flat.png" }],
"build_time": 6,
"width": 3,
"height": 3,
"level": 2,
"type": "commercial"
}
]
1. Key–value pairs
JSON files are made of key–value pairs, like this:
"key": "value"
Example:
Code: Select all
{ "id": "Seven_Taiwan_tin", "author": "user383828228" }
and each value defines the actual content.
2. Objects
When you wrap several key-value pairs in { },
it becomes a JSON object.
Example:
Code: Select all
{
"id": "Seven_Taiwan_tin",
"author": "user383828228",
"build_time": 6,
"width": 3,
"height": 3,
"level": 2,
"type": "commercial"
}
When there are two or more objects, they are enclosed by [ ],
forming an array.
Example:
Code: Select all
[
{ "id": "Building_1", "type": "residential" },
{ "id": "Building_2", "type": "industrial" }
]
Here are the most common and important JSON keys in Theotown plugins:
id
Acts like a product identification code.
Every plugin’s ID must be unique, or the game will show an error.
author
Defines the author name.
It doesn’t affect functionality — you can even use a nickname.
frames
Tells the program which image(s) to load.
Example:
Code: Select all
"frames": [{ "bmp": "building_1.png" }]
Code: Select all
"frames": [
{ "bmp": "building_1.png" },
{ "bmp": "building_2.png" }
]
(including uppercase/lowercase letters).
build_time
Defines how long it takes to construct the building.
Example:
Code: Select all
"build_time": 6
width / height
Defines the base size of the building:
Code: Select all
"width": 3,
"height": 3
Code: Select all
"size": [3, 3]
Defines which level the building appears under in the game (1, 2, 3, etc.).
type
Defines what kind of building or object it is.
Common types include:
building
commercial
residential
industrial
park
decoration
road
car
train
3. File location and packaging
After understanding both PNG and JSON,
you need to know how to properly package your plugin.
Theotown plugins must be saved as .zip files.
The structure must be directly inside the ZIP, not inside a subfolder.
Correct structure:
xxx_house.zip
├── xxx.png
└── xxx.json
Make sure your .json and .png file names match.
Then, zip them together and you’re done!
You can now try making your first simple plugin!
Start small — maybe a 1×1 building or decoration —
and experiment with changing values in the JSON to see how it behaves.
Once you get the hang of it,
you can move on to advanced topics like animations, effects, or scripts.
Thanks for watching!!

