Skip to main content
Formal Specification

Moroccan hide-and-seek (Kabboucha) — Formal Specification

Morocco · hide-seek · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 2
# Ghomayda — AI-optimized specification ## General idea A stealth and pursuit game played on an obstacle-rich 2D topological graph or grid with line-of-sight occlusion. One Seeker agent must explore the map to detect hidden agents and sprint back to touch the home base (*al-mita*), while Hider agents attempt to sneak through occluded zones to touch the base safely or trigger a full-team rescue. ## Formal model - **Abstraction taken:** The architectural medina environment is represented as a 2D grid (25×25 cells) with solid wall obstacles providing ray-cast line-of-sight (LOS) occlusion. Time progresses in synchronous ticks (Δt=0.5s). - **Player/agent count:** 1 Seeker (A0) and M Hiders (A1,…,AM, default M=4). - **Turn model:** Synchronous ticks. All active agents declare movement actions simultaneously. ## Formal rules R1. **Environment & Initial Setup:** - Grid G=25×25. Home base (*al-mita*) located at coordinate (0,0). - Ticks t∈[1,20] (*Counting Phase*): A0 is locked at (0,0) with LOS=∅. Hiders A1…AM move at standard speed (1 cell/tick) to select hiding positions. R2. **Search and Line-of-Sight Detection:** - At t>20, A0 begins searching. - Ray-casting vision: An agent Aj is spotted by A0 if distance ‖P0−Pj‖≤8 cells, angle of vision θ≤60∘, and no solid wall cell intersects the line segment P0Pj. - When Aj is spotted, state transitions to `spotted(j) = true`. R3. **Base Tagging Races:** - Once `spotted(j) = true`, a sprint race to base (0,0) begins: - If A0 reaches (0,0) first and executes `tag_base(j)`: Agent Aj is captured (`status(j) = captured`). - If Aj reaches (0,0) first and executes `touch_base()`: Agent Aj is safe (`status(j) = safe`). R4. **Sneak and Rescue Mechanic:** - Any unspotted hider may move toward (0,0). If they reach (0,0) without being spotted, they execute `touch_base()`: - If they are the last active unspotted hider, they execute `liberate_all()`: all previously captured agents transition back to `safe`, and A0 receives a failed-seeker penalty. R5. **Round Termination and Next Seeker Selection:** - Round ends when all M hiders are resolved (either `captured` or `safe`). - [gap-fill] Next round seeker is the first player who was captured. If 0 players were captured (all safe/liberated), current seeker A0 remains seeker. ## Edge cases - **Tie at the end condition:** If Seeker and Hider reach (0,0) on the exact same tick, [gap-fill] Hider is awarded the `safe` status (favoring runner momentum). - **A player with no legal move:** Movement into adjacent unblocked cells is always legal; holding position is legal. - **Repetition / cycles:** Bounded by a hard round tick limit Tmax⁡=300 ticks. If Tmax⁡ is reached, all remaining unspotted hiders are auto-resolved as `safe`. - **Simultaneous claims on the same resource or position:** Grid cells support multiple non-conflicting hiders; tagging base requires only adjacent positioning to (0,0). - **Player elimination mid-round; turn order repair:** Captured agents are removed from active physics until round end. - **Resource exhaustion:** Bounded finite map and agent count. - **Termination guarantee:** Guaranteed by maximum round tick limit Tmax⁡=300. ## State representation - **Persistent state:** Seeker ID, round number, historical capture records. - **Agent state:** Position (Xi,Yi), status ∈{hiding,spotted,sprinting,captured,safe}, sprint stamina. - **Observable information:** Imperfect information: Seeker observes only cells within unobstructed vision cone; Hiders observe full local surroundings within 4 cells. ## Action space - `move(dx, dy)`: dx,dy∈{−1,0,1} (orthogonal or diagonal step). - `sprint(dx, dy)`: 2 cells/tick (consumes stamina). - `tag_base(hider_id)`: Seeker action at (0,0). - `touch_base()`: Hider action at (0,0). ## Playability notes - **Single-player-vs-AI:** Excellent as both Seeker (hunting clever stealth AI agents) and Hider (infiltrating past dynamic patrol cones). - **Group games (M>4):** Scales smoothly with multi-agent pathfinding. - **Physical-skill games:** Stealth path planning and sprint speed management. - **What is lost in the adaptation:** The physical adrenaline of holding breath in a narrow Moroccan archway while hearing footsteps approach. ## Implementation hints - Implement Bresenham's line algorithm for fast 2D grid ray-casting line-of-sight checks. - First milestone: Implement 1 Seeker vs 1 Hider on a 15×15 maze grid with basic LOS detection and base race logic.

Download as JSON

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

Download JSON
Cite this page

Moroccan hide-and-seek (Kabboucha) (Morocco). (n.d.). Games of Countries. https://gamesofcountries.com/games/ma-morocco/ghomayda

@misc{gamesofcountries-ma-morocco-ghomayda,
  title = {Moroccan hide-and-seek (Kabboucha) (Morocco)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/ma-morocco/ghomayda}
}