Formal Specification
Cops and Robbers — Formal Specification
Serbia · hide-seek · Confidence: low
← Back to game pageImplementation 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 with obstacle nodes and visual occlusion masks. Designated base node . Movement is synchronous tick-based along graph edges.
- **Player/agent count:** 2 teams of agents (Team Cops , Team Robbers ).
- **Turn model:** Synchronous simultaneous agent movements per tick.
## Formal rules
R1. Initialization: Graph with . Jail node at . Cops spawn at . Robbers spawn across random perimeter nodes . Initial state: `jailed = set()`, `free_robbers = set(R)`.
R2. Phase 1 (Dispersal): For the first ticks, Cops are frozen at (eyes closed). Robbers execute movement steps to find optimal defensive positions.
R3. Phase 2 (Pursuit & Tagging): On each tick :
- All active agents submit action `MOVE(target_neighbor_node)`.
- **Tagging Check:** If a Cop and a free Robber occupy the same vertex or traverse the same edge in reverse directions:
- Arrest occurs: is marked `arrested = True`, removed from `free_robbers`, and added to `jailed`. 's position is set to .
- **Jailbreak Check:** If any free Robber reaches on a tick where no Cop occupies :
- All agents in `jailed` are immediately liberated: `free_robbers.update(jailed)`, `jailed.clear()`.
R4. Win Conditions:
- **Cops Victory:** If (all robbers in jail simultaneously), Cops win: `score[Cops] += 1`.
- **Robbers Victory:** If after 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 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 .
- 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 ( edges without occlusion). Jail status is globally observable.
- Robbers observe: cop positions within line-of-sight graph radius ( edges).
## Action space
- `move(target_node_id: int)`: Select adjacent node in graph 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 JSONCite 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}
}