aboutsummaryrefslogtreecommitdiff
path: root/building_guide/tick_order.md
diff options
context:
space:
mode:
Diffstat (limited to 'building_guide/tick_order.md')
-rw-r--r--building_guide/tick_order.md47
1 files changed, 24 insertions, 23 deletions
diff --git a/building_guide/tick_order.md b/building_guide/tick_order.md
index 6138fbe..b4d1f1e 100644
--- a/building_guide/tick_order.md
+++ b/building_guide/tick_order.md
@@ -34,27 +34,28 @@ duplicates so any one of them drifting fails the test loudly.
| # | System | What it does |
| --- | ----------------------- | ------------------------------------------------------------------------------------------------------------------ |
| 1 | `ProcessQueuedCommands` | Drains each player's free-queued commands and the globally timestamp-sorted active queue; advances walk sequences. |
-| 2 | `MoveTick` | Counts down `p.MoveTicks`; on reach-zero, completes a pending run/walk and re-prompts. |
-| 3 | `SequenceTick` | Advances every active trigger `sequence` (per-player and global) one step. |
-| 4 | `TransientMobTick` | Despawns owned / `DespawnOnLeave` mobs whose owner has left their room. |
-| 5 | `World.Tick` | World-internal: ground-item respawn/despawn/reserve timers and shared-object deplete timers. |
-| 6 | `MobStore.Tick` | Mob shop restock and mob HP regenerate. Order: by `InstanceID` so processing is stable across ticks. |
-| 7 | `RegenTick` | Player HP regeneration, accelerated by tech HP-regen multipliers. |
-| 8 | `EnergyRegenTick` | Run-energy regeneration for every online player. |
-| 9 | `DisconnectTick` | Counts down pending disconnects and hard-removes finished sessions (skipping players still in combat). |
-| 10 | `WanderTick` | Mob wandering (exit-based) and object wandering (fishing spots), with enter/leave messages to observers. |
-| 11 | `SharedDepletionTick` | Ticks shared-object deplete timers up (in use) or down (recovering). |
-| 12 | `FireTick` | Decays fire objects; on burn-out, spawns the removal item and cancels stokers. |
-| 13 | `AdvanceActions` | Advances every active player action by one tick; fires completion handlers per action type. |
-| 14 | `TechTick` | Drains battery for active tech, applies equipment / PreserveDrain reductions, and deactivates all on empty. |
-| 15 | `ConsumeTick` | Counts down `ConsumeCooldown` and `HomeTransportCooldown`. |
-| 16 | `BroadcastRespawns` | Flushes respawned world objects and broadcasts their `respawn_broadcast` lines to players in those rooms. |
-| 17 | `VisualTick` | Optional per-player "visual tick" line/counter for AFK feedback. |
-| 18 | `SneakTick` | Advances guard watch timers and sneaking players' tick counters. |
-| 19 | `FarmTick` | Crops grow, drain water, and yield on harvest (fires every `FarmTickInterval` ticks). |
-| 20 | `BuffTick` | Potion buff duration countdown; expires and removes effects. |
-| 21 | `SafespotTick` | Safespot unsafe-chance and decay-chance rolls per player. |
-| 22 | `HazardTick` | Room hazard damage to non-GodMode players. |
+| 2 | `CasinoTick` | Advances casino betting deadlines and resolves completed casino rounds. |
+| 3 | `MoveTick` | Counts down `p.MoveTicks`; on reach-zero, completes a pending run/walk and re-prompts. |
+| 4 | `SequenceTick` | Advances every active trigger `sequence` (per-player and global) one step. |
+| 5 | `TransientMobTick` | Despawns owned / `DespawnOnLeave` mobs whose owner has left their room. |
+| 6 | `World.Tick` | World-internal: ground-item respawn/despawn/reserve timers and shared-object deplete timers. |
+| 7 | `MobStore.Tick` | Mob shop restock and mob HP regenerate. Order: by `InstanceID` so processing is stable across ticks. |
+| 8 | `RegenTick` | Player HP regeneration, accelerated by tech HP-regen multipliers. |
+| 9 | `EnergyRegenTick` | Run-energy regeneration for every online player. |
+| 10 | `DisconnectTick` | Counts down pending disconnects and hard-removes finished sessions (skipping players still in combat). |
+| 11 | `WanderTick` | Mob wandering (exit-based) and object wandering (fishing spots), with enter/leave messages to observers. |
+| 12 | `SharedDepletionTick` | Ticks shared-object deplete timers up (in use) or down (recovering). |
+| 13 | `FireTick` | Decays fire objects; on burn-out, spawns the removal item and cancels stokers. |
+| 14 | `AdvanceActions` | Advances every active player action by one tick; fires completion handlers per action type. |
+| 15 | `TechTick` | Drains battery for active tech, applies equipment / PreserveDrain reductions, and deactivates all on empty. |
+| 16 | `ConsumeTick` | Counts down `ConsumeCooldown` and `HomeTransportCooldown`. |
+| 17 | `BroadcastRespawns` | Flushes respawned world objects and broadcasts their `respawn_broadcast` lines to players in those rooms. |
+| 18 | `VisualTick` | Optional per-player "visual tick" line/counter for AFK feedback. |
+| 19 | `SneakTick` | Advances guard watch timers and sneaking players' tick counters. |
+| 20 | `FarmTick` | Crops grow, drain water, and yield on harvest (fires every `FarmTickInterval` ticks). |
+| 21 | `BuffTick` | Potion buff duration countdown; expires and removes effects. |
+| 22 | `SafespotTick` | Safespot unsafe-chance and decay-chance rolls per player. |
+| 23 | `HazardTick` | Room hazard damage to non-GodMode players. |
### Determinism contract
@@ -65,7 +66,7 @@ Three layers of ordering decide what happens on a given tick, in priority:
`cmd/thoi/main.go`) always fires first; every system in
`RunTickSystems` then runs in the table order above. Dynamic combat /
aggro / respawn subscribers registered later get higher IDs and fire
- after the canonical 22 systems. This is asserted by
+ after the canonical 23 systems. This is asserted by
`internal/engine/tick_test.go::TestProcessTickFiresInSubscriptionOrder`.
2. **Per-system iteration order** — deterministic, as of the deterministic
@@ -138,4 +139,4 @@ should fire *after* regen, a sequence whose step messages should appear
already advanced.
When in doubt, the test in `tick_systems_test.go` is the executable
-specification. \ No newline at end of file
+specification.