Skip to main content
Formal Specification

The Bear is Sleeping — Formal Specification

Sweden · singing-circle · Confidence: high

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 5
# Björnen sover — AI-optimized specification ## General idea A dramatic singing-circle and sudden-scatter chase game where ring dancers rotate around a stationary central "Bear" while advancing a rhythmic verse countdown. On the terminal syllable trigger ("tro!"), the circle dissolves into a real-time spatial evasion chase where the Bear attempts to tag one fleeing dancer before they reach boundary safety or survive a fixed chase tick window. The tagged player becomes the Bear for the subsequent iteration. ## Formal model - **Abstraction taken:** The continuous physical singing, ring dancing, and room scattering are discretized into a two-phase state machine: Phase 1 (Singing Ring) is a deterministic step counter (7 lyrics measures); Phase 2 (The Scatter Chase) is a discrete 2D grid/graph simulation over T discrete time ticks where agents execute directional movement vectors. Physical tagging is modeled as agent co-location on the same grid cell. - **Player/agent count:** N agents (N≥4; default benchmark N=6: 1 Bear B, 5 Dancers D1…D5). - **Turn model:** Phase 1 advances via synchronized lyric ticks; Phase 2 executes simultaneous movement ticks (t=1…Tmax⁡). ## Formal rules R1. **Setup:** The arena is an M×M grid with a central den cell (cx,cy). One agent is assigned role `BEAR`, and N−1 agents are assigned role `DANCER`. Dancers start on a circle of radius R centered at (cx,cy), linked in an ordered ring. R2. **Phase 1 (The Song Countdown):** - The song progresses through 7 discrete meter beats (k=1…7). - On each beat k, all Dancers advance 1 step clockwise along the perimeter of radius R. - The Bear must maintain state `SLEEPING` at (cx,cy) and cannot issue movement actions. - [gap-fill] If the Bear executes an action before beat k=7, a false start foul is incurred, resetting the song to beat 1. R3. **Phase 2 (The Awakening Trigger):** - Exactly upon beat k=7 (the word *"tro!"*), the Bear transitions to state `AWAKE` and the Dancers transition to state `SCATTERING`. - The linked ring breaks; all agents act independently. R4. **Chase Ticks:** - Phase 2 runs for a maximum of Tmax⁡=20 ticks [gap-fill]. - In each tick t∈[1,Tmax⁡], all agents simultaneously submit a movement vector v→∈{(0,0),(±1,0),(0,±1),(±1,±1)}. - Bear maximum speed is sB=1.5 cells/tick; Dancer maximum speed is sD=1.0 cells/tick [gap-fill]. R5. **Capture Condition:** - If at the end of any tick t, distance(pos(B),pos(Di))≤0.5, Dancer Di is tagged. - The round ends immediately upon the first tag. Di is designated the Bear for the next round. R6. **Survival / Timeout Condition:** - [gap-fill] If Tmax⁡ ticks elapse without a tag, the Bear fails to catch any dancer; the current Bear remains the Bear for the next round, or the slowest fleeing dancer is selected by tie-break. ## Edge cases - Tie at the end condition: If the Bear simultaneously reaches the same cell as two Dancers on the same tick, the Bear tags the dancer with the lowest index i [gap-fill]. - A player with no legal move: An agent against the boundary grid wall may only select movement vectors directed into open grid cells; if fully cornered, (0,0) is executed. - Repetition / cycles: Phase 1 has a strictly monotonic counter k∈[1,7]; Phase 2 is strictly bounded by Tmax⁡=20 ticks. No infinite loop can occur within a round. - Simultaneous claims on the same resource or position: Multiple Dancers may occupy the same grid cell during the scatter phase; cell occupancy is non-exclusive. - Player elimination mid-round: Not applicable, as this is a non-elimination continuous role-rotation game. If an agent disconnects, N decreases by 1 and the ring reforms. - Resource exhaustion (pieces, tokens, space, time): Spatial bounds are fixed by the grid boundary (M×M). Time is bounded by Tmax⁡. - Termination guarantee: Each round terminates in at most 7+Tmax⁡ ticks. A full session terminates after a preset number of rounds Rtotal with individual scores tracking successful evasions and tags. ## State representation - **Persistent state:** - `round_number`: integer. - `agent_scores`: mapping of agent ID to `{times_bear: int, successful_tags: int, escapes: int}`. - `current_bear_id`: agent ID. - **Per-turn ephemeral state:** - `phase`: `SINGING` or `CHASE`. - `song_beat`: integer ∈[1,7]. - `chase_tick`: integer ∈[0,Tmax⁡]. - `positions`: map of agent ID →(x,y)∈ℝ2. - `tagged_agent_id`: optional agent ID. - **Observable information:** - Fully observable: All agent positions, the song beat counter, and role assignments are public knowledge to all agents. ## Action space - `sing_step()`: Executed during Phase 1 by Dancers (advances along circular trajectory). - `sleep()`: Executed during Phase 1 by the Bear (maintains position (cx,cy)). - `move(dx, dy)`: Executed during Phase 2 by any agent, subject to |v→|≤srole. ## Playability notes - Single-player-vs-AI: Natural — A single human player can play as the Bear against heuristic evader bots, or as a single Dancer attempting to evade an AI Bear pursuing the nearest target. - Group games (n>4): The native 6–12 player game reduces cleanly to 2 agents (1 Bear vs 1 Dancer) by collapsing the ring to an initial distance separation R followed by the trigger sprint. - Physical-skill games: Physical running speed, agility, and acoustic reflex timing are mapped into the differential speed parameters (sB>sD) and the instantaneous trigger tick. - What is lost in the adaptation: The social choral joy of collective singing, eye contact, theatrical roars, and tactile hand-holding are abstracted into numeric state transitions. ## Implementation hints Low complexity. Modeled as a simple discrete 2D kinematic simulation with a 2-state finite automaton (`SINGING` → `CHASE`). Branching factor during chase is 9 discrete directions per agent. First milestone: implement the 7-beat countdown trigger and verify that an evader pursuing boundary escape can be intercepted by a pursuer with 1.5× speed.

Download as JSON

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

Download JSON
Cite this page

The Bear is Sleeping (Sweden). (n.d.). Games of Countries. https://gamesofcountries.com/games/se-sweden/bjornen-sover

@misc{gamesofcountries-se-sweden-bjornen-sover,
  title = {The Bear is Sleeping (Sweden)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/se-sweden/bjornen-sover}
}