Skip to main content
Formal Specification

Steal the Flag / Flag Snatching — Formal Specification

Vietnam · chase-tag · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 4
# Cướp cờ — AI-optimized specification ## General idea Cướp cờ is a symmetrical team evasion and flag-snatching game. Two opposing teams stand behind parallel baselines with players assigned numbered bibs. A central caller calls one or more numbers; the summoned players race to the center circle to contest a single flag. The player who seizes the flag must sprint back across their home baseline untouched, while the opponent must chase and tag the carrier before they cross. ## Formal model - **Abstraction taken:** The continuous field is discretized into a 2D grid with coordinates (x,y)∈[−L,L]×[−W,W]. Physical running velocity is discretized into 1 grid step per tick [gap-fill: physical sprinting and reaction times are discretized into simultaneous grid movement ticks where each active runner moves 1 cell per tick, and tagging requires occupying the same cell as the flag carrier]. - **Player/agent count:** 2 teams of K players each (K∈[5,10]). - **Turn model:** Round-based; within each round, active players execute simultaneous movement ticks until a point is scored or round times out. ## Formal rules R1. Arena and Setup: - Grid dimensions: x∈[−L,L] (length 2L+1), y∈[−W,W] (width 2W+1). - Team 1 baseline: x=−L; Team 2 baseline: x=L. - Center flag position: (0,0). - Team 1 players numbered 1..K; Team 2 players numbered 1..K. - Team scores S1=0,S2=0. Target score is Starget (default 5 points). R2. Round Initiation: - The referee calls a number k∗∈{1,…,K}. - Player 1k∗ starts at (−L,0) and Player 2k∗ starts at (L,0). All other players remain inactive on their baselines. - Flag state flag_carrier=None, flag_pos=(0,0). R3. Movement and Snatching (per tick t): - Active players simultaneously submit a∈{STAY,UP,DOWN,LEFT,RIGHT,SNATCH}. - Movement updates positions p←p+Δ(a). - `SNATCH` action is valid only if p=flag_pos and flag_carrier=None. - [gap-fill] If both players execute `SNATCH` on the exact same tick, neither gains possession; the flag remains at (0,0) and both players bounce back 1 step toward their respective baselines. - If a single player executes a valid `SNATCH`, flag_carrier←player_id, and the flag moves with that carrier. R4. Tagging and Scoring: - If player i holds the flag and crosses their home baseline (x≤−L for Team 1, or x≥L for Team 2) without being tagged: - Team i scores +1 point (Si←Si+1). Round terminates. - If player j (opponent) enters the exact cell occupied by the flag carrier i (pj=pi) while i is within field bounds: - Team j scores +1 point (Sj←Sj+1) via successful tag. Round terminates. - [gap-fill] Stepping out of lateral bounds (|y|>W) constitutes a fault, terminating the round and awarding +1 point to the opponent. R5. [gap-fill] Round Stagnation Timeout: - If 60 ticks elapse without either runner snatching the flag or scoring, the referee halts the round, awards 0 points to both teams, and initiates the next round. R6. Victory Condition: - The first team to reach Starget points wins the match immediately. ## Edge cases - Tie at the end condition: If both teams reach Starget simultaneously (in multi-number call variants), a sudden-death single-number tie-breaker round is played. - A player with no legal move: Inactive baseline players have no moves; active runners always have valid movement actions. - Repetition / cycles: Bounded by R5 (hard 60-tick round stagnation timeout). - Simultaneous claims on the same resource or position: Covered by R3 (simultaneous flag snatch bounce-back rule). - Player elimination mid-round; turn order repair: In the standard points format, no players are eliminated; round resets fully after each point. - Resource exhaustion: Flag position resets to (0,0) at the start of every round; points accumulate monotonically. - Termination guarantee: why the game provably ends: Each round completes in ≤60 ticks; since non-zero points are awarded on successful sprints/tags and numbers cycle, the game reaches Starget or a maximum round limit provably. ## State representation - Persistent state: - `team1_score`, `team2_score`: non-negative integers. - `active_number`: integer k∗∈[1,K]. - `round_number`: integer. - Per-round ephemeral state: - `p1_pos`, `p2_pos`: coordinates in [−L,L]×[−W,W]. - `flag_pos`: coordinate (x,y). - `flag_carrier`: enum `{NONE, PLAYER_1, PLAYER_2}`. - `round_ticks`: integer ∈[0,60]. - Observable information: - Public: Full observation of player positions, flag position/carrier, scores, and round timer. ## Action space - `move(direction)`: direction ∈{STAY,UP,DOWN,LEFT,RIGHT}. - `snatch()`: Attempt to pick up the flag at current position. ## Playability notes - Single-player-vs-AI: Highly playable; 1 human controlling the active runner against an AI opponent employing bluffing, distance-baiting, and intercept trajectories. - Group games (n>4): The full game involves 2×K players with 1v1 duels per call. To reduce to a pure 2-agent game, simply model the 1v1 duel directly over a series of rounds. - Physical-skill games: Physical sprint speed is discretized into grid steps; strategic content focuses on spacing, feints, and timing the grab. - What is lost in the adaptation: The explosive physical acceleration, real-time hand swatting/tag evasion, and team chanting along the baselines. ## Implementation hints - Set L=8,W=4 for a compact 17×9 grid arena. - State transitions are strictly deterministic given simultaneous action inputs. - Suggested first milestone: Build the 1v1 grid environment with flag grab and baseline tag detection, testing against simple greedy baseline-runner bots.

Download as JSON

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

Download JSON
Cite this page

Steal the Flag / Flag Snatching (Vietnam). (n.d.). Games of Countries. https://gamesofcountries.com/games/vn-vietnam/cuop-co

@misc{gamesofcountries-vn-vietnam-cuop-co,
  title = {Steal the Flag / Flag Snatching (Vietnam)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/vn-vietnam/cuop-co}
}