Formal Specification
Moroccan hide-and-seek (Kabboucha) — Formal Specification
Morocco · hide-seek · Confidence: medium
← Back to game pageImplementation 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 ( cells) with solid wall obstacles providing ray-cast line-of-sight (LOS) occlusion. Time progresses in synchronous ticks ().
- **Player/agent count:** 1 Seeker () and Hiders (, default ).
- **Turn model:** Synchronous ticks. All active agents declare movement actions simultaneously.
## Formal rules
R1. **Environment & Initial Setup:**
- Grid . Home base (*al-mita*) located at coordinate .
- Ticks (*Counting Phase*): is locked at with . Hiders move at standard speed () to select hiding positions.
R2. **Search and Line-of-Sight Detection:**
- At , begins searching.
- Ray-casting vision: An agent is spotted by if distance , angle of vision , and no solid wall cell intersects the line segment .
- When is spotted, state transitions to `spotted(j) = true`.
R3. **Base Tagging Races:**
- Once `spotted(j) = true`, a sprint race to base begins:
- If reaches first and executes `tag_base(j)`: Agent is captured (`status(j) = captured`).
- If reaches first and executes `touch_base()`: Agent is safe (`status(j) = safe`).
R4. **Sneak and Rescue Mechanic:**
- Any unspotted hider may move toward . If they reach 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 receives a failed-seeker penalty.
R5. **Round Termination and Next Seeker Selection:**
- Round ends when all 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 remains seeker.
## Edge cases
- **Tie at the end condition:** If Seeker and Hider reach 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 ticks. If 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 .
- **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 .
## State representation
- **Persistent state:** Seeker ID, round number, historical capture records.
- **Agent state:** Position , status , 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)`: (orthogonal or diagonal step).
- `sprint(dx, dy)`: 2 cells/tick (consumes stamina).
- `tag_base(hider_id)`: Seeker action at .
- `touch_base()`: Hider action at .
## Playability notes
- **Single-player-vs-AI:** Excellent as both Seeker (hunting clever stealth AI agents) and Hider (infiltrating past dynamic patrol cones).
- **Group games ():** 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 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 JSONCite 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}
}