How the template works¶
Read this before creating content. Everything builds on four ideas: grid, turns, scene composition and data assets.
The grid¶
- The world is made of square cells (3 m in the samples). A cell is a
Vector2Int:x= world X,y= world Z. - One
GridMapper scene finds walkable cells by testing colliders. There's no wall matrix to edit. - Every actor occupies exactly one cell, even the boss. Movement is cardinal; yaw 0° points to
(0, 1).
When a cell is walkable¶
A cell is blocked when a solid collider on the blocking layers enters its test volume: a box at the cell
center, 70% of the cell width (2.1 × 2.1 m in a 3 m cell), from 0.25 m to 1.8 m high. With requireFloor, a
floor collider must also exist below. The width scales with cellSize; heights don't (adjust stepHeight and
probeHeight for other world scales).
- Floors need a collider (
MeshColliderworks). - Walls must reach more than 15% of the cell width into the cell they block (0.45 m at 3 m; use 0.5 m). A thin wall exactly on a cell border blocks neither cell.
- Anything under 0.25 m (rug, step, lava slab) doesn't block.
- Prefer
BoxCollideror convexMeshColliderover thick concave ones. - Props with a
BoxCollideron Default block their cell; put them in corners.
Tip
Select the GridMap for gizmos: green free, red blocked, blue actor, magenta pickup.
Turns¶
The TurnManager loops: player acts → enemies act one by one → player. Moving, attacking and using items
spend a turn; turning, interacting and menus don't. Moving enemies move together; attacks resolve one at a time.
Pacing fields on the TurnManager:
enemyTurnStartDelay(0.25 s): pause before the enemies react, only after the player attacks or uses an item, so the hit reads before the answer.movementOverlap(0 to 1): only after the player steps. 0 = enemies wait for the step to finish, 1 = they start moving together with the player.betweenEnemyActionsDelay(0.15 s): pause between attacking enemies, also only after an attack or item.playerTurnReturnDelay(0.10 s): pause before control returns to the player.
Traps, lava, buffs and regeneration listen to TurnManager.TurnStarted. Custom actors implement ITurnActor
(see Scripting entry points).
Compose a level scene¶
Duplicate a sample scene; it already has everything. A level needs:
| Object | Prefab | Role |
|---|---|---|
CoreServices |
Prefabs/Core/CoreServices.prefab |
Save, input, audio, language |
GameplayCore |
Prefabs/Core/GameplayCore.prefab |
GridMap, TurnManager, game state, checkpoint, minimap |
LevelManager |
Prefabs/Core/Managers/LevelManager.prefab |
Starting weapons, medal requirements, level end |
GameObjectPoolManager |
Prefabs/Core/Managers/GameObjectPoolManager.prefab |
Effect pool |
Player |
Prefabs/Core/Player.prefab |
Player (tag Player) |
UILevel |
Prefabs/Core/UILevel.prefab |
HUD and level screens |
AiasEventSystem |
Prefabs/Core/AiasEventSystem.prefab |
Input System EventSystem |
LoadingScreen |
Prefabs/Menu/LoadingScreen.prefab |
Transitions |
Add your geometry (with colliders) and content. Samples group the hierarchy into Level Geometry, Level Spawns
(named Prefab_x_y) and Level Logic.
Scene singletons
Keep exactly one of each manager per scene. They die with the scene; only SaveManager and a few internal
services persist.
Data lives in ScriptableObjects¶
Create them under Assets > Create > AiasTech. Main ones: TurnWeaponProfile (weapon/enemy attacks,
Data/Weapons/TurnProfiles, Data/Enemy/TurnProfiles), EnemyBehaviourSO / EnemyStateSO / EnemyActionSO
(Data/Enemy/AI), loot tables (Data/PickUp/LootTables), equipment (Data/Equipment), and the Resources
singletons CampaignData, Difficulty and GameSettings.
IDs and save¶
The save stores IDs, not names:
- Checkpointed scene objects get a
mapIdwhen the scene is saved (Ctrl+D makes a new one). Bulk-fill with Tools > AiasTech > Scene IDs > Assign In All Scenes. - Weapons get a
WeaponIDfrom the prefab GUID: Tools > AiasTech > Generate Weapon IDs. - Runtime-spawned objects (loot, minions) aren't checkpointed.
Wire objects with events¶
Level objects talk through UnityEvents wired by hand in the Inspector, e.g. a lever's ButtonDown calls
Door.OpenDoor. For code structure, see Code architecture.