Create a level¶
The fastest way is to duplicate a sample level. You can also build one from scratch.
Duplicate a sample level¶
- Duplicate
Scene/CampaignMode/E1M2_Underground.unity(Ctrl+D) and move the copy to your own folder. - Open it and delete the contents of
Level Geometry,Level SpawnsandLevel Logic. Keep everything else (managers,Player,UILevel,LoadingScreen, light, post-processing volume). - Build the geometry, set up the
GridMap, place content and set the goal (sections below). - Save the scene. Saving gives each persistent object the unique
mapIdthat checkpoints use. - Test it, then add it to the campaign.
Build from scratch¶
- Drag in
Prefabs/Core/CoreServices,GameplayCore,Managers/LevelManager,Managers/GameObjectPoolManager,Player,UILevel,AiasEventSystem, andPrefabs/Menu/LoadingScreen. - Delete the default camera: only the
Playercamera may be taggedMainCamera. - On
LevelCore(LevelManagerobject), set Campaign (empty =Resources/CampaignData), Starting Weapons (used when there is no save) and the medal requirements (default 100%). - 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×probeExtentRatio0.35; height fromstepHeight0.25 m up to 0.25 +probeHeight1.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):
- Assign
originAnchorto an object on the floor at the center of cell (0, 0). Cell(x, y)is atorigin + (x · cellSize, 0, y · cellSize).GameplayCoreincludes aGrid Origin1.05 m below it as a fallback. - Set
minCell, width and height to cover the level, andcellSize(3). - Set the blocking layers (walls) and floor layers.
- 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.