Skip to main content
Formal Specification

Grid Line Evasion / Hadang — Formal Specification

Indonesia · chase-tag · Confidence: high

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 3
# Gobak Sodor (Hadang) — AI-optimized specification ## General idea A simultaneous-tick team evasion game on a 2D discrete grid representation of a 6-box court (15m x 9m). Attackers navigate from zone 0 to zone 3 and back while dodging 5 defenders constrained to linear rail paths (4 transverse lines + 1 central longitudinal spine). A single legal contact on an attacker causes elimination or role turnover. ## Formal model - **Abstraction taken:** Court is discretized into a coordinate grid of size X∈[0..18],Y∈[0..30] (0.5m grid units). Defenders are strictly constrained to 1D manifolds (transverse lines Y∈{0,10,20,30} for defenders 0..3, plus defender 0 moving on X=9). Attackers move freely inside the interior bounding box X∈[0..18],Y∈[0..30]. - **Player/agent count:** 2 teams of 5 agents each (Team A = Attackers, Team D = Defenders). - **Turn model:** Simultaneous discrete execution ticks (Δt=1 step per round). ## Formal rules R1. Setup: - Defenders D0..D4 spawn on their assigned lines: D0 at (9,0) (capable of moving along Y=0 and X=9), D1 on Y=10, D2 on Y=20, D3 on Y=30, D4 on Y=10 or Y=20 [gap-fill]. - Attackers A0..A4 spawn in the entry staging area Y<0. R2. Action execution: Each tick, all active agents submit a movement vector v→∈{(−1,0),(1,0),(0,−1),(0,1),(0,0)}. - Defenders must maintain pos+v→ on their assigned line coordinates. - Attackers must maintain pos+v→∈[0..18]×[0..30]. R3. Collision & tagging resolution: - An attacker Ai is tagged at tick t if distance(Ai,Dj)≤1.0 grid unit and defender Dj is on their legal line. - If tagged, attacker Ai is removed from active play (`eliminated = true`). R4. Scoring: - Forward crossing: An attacker crossing line Y=30 records `phase = returning` and awards 1 point. - Full circuit (*sodor*): An attacker with `phase == returning` who successfully re-crosses Y=0 into the staging area awards 3 bonus points. R5. Turn-over / match termination: - A round ends when all 5 attackers are either eliminated or have completed the circuit, or when maximum tick limit Tmax⁡=300 is reached [gap-fill]. - Teams swap attacking/defending roles for Round 2. Aggregate score across both rounds decides the winner. ## Edge cases - Tie at the end condition: If aggregate points are equal after 2 rounds, a sudden-death overtime round is played with 1 attacker vs 5 defenders with a 60-tick timer [gap-fill]. - A player with no legal move: In discrete grid movement, (0,0) (stay in place) is always legal. - Repetition / cycles: Bounded by max tick clock (Tmax⁡=300 ticks per half), guaranteeing finite play even if attackers stall in a safe pocket. - Simultaneous claims on the same resource or position: Multiple attackers may occupy the same grid cell or pass the same defender simultaneously; each is evaluated independently for tagging. - Player elimination mid-round: Eliminated attackers are immediately removed from the board; other active attackers continue without state interruption. - Resource exhaustion: Not applicable (infinite steps within time limit). - Termination guarantee: Enforced by the finite match countdown timer Tmax⁡. ## State representation - Persistent state: - `attacker_positions`: array of 5 coordinates (x,y). - `defender_positions`: array of 5 coordinates (x,y). - `attacker_status`: array of 5 enums (`STAGING`, `ADVANCING`, `RETURNING`, `COMPLETED`, `ELIMINATED`). - `score_team_A`, `score_team_B`: integers. - `current_tick`: integer 0..300. - Observable information: Fully observable (all positions and rails are public). ## Action space - `move(dx, dy)`: Δx∈{−1,0,1},Δy∈{−1,0,1} subject to Manhattan norm |Δx|+|Δy|≤1 and rail/boundary constraints. ## Playability notes - Single-player-vs-AI: Highly playable; a human player can control 1 attacker (or 1 defender) while heuristic/RL agents control teammates and opponents. - Group games (n>4): Can be reduced to a 1-attacker vs 3-defender mini-court without altering underlying evasion dynamics. - Physical-skill games: Physical feints and deceleration are abstracted into 4-way discrete direction decisions. - What is lost in the adaptation: Continuous momentum, arm reach, and dynamic body feints are discretized into a static 1-grid-unit contact radius. ## Implementation hints Simple 2D grid matrix with vector collision checks. Branching factor is 55≈3125 joint actions per team per tick. First milestone: Implement 1 attacker vs 2 defenders on a 2-line mini-grid to validate collision and scoring logic.

Download as JSON

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

Download JSON
Cite this page

Grid Line Evasion / Hadang (Indonesia). (n.d.). Games of Countries. https://gamesofcountries.com/games/id-indonesia/gobak-sodor

@misc{gamesofcountries-id-indonesia-gobak-sodor,
  title = {Grid Line Evasion / Hadang (Indonesia)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/id-indonesia/gobak-sodor}
}