Skip to content

Create a level

The fastest way is to duplicate a sample level. You can also build one from scratch.

Duplicate a sample level

  1. Duplicate Scene/CampaignMode/E1M2_Underground.unity (Ctrl+D) and move the copy to your own folder.
  2. Open it and delete the contents of Level Geometry, Level Spawns and Level Logic. Keep everything else (managers, Player, UILevel, LoadingScreen, light, post-processing volume).
  3. Build the geometry, set up the GridMap, place content and set the goal (sections below).
  4. Save the scene. Saving gives each persistent object the unique mapId that checkpoints use.
  5. Test it, then add it to the campaign.

Build from scratch

  1. Drag in Prefabs/Core/CoreServices, GameplayCore, Managers/LevelManager, Managers/GameObjectPoolManager, Player, UILevel, AiasEventSystem, and Prefabs/Menu/LoadingScreen.
  2. Delete the default camera: only the Player camera may be tagged MainCamera.
  3. On LevelCore (LevelManager object), set Campaign (empty = Resources/CampaignData), Starting Weapons (used when there is no save) and the medal requirements (default 100%).
  4. Continue from step 3 above.

Build the geometry

Any mesh with a collider works.

  • Cells are 3 m in the sample levels; align walls and corridors to that step. The floor needs a solid collider (surface at y = -1.05 in the samples).
  • Walls must reach at least 0.5 m into the blocked cell. Each cell is tested with a test volume (half-width = cellSize × probeExtentRatio 0.35; height from stepHeight 0.25 m up to 0.25 + probeHeight 1.55 m), so a wall must intrude more than 15% of the cell. See How the template works.
  • The camera sits 0.75 m above the floor with a 60° vertical FOV; 3 m walls work well.

Set up the GridMap

On GridMap (inside GameplayCore):

  1. Assign originAnchor to an object on the floor at the center of cell (0, 0). Cell (x, y) is at origin + (x · cellSize, 0, y · cellSize). GameplayCore includes a Grid Origin 1.05 m below it as a fallback.
  2. Set minCell, width and height to cover the level, and cellSize (3).
  3. Set the blocking layers (walls) and floor layers.
  4. Check the Scene view gizmos: corridors green, walls red.

Place the content

Every actor stands at a cell center, one per cell; if two share a cell, one disables its GridMover. Use Snap To Grid on the GridMover Inspector. Props that should sit centered without occupying the cell use GridCellAlign.

Prefabs: player Prefabs/Core/Player (facing the start direction); enemies Prefabs/Enemy/* and Variants/* (Create an enemy); pickups Prefabs/PickUp/* (HealthArmor/*Over can exceed the maximum; a weapon you already own becomes ammo); doors, levers, chests, traps, platforms and the exit portal in Prefabs/Level (Level logic); NPCs in Prefabs/NPC; decoration in Prefabs/Level/Props/* (billboards with colliders that block the cell).

Set the level goal

The level ends when LevelCore.CompleteLevel() runs: it saves progress, computes the medal and shows the end screen. Either place a Prefabs/Level/Portal/LevelExitPortal (fires when the player enters its cell), or wire any UnityEvent (lever, boss death, trigger) to CompleteLevel.

Warning

CompleteLevel has no double-call guard. Make sure your trigger fires once (the portal already does).

Medals

Medals go from Bronze (finished) to Platinum (all three LevelCore requirements met):

  • Items: scene pickups with Counts As Item (not weapons). Health, armor and ammo can be picked up at maximum, so 100% is always reachable.
  • Enemies: scene-authored enemies.
  • Secrets: objects with Secret.

The save keeps each level's best run; points (multiplied by difficulty) go to the shop.

Before you ship a level

Confirm GridMap gizmos show no holes and no actors share a cell; keys are reachable before their doors; Load Checkpoint, Continue and Restart behave as expected; the end screen appears; and the minimap reveals rooms and doors.