// documentation v1.0
format: 1.0

Level JSON
Format

Complete reference for authoring level files. Every level is a single .json file describing the player, objects, lighting, and skybox.

01

Root Structure

The top-level object contains metadata and four main sections. All fields are required unless marked optional.

FieldTypeReqDescription
levelName string yes Display name of the level shown in menus.
levelNo number yes Integer index. Used for level ordering and save data.
version string yes Format version string. Always "1.0".
texelsPerUnit number yes Texture scale multiplier applied globally. 1.0 is default.
player object yes Player configuration. See player section.
objects array yes All scene objects. See objects section.
lights array yes All light sources. See lights section.
skybox object yes Six skybox face image paths. See skybox section.
02

player

Defines the first-person player: camera settings, spawn position, physics, and audio.

FieldTypeReqDescription / Notes
imgstringyesPath to the player diffuse texture.
img_specstringyesPath to specular map. Can be same as img.
shaderstringyesShader name. Use "pointLightShader" for point-lit scenes.
moveSpeednumberyesUnits per second. Typical range: 2.0–5.0.
positionarray[3]yes[x, y, z] world spawn position.
scalearray[3]yesPlayer collision box scale. X is typically 0.0 (no model shown).
yawnumberyesInitial horizontal look angle in degrees.
pitchnumberyesInitial vertical look angle in degrees.
heightnumberyesCamera eye height above the player's base position.
fovnumberyesVertical field of view in degrees. Typical: 45.0–90.0.
farPlanenumberyesCamera far clip distance. Increase for larger levels.
nearPlanenumberyesCamera near clip distance. Keep at 0.1.
verticalForcenumberyesJump impulse strength. Higher = bigger jump. Typical: 5.0–8.0.
isUnderWaterbooleanyesEnables underwater post-processing effect on spawn.
walkstringyesPath to footstep audio file.
jmpstringyesPath to jump sound effect.
childrenarrayoptChild objects attached to the player. Usually empty [].
player — example
"player": {
  "img":           "Assets\\Images\\lv1\\player.png",
  "img_spec":      "Assets\\Images\\lv1\\player.png",
  "shader":        "pointLightShader",
  "moveSpeed":     3.5,
  "position":     [ -2.0, 4.0, 0.0 ],
  "scale":         [ 0.0, 1.0, 0.5 ],
  "yaw":           0.0,
  "pitch":         0.0,
  "height":        1.4,
  "fov":           45.0,
  "farPlane":      100.0,
  "nearPlane":     0.1,
  "verticalForce": 5.0,
  "isUnderWater":  false,
  "walk":          "Assets\\Audio\\walk.wav",
  "jmp":           "Assets\\Audio\\jmp.wav",
  "children":      []
}
03

objects

An array of scene objects. Each object is a platform, wall, prop, or decoration placed in world space.

