Skip to main content
Formal Specification

Mirror — Formal Specification

Finland · chase-tag · Confidence: high

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 4
# Peili — AI-optimized specification ## General idea A traditional stop-and-go stealth racing game. A designated "Mirror" (*peili*) stands at the finish line with their back turned away from advancing runners. Runners advance stealthily toward the Mirror while the Mirror's back is turned. The moment the Mirror spins around to face the field, all runners must freeze completely motionless; any runner caught moving or failing to stop in time is penalized and sent back to the starting line. The first runner to touch the Mirror's back wins. ## Formal model - **Abstraction taken:** The continuous physical advance and visual motion detection are discretized into a 1D longitudinal racing lane of length L with discrete time ticks. The Mirror's head orientation (FacingAway vs FacingField) transitions between intervals, and the runners choose movement speeds with deceleration braking latency. - **Player/agent count:** N agents (3≤N≤20), comprising 1 Mirror and N−1 Runners. - **Turn model:** Real-time ticked synchronous execution. ## Formal rules R1. **Track Setup:** - A 1D track of length L (e.g. L=30 grid steps). - Start line is at x=0. Finish line (where the Mirror stands) is at x=L. - All N−1 runners begin at x=0 with velocity v=0. R2. **Mirror State & Turning Dynamics:** - The Mirror has state θ∈{FacingAway,FacingField}. - While FacingAway, the Mirror chooses either to remain facing away or initiate a `turn_around()` action. - [gap-fill] The Mirror's turn takes 1 tick to complete, during which an audio/visual cue is generated. R3. **Runner Advance & Braking:** - On each tick while the Mirror is FacingAway, each runner chooses acceleration a∈{0,1,2}, updating speed v←min⁡(v+a,vmax⁡) and position x←x+v. - When the Mirror initiates a turn, runners must execute `brake()` to reduce v to 0. [gap-fill] If speed v>0 when the Mirror reaches state FacingField, the runner is flagged with `motion_detected = true`. R4. **Motion Detection & Penalty:** - When the Mirror is FacingField, all runners with `motion_detected == true` are identified. - Any flagged runner is immediately reset to x=0 with v=0. - Unflagged runners maintain their current advanced position x. - [gap-fill] The Mirror remains FacingField for a dwell duration of Tscan=3 ticks, after which the Mirror turns back to FacingAway. R5. **Victory Condition:** - If any runner reaches position x≥L while the Mirror is in state FacingAway, that runner touches the Mirror's back and wins the round immediately. - [gap-fill] If multiple runners cross x≥L on the same tick, the runner who achieved higher final position (or lower agent ID) is declared the winner. ## Edge cases - **Tie at the end condition:** Handled by R5 (distance beyond L, then agent ID). - **A player with no legal move:** Runners always have acceleration/braking options; Mirror always has wait/turn options. - **Repetition / cycles:** Runners sent back to x=0 can try repeatedly. To guarantee termination, a global maximum match duration of Tmax⁡=500 ticks is enforced; if reached, the runner with highest position x is declared the winner. - **Simultaneous claims on the same resource or position:** Multiple runners can occupy the same x coordinate without interference. - **Player elimination mid-round; turn order repair:** Not applicable — runners are never eliminated; they are merely reset to x=0 upon penalty. - **Resource exhaustion (pieces, tokens, space, time):** Fixed track length L and finite duration Tmax⁡. - **Termination guarantee: why the game provably ends:** Enforced by the finite match horizon Tmax⁡, and probabilistically by the fact that safe creep strategies (v=1) have non-zero probability of reaching x=L before Tmax⁡. ## State representation - **Persistent state:** Track length L; total runners N−1; match tick t; active round state ∈{in_progress,completed}. - **Mirror state:** Orientation θ∈{FacingAway,FacingField}; time until next turn decision; scan timer. - **Per-runner state:** Position xi∈[0,L]; current velocity vi∈[0,vmax⁡]; motion flag ∈{true,false}. - **Observable information:** Imperfect information. Runners observe the Mirror's state and audible turn cues. The Mirror observes runner motion only when FacingField. ## Action space - `runner_action(accelerate_amount)`: where `accelerate_amount` ∈{−vmax⁡,…,+2} (negative values represent braking). - `mirror_turn()` / `mirror_wait()`: (Mirror only). ## Playability notes - **Single-player-vs-AI:** Highly playable. Human plays a runner testing risk thresholds (sprinting fast vs creeping cautiously) against an AI Mirror with stochastic turn intervals. - **Group games (n>4):** Naturally generalizes to any number of runners without modifying game rules. - **Physical-skill games:** Physical balancing and stillness are abstracted into kinematic velocity stopping constraints. - **What is lost in the adaptation:** The physical trembling of maintaining an awkward freeze stance and the social comedy of suppressing laughter. ## Implementation hints - Implement as a simple 1D kinematic simulation with a state machine for the Mirror. - Branching factor: 4 acceleration choices per runner; 2 choices for Mirror. - Suggested first milestone: Implement a 1-runner 1-Mirror environment with 20 track steps, verifying that failing to brake before the Mirror turns resets position to 0.

Download as JSON

Download the full game corpus entry for this game as structured JSON.

Download JSON
Cite this page

Mirror (Finland). (n.d.). Games of Countries. https://gamesofcountries.com/games/fi-finland/peili

@misc{gamesofcountries-fi-finland-peili,
  title = {Mirror (Finland)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/fi-finland/peili}
}