<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
Every zone (location) in the game shares one continuous merge board. The level system is built of the following components:
LevelDatabase - top-level ScriptableObject holding the zone list, a reference to the shared merge board, and global visual/UI settings.ZoneData - one zone/location asset: unlock condition, buildings, and progression steps.MergeLevelData - the single shared merge grid (size + cell contents), used by every zone.MergeDatabase - catalog of every merge item: grades, sprites, and per-grade behavior config.MergeFieldObject - base class for anything sitting in a grid cell (the game unit): MergeItem, CurrencyItem, EnergyItem, SpawnerObject, ChestObject.TaskController / ITask - client-order and zone-progression task system that drives what the player is asked to do in a zone.These assets are stored in Assets/Project Files/Data/Level System.
<aside>
💡 To open the Level Editor, use the menu: Window - Level Editor
</aside>

<aside> 🧩 Merge items, item grades, and spawner/chest configs now live on their own page: Merge Items & Branches
</aside>
flowchart TD
A["Player upgrades buildings in the zone"] --> B{"Total upgrades reach this step's atUpgrade?"}
B -- "not yet" --> A
B -- "yes" --> C["Progression step activates"]
C --> D["Grant exp level (optional)"]
D --> E["Play dialog (optional)"]
E --> F["Give reward (optional)"]
F --> G["Step's tasks unlock"]
G --> H["Sequential tasks added, one batch at a time"]
H --> I["Random task pool kept topped up once sequential queue is drained"]
In simple words: every zone has a numbered list of progression steps (ZoneData.progression). Each step is tied to a total count of building upgrades in that zone (atUpgrade). Once the player reaches that count:
These tasks (mostly client orders) are what the player actually does next - completing them is what drives progress toward the next step. Field-level detail is in Zone progression queue below.
Every task implements ITask (TaskId, IsComplete, OnProgressChanged) and is tracked by TaskController, one instance per game, holding the active tasks for the current zone.
ClientOrderTask - implements IFieldAwareTask, asks the player to hand over specific items (typeId + grade). It rescans the merge grid on every field change to auto-bind unfulfilled requirement slots to matching, unclaimed field objects; completing still requires the player to press the order's Give button.PlaceholderTask - a filler card shown when the random progression pool is coin-gated (see below) so the task panel isn't left empty. Never completes on its own.Think of this as a task-dispenser for the zone. It always has one of two "modes": working through a fixed, ordered list first, then switching to a self-refilling random pool once that list is empty.
Step 1 - building the ordered list. Every ZoneProgressionStep the player has reached (atUpgrade <= total upgrades done in the zone) contributes its sequentialTasks entries. These are pooled from all reached steps together, sorted by atUpgrade, into one single list - it's not "finish step 1's tasks, then step 2 unlocks its own separate list". If the player upgrades fast and reaches steps 1 and 2 before finishing either, both steps' entries are already sitting in the same list, back to back.
Step 2 - the list is handed out in batches, not all at once. Each entry is tagged Sequential or Parallel:
Sequential entry always starts a new batch, and that batch won't be handed out until the previous batch is fully completed.Parallel entry right after it joins that same batch (shown to the player at the same time).Example: step at atUpgrade = 3 defines [Sequential: OrderA, Parallel: OrderB, Sequential: OrderC].
{OrderA, OrderB} - both appear together (B is Parallel, so it rides along with A).{OrderC} - only added once batch 1 is fully done (C is Sequential, so it waits).Step 3 - once the ordered list is empty, switch to the random pool. The pool used is the randomTasks from the latest reached step that actually has one (a later step's pool replaces an earlier one's - they don't merge). It's kept topped up to maxSimultaneousRandomTasks at all times: whenever the player finishes one, a replacement is drawn immediately (no waiting for a whole batch like Step 2). Picks are weighted, and the system avoids repeating the exact task or character that's already active, when it has another option.
Example: pool = {OrderE weight 5, OrderF weight 3}, maxSimultaneousRandomTasks = 2 → both E and F appear right away. Player hands in E → one new task is drawn immediately to replace just that slot; F stays untouched.
Step 4 - the coin-gate pause (stopSpawnCoinMultiplier). This stops the random pool from over-feeding a player who's sitting on coins instead of spending them. If stopSpawnCoinMultiplier > 0 and the player's coins reach that many times the cheapest upgrade currently available in the zone, new random tasks stop spawning - a PlaceholderTask card fills the empty slot instead (it never completes on its own, just prevents an empty task panel). Once the player spends coins back below that threshold (e.g. buys the upgrade), the gate lifts, the placeholder is removed, and real random tasks resume.
Example: cheapest available upgrade costs 100 coins, stopSpawnCoinMultiplier = 2.5 → once the player holds >= 250 coins, the random slot shows a placeholder instead of a new order. Spend down below 250 (e.g. buy that upgrade) → placeholder is swapped for a real task again.
zones - every ZoneData in the game. Order matters - it's the order zones appear in the zone-select UI.mergeLevelData - the single MergeLevelData asset (grid size + cell contents) shared by every zone's merge board.halfLockedItemSprite / lockedItemSprite - overlay sprites drawn on top of half-locked / locked cells, both in-game and in the Level Editor's Show locked visuals preview.actionButtonIcons - icon per ActionButtonType (Sell / Delete / Spawn / …), looked up by GetActionButtonIcon(type) for the field object's action button.cellColorA / cellColorB - alternating background tint for the merge grid's checkerboard cells.magnetRadius - pixel radius, around a dragged item, in which nearby matching items get pulled toward it.magnetStrength - how strongly items inside the magnet radius are pulled (0-1).mergeThreshold - pixel distance at which a dropped item is considered close enough to another matching item to trigger a merge.