Object types — currently the engine supports the following type values:
"static_platform"
A solid collidable surface. Used for floors, walls, ceilings, ramps, and cover boxes. Most common type.
"model"
A 3D OBJ mesh loaded from disk. Uses model path instead of img. Suited for complex geometry.
FieldTypeReqDescription / Notes
idnumberyesUnique integer ID per object. Must not repeat within a level.
typestringyes"static_platform" or "model".
imgstringyes*Diffuse texture path. Required for static_platform. Omit for model type.
img_specstringyes*Specular map path. Usually same as img.
modelstring*Path to .obj file. Only used when type is "model".
shininessnumberyesSpecular highlight sharpness. 0 = matte, 128 = mirror-like. Typical: 8–32.
noOfRepeationXnumberyesTexture tile count on the X axis. Higher = smaller tiles.
noOfRepeationYnumberyesTexture tile count on the Y axis.
hasAudiobooleanyesWhether this object emits audio.
shaderstringyesShader program name. See Shaders reference.
audiostringyesAudio file path. Used when hasAudio is true. Otherwise ignored (still required as empty string or dummy path).
is3dAudiobooleanyesIf true, audio attenuates with distance from the player.
positionarray[3]yes[x, y, z] world position of the object's center.
rotationAnglenumberyesRotation in degrees around rotationAxis.
rotationAxisarray[3]yesNormalized axis vector for rotation. [0,1,0] = rotate around Y (yaw). [0,0,1] = roll (for ramps).
scalearray[3]yes[x, y, z] size in world units. A floor might be [10, 0.1, 10], a wall [0.1, 5, 10].
dynamicFrictionnumberyesFriction coefficient. 0 = ice, 1 = sticky. Typical: 0.6–0.8.
bouncenessnumberyesRestitution / bounciness. 0 = no bounce, 1 = full elastic.
massnumberyesPhysics mass in kg. High mass = harder to push. 1000+ for immovable terrain.
isStaticbooleanyesIf true, excluded from physics simulation entirely (zero cost). If false, participates in physics.
isMovablebooleanyesWhether the object can be moved by forces or player interaction.
meshEnabledbooleanyesToggles the collision mesh. Disable for thin planes that don't need collision (e.g. carpet overlays).
movablenull / objectoptMovable behaviour config. Set to null when unused.
Rotation tip: For ramps, use rotationAxis: [0, 0, 1] with a small rotationAngle like 10–20. For walls rotated in the horizontal plane, use [0, 1, 0] with 90.
meshEnabled vs isStatic: Use meshEnabled: false for decorative overlays like carpets placed on top of floors. Use isStatic: false to let the physics engine track the object (required even for non-moving objects in most setups).
object — static_platform floor
{
  "id":             1,
  "type":           "static_platform",
  "img":            "Assets\\Images\\lv1\\ground.png",
  "img_spec":       "Assets\\Images\\lv1\\ground.png",
  "shininess":      16.0,
  "noOfRepeationX": 4,
  "noOfRepeationY": 4,
  "hasAudio":       false,
  "shader":         "pointLightShader",
  "audio":          "Assets\\Audio\\lv1\\bg.wav",
  "is3dAudio":      false,
  "position":       [ 0.0, 0.0, 0.0 ],
  "rotationAngle":  0.0,
  "rotationAxis":   [ 0.0, 1.0, 0.0 ],
  "scale":          [ 10.0, 0.1, 10.0 ],
  "dynamicFriction": 0.8,
  "bounceness":     0.0,
  "mass":           1000.0,
  "isStatic":       false,
  "isMovable":      false,
  "meshEnabled":    true,
  "movable":        null
}
object — wall (rotated 90° on Y)
{
  "id":             2,
  "type":           "static_platform",
  "img":            "Assets\\Images\\lv1\\wall.png",
  "img_spec":       "Assets\\Images\\lv1\\wall.png",
  "shininess":      8.0,
  "noOfRepeationX": 4,
  "noOfRepeationY": 4,
  "hasAudio":       false,
  "shader":         "pointLightShader",
  "audio":          "Assets\\Audio\\lv999.wav",
  "is3dAudio":      false,
  "position":       [ 10.0, 0.0, 0.0 ],
  "rotationAngle":  90.0,   // rotate 90° around Y to face Z-axis
  "rotationAxis":   [ 0.0, 1.0, 0.0 ],
  "scale":          [ 0.1, 5.0, 10.0 ],
  "dynamicFriction": 0.8,
  "bounceness":     0.0,
  "mass":           1000.0,
  "isStatic":       false,
  "isMovable":      false,
  "meshEnabled":    true,
  "movable":        null
}
04

lights

An array of light sources. Multiple lights are supported. Each light has a type, color, position or direction, and Phong shading parameters.

FieldTypeReqDescription
typestringyes"point" or "directional". See Light Types.
colorarray[4]yesRGBA light color tint. [1,1,1,1] = white. Values 0–1.
positionarray[3]*World position. Required for point lights.
directionarray[3]*Light direction vector. Required for directional lights.
scalearray[3]yesVisual scale of the light source gizmo. Does not affect radius. Keep small: [0.1, 0.1, 0.1].
ambientarray[4]yesRGBA ambient term. Fills shadow areas. Keep dark: [0.1–0.2, ...]. Yellow ambient causes yellow tinting.
diffusearray[4]yesRGBA diffuse term. Main surface lighting color. For neutral: [0.8, 0.8, 0.8, 1].
speculararray[4]yesRGBA specular highlight color. Keep neutral or match diffuse.
shininessnumberyesPhong shininess exponent. Higher = tighter highlights. Typical: 16–64.
Common mistake: Setting ambient to [1.0, 1.0, 0.0, 1.0] makes the entire scene look yellow because ambient is added to every surface. Keep ambient dark and neutral — e.g. [0.15, 0.1, 0.05, 1.0] for warm torchlight.
light — warm point light (torch)
{
  "type":      "point",
  "color":     [ 1.0, 0.85, 0.5, 1.0 ],
  "position":  [ 0.0, 4.9, 0.0 ],
  "scale":     [ 0.1, 0.1, 0.1 ],
  "ambient":   [ 0.15, 0.1, 0.05, 1.0 ],
  "diffuse":   [ 1.0, 0.85, 0.5, 1.0 ],
  "specular":  [ 0.8, 0.7, 0.4, 1.0 ],
  "shininess": 32.0
}
light — neutral directional (sun)
{
  "type":       "directional",
  "color":      [ 1.0, 1.0, 1.0, 1.0 ],
  "direction":  [ -0.3, -1.0, 0.2 ],  // angled downward like a sun
  "scale":      [ 0.1, 0.5, 0.1 ],
  "ambient":    [ 0.2, 0.2, 0.2, 1.0 ],
  "diffuse":    [ 0.8, 0.8, 0.8, 1.0 ],
  "specular":   [ 0.6, 0.6, 0.6, 1.0 ],
  "shininess":  16.0
}
05

