Skip to content

Map Format

Maps are stored as JSON files. The map editor exports this format, and the Mortar engine reads it at startup.

{
"version": 1,
"name": "My Map",
"entities": [...]
}
FieldTypeDescription
versionnumberFormat version (currently 1)
namestringDisplay name of the map
entitiesarrayList of entity objects

Each entity has a unique ID and a set of components:

{
"id": "entity-uuid",
"name": "Floor",
"components": {
"transform": {
"position": [0, 0, 0],
"rotation": [0, 0, 0, 1],
"scale": [10, 0.1, 10]
},
"mesh": {
"type": "box"
},
"material": {
"color": [0.3, 0.3, 0.35, 1.0]
},
"rigidBody": {
"type": "static"
},
"collider": {
"type": "box",
"halfExtents": [5, 0.05, 5]
}
}
}
FieldTypeDescription
position[x, y, z]World position
rotation[x, y, z, w]Quaternion rotation
scale[x, y, z]Scale on each axis
FieldTypeDescription
typestringPrimitive type: box, sphere, plane, cylinder
FieldTypeDescription
color[r, g, b, a]RGBA color (0-1 range)
FieldTypeDescription
typestringstatic or dynamic
massnumberMass in kg (dynamic only)
FieldTypeDescription
typestringbox, sphere, capsule
halfExtents[x, y, z]Half-size (box only)
radiusnumberRadius (sphere/capsule)