Skip to main content
Formal Specification

Church rat — Formal Specification

Finland · hide-seek · Confidence: high

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 4
# Kirkonrotta — AI-optimized specification ## General idea A high-stakes spatial hide-and-seek game with sprint-racing and prison-break mechanics. A solitary seeker guards a home base while scanning the environment for hidden players. When a hider is spotted, both seeker and hider sprint toward the base in a race to touch it first: the seeker to imprison the hider, or the hider to save themselves or liberate all previously captured prisoners in a single jailbreak. ## Formal model - **Abstraction taken:** The continuous play area is discretized into a 2D grid containing obstacles/hiding cells providing line-of-sight (LOS) occlusion. Continuous running speeds are modeled as grid step budgets per tick, and shouting/tagging at base is modeled as an atomic interaction action at base coordinates (xbase,ybase). - **Player/agent count:** N agents (4≤N≤20), configured as 1 Seeker and N−1 Hiders. - **Turn model:** Simultaneous discrete execution per tick. ## Formal rules R1. **Setup & Countdown:** Home base is located at coordinate B=(x0,y0). During countdown ticks t∈[1,Tcount]: - Seeker is pinned at B with zero vision (blind state). - Hiders move freely to seek cover behind occluding obstacles. R2. **Active Search Phase:** At t=Tcount+1, the Seeker gains raycast line-of-sight (LOS) up to vision radius Vseeker and roams the grid. R3. **Spotting Action:** If an un-jailed, un-saved hider Hi enters the Seeker's unoccluded LOS, the Seeker may execute `spot(H_i)`. This action tags Hi as "spotted" and publishes Hi's spotted status to all agents. R4. **Base Racing & Tagging:** - **Seeker Jailing:** If the Seeker is at cell B and executes `claim_capture(H_i)` while Hi is spotted and Hi has not reached B, Hi transitions to state `jailed` at the jail zone adjacent to B. - **Self-Save ("Oma rotta"):** If an un-jailed hider Hi reaches cell B and executes `claim_self_save()`, Hi transitions to state `safe` for the remainder of the round, regardless of whether Hi was previously spotted. - **Jailbreak ("Kaikki rotat"):** If an uncaught hider Hi reaches cell B and executes `claim_jailbreak()`, all agents currently in state `jailed` immediately transition to state `free`. [gap-fill] The Seeker is penalized by being immobilized at B with blind vision for Tpenalty=20 ticks, allowing freed players to re-hide. R5. **Action Conflict Resolution:** [gap-fill] If the Seeker and a spotted hider Hi reach B on the exact same tick and execute conflicting claims, the claim of the agent who possessed higher movement speed into the cell succeeds; if equal, the hider's save succeeds. R6. **Round Termination & Rotation:** - The round ends immediately when every hider is either `jailed` or `safe`. - [gap-fill] If all active hiders are jailed, the first player who was jailed becomes the Seeker for the next round. If all hiders reach `safe` (e.g. via repeated jailbreaks), the current Seeker remains Seeker for the next round. ## Edge cases - **Tie at the end condition:** Not applicable — each hider binary status (`jailed` vs `safe`) is determined individually. The Seeker wins if all hiders are jailed; hiders win collectively if any hider achieves `safe` or triggers a game-ending save. - **A player with no legal move:** Jailed or safe players have no movement actions (action defaults to `noop`). Active players always have at least `stand_still`. - **Repetition / cycles:** [gap-fill] To prevent endless looping between jailbreaks and re-captures, a global hard limit of Tmax⁡=1500 ticks (or a maximum of 3 jailbreaks per round) is enforced. Upon reaching the limit, all currently un-jailed players are marked `safe`. - **Simultaneous claims on the same resource or position:** Resolved by R5 for base claims. Spatial grid cell stacking is allowed up to 4 agents per cell at base and jail zones. - **Player elimination mid-round; turn order repair:** When a player is jailed or safe, their state transitions to inactive without altering the simultaneous tick order of remaining active agents. - **Resource exhaustion (pieces, tokens, space, time):** Bounded grid and fixed player count. Time bounded by Tmax⁡. - **Termination guarantee: why the game provably ends:** Monotonic progress is enforced by the hard tick ceiling Tmax⁡ and the finite maximum jailbreak count. ## State representation - **Persistent state:** Grid layout with static obstacle map; coordinates of base B and jail zone; global tick t; countdown duration Tcount; jailbreak counter. - **Per-player state:** Position (x,y); status ∈{hiding,spotted,jailed,safe}; role ∈{seeker,hider}; order of capture index. - **Per-turn ephemeral state:** List of spotted declarations; set of agents occupying base cell B this tick; resolved save/jail events. - **Observable information:** Imperfect information. Seeker observes only unoccluded cells in LOS. Hiders observe local LOS and global announcements of spotted/jailed/saved events. ## Action space - `move(dx, dy)`: where dx,dy∈{−1,0,1}. - `spot(target_id)`: (Seeker only) valid when target is in unoccluded LOS. - `claim_capture(target_id)`: (Seeker only) valid when Seeker is at B and target is spotted. - `claim_self_save()`: (Hider only) valid when Hider is at B. - `claim_jailbreak()`: (Hider only) valid when Hider is at B and ≥1 player is in jail. - `noop()`: idle / wait. ## Playability notes - **Single-player-vs-AI:** Highly compelling. Human plays Seeker managing sightlines and patrol routes against multiple stealth AI hiders, or human plays Hider balancing risk/reward between staying hidden vs dashing for a heroic jailbreak. - **Group games (n>4):** Reduces naturally to a 2-agent duel (1 Seeker vs 1 Hider), which preserves the core line-of-sight and base-racing tension, though losing the multi-player cooperative prison-break dynamic. - **Physical-skill games:** Sprinting speed and vocal reaction time are abstracted into discrete movement step allowances per tick and priority rules at the base. - **What is lost in the adaptation:** The physical rush of full-body sprinting, acoustic localization of footfalls and breathing, and the tension of physical camouflage. ## Implementation hints - Raycasting for 2D field-of-view (e.g., Bresenham's line algorithm or shadow casting over grid tiles) is the critical performance bottleneck. - Branching factor: 9 movement choices + 2 interaction triggers per active agent. - Suggested first milestone: Implement a 20×20 grid with 4 obstacles, 1 Seeker, and 1 Hider, verifying line-of-sight calculation, base sprinting, and capture vs self-save resolution.

Download as JSON

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

Download JSON
Cite this page

Church rat (Finland). (n.d.). Games of Countries. https://gamesofcountries.com/games/fi-finland/kirkonrotta

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