skybox

Six image paths for a cube-mapped skybox. Each face must be the same resolution.

FieldTypeDescription
topstring+Y face (sky above).
bottomstring−Y face (ground below).
frontstring+Z face.
backstring−Z face.
leftstring−X face.
rightstring+X face.
skybox — example
"skybox": {
  "top":    "Assets\\Images\\lv1\\top.png",
  "bottom": "Assets\\Images\\lv1\\bottom.png",
  "front":  "Assets\\Images\\lv1\\front.png",
  "back":   "Assets\\Images\\lv1\\back.png",
  "left":   "Assets\\Images\\lv1\\left.png",
  "right":  "Assets\\Images\\lv1\\right.png"
}
06

Shaders

The shader field on both player and objects selects the GLSL program used to render that mesh.

Shader NameUse OnDescription
pointLightShader objects, player Phong shading driven by point lights in the scene. Use this for indoor/enclosed levels with explicit light sources.
directionalLight objects Phong shading driven by a directional light (sun-like). Use for outdoor/open levels or model objects.
Mixing shaders: You can mix shaders within a level — for example, use directionalLight on large terrain meshes and pointLightShader on props and the player. Match each object's shader to the light type it should respond to.
07

Light Types

Two light types are supported. Choose based on the scene's mood and scale.

TypeRequired FieldBehavior
point position [x,y,z] Emits light in all directions from a world position. Attenuates with distance. Ideal for torches, lamps, and interior lighting. Place near the ceiling or inside lanterns.
directional direction [x,y,z] Infinite parallel light with no falloff. All surfaces lit equally regardless of distance. Ideal for sunlight, moonlight. Direction should point toward surfaces, e.g. [-0.3, -1.0, 0.2].
Multiple lights: You can have several point lights in one level to simulate torches at different positions. Each light adds to the scene — ambient values stack, so keep individual ambient values low when using multiple lights.
08

Full Example

A minimal but complete level file — one room with floor, four walls, ceiling, and a point light.

level_minimal.json
{
  "levelName":      "The First Room",
  "levelNo":        1,
  "version":        "1.0",
  "texelsPerUnit":  1.0,

  "player": {
    "img":           "Assets\\Images\\lv1\\player.png",
    "img_spec":      "Assets\\Images\\lv1\\player.png",
    "shader":        "pointLightShader",
    "moveSpeed":     3.5,
    "position":      [ 0.0, 1.0, 0.0 ],
    "scale":         [ 0.0, 1.0, 0.5 ],
    "yaw":           0.0,  "pitch": 0.0,
    "height":        1.4,
    "fov":           45.0,
    "farPlane":      100.0,  "nearPlane": 0.1,
    "verticalForce": 5.0,
    "isUnderWater":  false,
    "walk":          "Assets\\Audio\\walk.wav",
    "jmp":           "Assets\\Audio\\jmp.wav",
    "children":      []
  },

  "objects": [
    { "id": 1, "type": "static_platform",
      "img": "Assets\\Images\\lv1\\ground.png", "img_spec": "Assets\\Images\\lv1\\ground.png",
      "shininess": 16.0, "noOfRepeationX": 4, "noOfRepeationY": 4,
      "hasAudio": false, "shader": "pointLightShader",
      "audio": "Assets\\Audio\\lv1\\bg.wav", "is3dAudio": false,
      "position": [0,0,0], "rotationAngle": 0, "rotationAxis": [0,1,0],
      "scale": [10,0.1,10], "dynamicFriction": 0.8, "bounceness": 0,
      "mass": 1000, "isStatic": false, "isMovable": false,
      "meshEnabled": true, "movable": null }
  ],

  "lights": [
    {
      "type":      "point",
      "color":     [ 1.0, 1.0, 1.0, 1.0 ],
      "position":  [ 0.0, 4.9, 0.0 ],
      "scale":     [ 0.1, 0.1, 0.1 ],
      "ambient":   [ 0.2, 0.2, 0.2, 1.0 ],
      "diffuse":   [ 0.8, 0.8, 0.8, 1.0 ],
      "specular":  [ 0.6, 0.6, 0.6, 1.0 ],
      "shininess": 16.0
    }
  ],

  "skybox": {
    "top":    "Assets\\Images\\lv1\\top.png",
    "bottom": "Assets\\Images\\lv1\\bottom.png",
    "front":  "Assets\\Images\\lv1\\front.png",
    "back":   "Assets\\Images\\lv1\\back.png",
    "left":   "Assets\\Images\\lv1\\left.png",
    "right":  "Assets\\Images\\lv1\\right.png"
  }
}