Formal Specification
Church rat — Formal Specification
Finland · hide-seek · Confidence: high
← Back to game pageImplementation 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 .
- **Player/agent count:** agents (), configured as 1 Seeker and Hiders.
- **Turn model:** Simultaneous discrete execution per tick.
## Formal rules
R1. **Setup & Countdown:** Home base is located at coordinate . During countdown ticks :
- Seeker is pinned at with zero vision (blind state).
- Hiders move freely to seek cover behind occluding obstacles.
R2. **Active Search Phase:** At , the Seeker gains raycast line-of-sight (LOS) up to vision radius and roams the grid.
R3. **Spotting Action:** If an un-jailed, un-saved hider enters the Seeker's unoccluded LOS, the Seeker may execute `spot(H_i)`. This action tags as "spotted" and publishes 's spotted status to all agents.
R4. **Base Racing & Tagging:**
- **Seeker Jailing:** If the Seeker is at cell and executes `claim_capture(H_i)` while is spotted and has not reached , transitions to state `jailed` at the jail zone adjacent to .
- **Self-Save ("Oma rotta"):** If an un-jailed hider reaches cell and executes `claim_self_save()`, transitions to state `safe` for the remainder of the round, regardless of whether was previously spotted.
- **Jailbreak ("Kaikki rotat"):** If an uncaught hider reaches cell 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 with blind vision for ticks, allowing freed players to re-hide.
R5. **Action Conflict Resolution:** [gap-fill] If the Seeker and a spotted hider reach 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 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 .
- **Termination guarantee: why the game provably ends:** Monotonic progress is enforced by the hard tick ceiling and the finite maximum jailbreak count.
## State representation
- **Persistent state:** Grid layout with static obstacle map; coordinates of base and jail zone; global tick ; countdown duration ; jailbreak counter.
- **Per-player state:** Position ; status ; role ; order of capture index.
- **Per-turn ephemeral state:** List of spotted declarations; set of agents occupying base cell 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 .
- `spot(target_id)`: (Seeker only) valid when target is in unoccluded LOS.
- `claim_capture(target_id)`: (Seeker only) valid when Seeker is at and target is spotted.
- `claim_self_save()`: (Hider only) valid when Hider is at .
- `claim_jailbreak()`: (Hider only) valid when Hider is at and 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 ():** 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: 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 JSONCite 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}
}