Plan JSON — kitforge-plan v1
A plan is data: rooms on the grid, door and window marks on named edges, a roof choice, and a seed. The JSON form is the same plan the canvas draws and the text parser produces — one model, three doors. A person, the Plan Canvas, or an external tool such as an AI coding agent can author it.
Example
{
"kitforge-plan": 1,
"name": "Sample Outpost",
"gridSize": 2.0,
"floors": 1,
"seed": 12345,
"roof": { "type": "Flat" },
"rooms": [
{
"id": "room_storage",
"role": "Storage",
"bounds": { "x": 0, "y": 0, "width": 4, "height": 3 },
"edges": [
{ "side": "South", "offset": 1, "mark": "Door" },
{ "side": "East", "offset": 1, "mark": "Window" }
]
}
]
}
Fields
Root
kitforge-plan— format version, always1. Required.name— plan name. DefaultUntitled Plan.gridSize— grid size in meters. Default2.0. Must be greater than zero.floors— storey count. Default1. Must be at least 1.seed— build seed. The same kit, plan, and seed produce the same structure. Default12345.roof.type—Flat,Pitched, orNone. DefaultFlat.rooms— the room list. A plan needs at least one room to build.
Room
id— room name.role—Generic,Storage,Living, orWatch. The role guides interior dressing: Storage favours crates, Living favours a table and bunk. DefaultGeneric.bounds—x,yorigin in grid cells,widthandheightin cells. Width and height must be positive.edges— marks on the room’s boundary. Each has aside(South,West,North,East), anoffsetin cells along that edge, and amark(Door,Window,Open, orWall). Default markWall.
Compatibility rules
- Unknown fields, at root or room level, are ignored — newer files stay readable.
- Missing fields take the defaults above.
Errors name the field
A malformed plan fails with the field named, never a bare exception:
- Missing or unsupported version:
Missing or invalid 'kitforge-plan' version. Field 'gridSize' must be greater than zero.Field 'floors' must be at least 1.Room '{id}' bounds width and height must be positive.Edge offset {offset} is out of bounds for room '{id}' on edge {side}.
Fix the named field and load the plan again. In code, load plans with
KitForge.LoadPlan — see the API Reference.