Skip to main content
Formal Specification

Tin Can Hide / Kick the Can — Formal Specification

Denmark · hide-seek · Confidence: high

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 3
# Dåseskjul (Spark til dåsen) — AI-optimized specification ## General idea A dynamic hide-and-seek and base-defense game centered on an interactive physical target (the tin can). The Seeker hunts concealed players across an obstacle field; spotting a hider initiates a competitive sprint race back to the home base. If the Seeker touches the can first, the hider is imprisoned; if any hider reaches the can first and kicks it away, all imprisoned players are instantly liberated. ## Formal model - **Abstraction taken:** Continuous terrain with natural cover is discretized into a 2D grid (W×H) with opaque obstacle cells. Line-of-sight (LOS) is computed via Bresenham raycasting. Running speeds are modeled as discrete grid steps per tick (1 cell/tick). The can possesses a 2D coordinate that updates when kicked. - **Player/agent count:** 4 to 15 agents (1 Seeker, N−1 Hiders). - **Turn model:** Synchronized discrete time ticks; all active agents submit simultaneous actions per tick. ## Formal rules R1. **Setup & Roles:** Grid contains obstacles, a fixed home base coordinate B=(x0,y0), and a can token positioned at B. One agent is `Seeker`; N−1 agents are `Hiders`. A FIFO queue Prisoners=∅ is maintained. R2. **Countdown Phase:** For ticks t=1…Thide (where Thide=50), Seeker is locked at B with zero visual perception (LOS=∅). Hiders execute up to 1 movement step per tick to conceal themselves behind obstacle cells. R3. **Search Phase:** From t>Thide, Seeker and uncaptured Hiders move up to 1 cell per tick (Moore neighborhood or orthogonal). Seeker's field of view is computed via raycasting: an agent Hi is visible if the straight line between (xS,yS) and (xi,yi) intersects no obstacle cell. R4. **Spotting Action:** When LOS(Seeker,Hi)=True, Seeker may execute `spot_hider(H_i)`. This sets Hi.status=Spotted and triggers a sprint race to B. R5. **Base Resolution Actions:** - `tag_can(H_i)`: Legal for Seeker if positioned at B while can is present and Hi is `Spotted`. Result: Hi is appended to Prisoners, removed from the active grid, and set to `Imprisoned`. - `kick_can(direction)`: Legal for any active Hider (spotted or unspotted) positioned at B while can is present. Result: can is displaced Dkick=10 cells in `direction` (stopping at map boundaries/obstacles); all agents in Prisoners are restored to `Active` at position B; Seeker enters `Retrieval` state. R6. [gap-fill] Can Retrieval State:** While can is displaced from B, Seeker must move to the can's cell, execute `retrieve_can()`, carry it back to B, and remain motionless at B for Trecount=10 ticks before normal search and LOS actions resume. R7. **Round End & Succession:** When |Prisoners|==N−1, the Seeker wins the round. The first agent captured (Prisoners[0]) becomes the new Seeker for the subsequent round. R8. [gap-fill] Round Time Limit:** If the Seeker fails to capture all hiders within Tmax=1000 ticks, the Hiders win the round and the Seeker role rotates to the next agent in index order. ## Edge cases - Tie at the end condition: Not applicable; victory occurs when all hiders are imprisoned or Tmax expires. - A player with no legal move: If boxed in, `move(0, 0)` is always valid. - Repetition / cycles: Infinite loops of prisoner liberation and recapture are strictly bounded by R8 (Tmax=1000 ticks). - Simultaneous claims on the same resource or position: If Seeker and a Hider reach B on the exact same tick, [gap-fill] the Hider's `kick_can` takes strict priority over the Seeker's `tag_can` (reflecting physical advantage of a running kick over a stationary foot placement). - Player elimination mid-round; turn order repair: An imprisoned player is dormant in Prisoners; if an active player disconnects, they are removed from the active set without affecting game flow. - Resource exhaustion (pieces, tokens, space, time): Only 1 can token exists; its coordinate is continuously tracked. Time is bounded by Tmax. - Termination guarantee: why the game provably ends: Guaranteed by monotonic progression of the global clock t toward Tmax combined with the finite prisoner threshold (N−1). ## State representation - **Persistent state:** Grid layout, obstacle mask, base location B, total players N, cumulative round scores. - **Per-player state:** Position (xi,yi), status (`Active`, `Spotted`, `Imprisoned`), sprint cooldown. - **Per-turn ephemeral state:** Can position (xcan,ycan), Seeker state (`Counting`, `Searching`, `Retrieving`), Prisoners queue, current tick t. - **Observable information:** - Hiders observe: Full grid map, positions of all other Hiders, Seeker position, can position, and prisoner roster. - Seeker observes: Full grid map, can position, prisoner roster, and only those Hiders currently within unoccluded Line-of-Sight. ## Action space - `move(dx, dy)`: Step in {−1,0,1}2. Precondition: agent is active and unconstrained. - `spot_hider(agent_id)`: Target specific hider. Precondition: agent is Seeker, target in direct LOS. - `tag_can(agent_id)`: Imprison target. Precondition: Seeker at base with can present, target is `Spotted`. - `kick_can(dx, dy)`: Displace can and liberate prisoners. Precondition: Hider at base with can present. - `retrieve_can()`: Pick up displaced can. Precondition: Seeker co-located with can. ## Playability notes - Single-player-vs-AI: Highly playable; human plays as Seeker managing base defense vs stealthy AI hiders, or as a lone Hider executing rescue kicks against an AI guard. - Group games (n>4): Reducible to 2 agents (1 Seeker vs 1 Hider), though the collective prisoner liberation dynamic is lost. - Physical-skill games: Sprinting and kicking are discretized into tick-based movement points and fixed kick distances. - What is lost in the adaptation: Physical hiding behind foliage, 3D field of view nuances, and the adrenaline of close physical foot-races. ## Implementation hints Medium complexity. Core subsystems: 2D raycaster for LOS, A* pathfinding for Seeker search and retrieval, and base state-machine (Present, Displaced, Retrieving). First milestone: implement 2D arena with Seeker patrolling and tagging stationary spotted hiders.

Download as JSON

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

Download JSON
Cite this page

Tin Can Hide / Kick the Can (Denmark). (n.d.). Games of Countries. https://gamesofcountries.com/games/dk-denmark/daseskjul

@misc{gamesofcountries-dk-denmark-daseskjul,
  title = {Tin Can Hide / Kick the Can (Denmark)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/dk-denmark/daseskjul}
}