Skip to main content
Formal Specification

Cops and Robbers — Formal Specification

Serbia · hide-seek · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 2
# Lopova i pandura — AI-optimized specification ## General idea A multi-agent pursuit-evasion and territorial rescue game on a 2D topological graph. A team of Cop agents coordinates to hunt, tag, and escort Robber agents to a central Jail node, while free Robbers use path-planning and diversion tactics to reach the Jail node and execute a collective jailbreak. ## Formal model - **Abstraction taken:** The outdoor environment is modeled as a 2D connected graph G=(V,E) with obstacle nodes and visual occlusion masks. Designated base node vjail∈V. Movement is synchronous tick-based Δt along graph edges. - **Player/agent count:** 2 teams of N=4 agents (Team Cops C, Team Robbers R). - **Turn model:** Synchronous simultaneous agent movements per tick. ## Formal rules R1. Initialization: Graph G=(V,E) with |V|=30. Jail node at vjail. Cops spawn at vjail. Robbers spawn across random perimeter nodes Vperim. Initial state: `jailed = set()`, `free_robbers = set(R)`. R2. Phase 1 (Dispersal): For the first Tcount=10 ticks, Cops are frozen at vjail (eyes closed). Robbers execute movement steps to find optimal defensive positions. R3. Phase 2 (Pursuit & Tagging): On each tick t>Tcount: - All active agents submit action `MOVE(target_neighbor_node)`. - **Tagging Check:** If a Cop c and a free Robber r occupy the same vertex u or traverse the same edge (u,v) in reverse directions: - Arrest occurs: r is marked `arrested = True`, removed from `free_robbers`, and added to `jailed`. r's position is set to vjail. - **Jailbreak Check:** If any free Robber r∈free_robbers reaches vjail on a tick where no Cop occupies vjail: - All agents in `jailed` are immediately liberated: `free_robbers.update(jailed)`, `jailed.clear()`. R4. Win Conditions: - **Cops Victory:** If len(free_robbers)==0 (all robbers in jail simultaneously), Cops win: `score[Cops] += 1`. - **Robbers Victory:** If len(free_robbers)>0 after Tmax=300 ticks, Robbers win: `score[Robbers] += 1`. R5. [gap-fill] Match Structure: Teams play 2 halves (swapping Cop and Robber roles). The team with faster total capture time (or more surviving robbers) wins the match. ## Edge cases - Tie at the end condition: If both teams achieve full captures in identical tick counts, a sudden-death 1v1 capture round on a reduced subgraph resolves the tie. - A player with no legal move: Not applicable; `MOVE(STAY)` is always available on graph nodes. - Repetition / cycles: Bounded by R4's hard limit of 300 ticks per round. - Simultaneous claims on the same resource or position: - If a Cop and a free Robber arrive at vjail simultaneously on the same tick: the Cop arrests the Robber; no jailbreak occurs. - Player elimination mid-round / turn order repair: [gap-fill] Jailed robbers cannot move until liberated by a teammate; they remain quiescent state entities at vjail. - Resource exhaustion: Graph and agent counts are invariant. - Termination guarantee: Guaranteed by the hard 300-tick round cap. ## State representation - Persistent state: `scores: dict[TeamID, int]`, `round_number: int`. - Per-tick state: `cop_positions: dict[AgentID, NodeID]`, `robber_positions: dict[AgentID, NodeID]`, `jailed_robbers: set[AgentID]`, `free_robbers: set[AgentID]`, `tick: int`. - Observable information: - Cops observe: robber positions only within line-of-sight graph radius (k≤2 edges without occlusion). Jail status is globally observable. - Robbers observe: cop positions within line-of-sight graph radius (k≤2 edges). ## Action space - `move(target_node_id: int)`: Select adjacent node in graph G or stay in place. ## Playability notes - Single-player-vs-AI: Excellent; player as lone free Robber executes stealth infiltration past AI cop patrol paths to trigger jailbreaks, or as Cop commander coordinates search grids. - Group games (n>4): Archetypal multi-agent pursuit-evasion benchmark with dynamic cooperative rescues. - Physical-skill games: Physical running speed and stealth hiding are mapped to graph traversal costs and line-of-sight masks. - What is lost in the adaptation: The physical exhilaration of sprinting through bushes and diving under playground benches is abstracted to graph pathfinding. ## Implementation hints Graph-based discrete state machine. Model environment using NetworkX or custom adjacency matrix. First milestone: implement 2v2 pursuit with Dijkstra shortest-path cop tracking and jailbreak triggers.

Download as JSON

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

Download JSON
Cite this page

Cops and Robbers (Serbia). (n.d.). Games of Countries. https://gamesofcountries.com/games/rs-serbia/lopova-i-pandura

@misc{gamesofcountries-rs-serbia-lopova-i-pandura,
  title = {Cops and Robbers (Serbia)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/rs-serbia/lopova-i-pandura}
}