Formal Specification
Sahrawi piggyback cavalry ball game (El-Gbeiba) — Formal Specification
Western Sahara · ball-team · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: discretizedGap-fills: 2
# Kbiba — AI-optimized specification
## General idea
A two-phase team ball game with asymmetrical roles (Riders vs. Mounts). In Phase 1 (Mounted Passing), riders execute probabilistic aerial passes to score points while mounts move to disrupt pass angles. In Phase 2 (Pursuit), triggered on any failed pass, riders dismount and race across a grid toward a safe sanctuary while the former mounts retrieve the ball and execute ranged throwing attacks. If any fleeing rider is hit, the team roles reverse.
## Formal model
- **Abstraction taken:** Field discretized into a 2D grid. The safety sanctuary is the zone . Piggyback movement couples rider and mount into a single composite entity on the grid.
- **Player/agent count:** 2 teams (Team 0 and Team 1), 4 agents per team.
- **Turn model:** Phase 1 uses discrete sequential pass decisions. Phase 2 operates on synchronized time ticks of simultaneous movement and throwing.
## Formal rules
R1. **Roles and Pairing:**
- Team is Mounted (Riders); Team is Carrying (Mounts).
- Each rider is paired with mount at grid coordinate .
R2. **Phase 1: Mounted Passing:**
- The ball begins with rider .
- On a passing step, the active ball-holding rider chooses a target teammate ().
- Pass success probability:
- If successful: Team receives score point, ball passes to , and mount entities may adjust position by 1 cell.
- If failed: Ball lands on the ground at target coordinates , and Phase 2 is immediately triggered.
R3. **Phase 2: Dismount and Desert Pursuit:**
- Rider-mount pairings dissolve instantly.
- Mounts race toward the ball coordinates . The first mount to arrive gains possession.
- Riders sprint toward the sanctuary line (). Riders advance 1 cell per tick.
- Once a mount gains the ball, they may `throw_at_rider(target_rider_id)`.
- Throw hit probability:
R4. **Pursuit Resolution:**
- **Case A (Hit):** If a thrown ball hits a fleeing rider before that rider reaches , Phase 2 ends immediately. Team roles reverse: former mounts become new riders , former riders become new mounts .
- **Case B (Escape):** If all 4 riders reach without being hit, Team retains rider status, and Phase 1 resumes from the sanctuary.
R5. [gap-fill] **Match Win Condition:**
- The game is played to a target score of passing points.
- The first team to reach points wins the match immediately.
R6. [gap-fill] **Pursuit Time Bounding:**
- Phase 2 runs for at most 15 ticks. If the ball is not thrown or all throws miss within 15 ticks, Case B (Escape) is automatically declared.
## Edge cases
- **Tie at the end condition:** Not applicable — first team to reach target score wins.
- **A player with no legal move:** In Phase 1, pass is always selectable. In Phase 2, move toward target/sanctuary is always legal.
- **Repetition / cycles:** Role reversals swap asymmetric scoring potential; passing point accumulation is strictly positive and monotonic toward target , guaranteeing termination.
- **Simultaneous claims on the same resource or position:** Multiple fleeing agents may occupy the same grid cell; the thrower must declare a unique target agent ID.
- **Player elimination mid-round; turn order repair:** No agent is ever permanently eliminated; roles simply invert upon a successful hit.
- **Resource exhaustion:** Finite board space () and invariant agent counts (4 vs 4).
- **Termination guarantee:** Guaranteed by finite target score and strictly time-bounded pursuit phases (R6).
## State representation
- **Persistent state:**
- `phase`: `MOUNTED_PASSING` or `PURSUIT`.
- `rider_team`: `0` or `1`.
- `scores`: `[score_team_0, score_team_1]`.
- `agent_positions`: array of 8 coordinates .
- `ball_pos`: coordinate .
- `ball_carrier`: optional agent ID.
- `pursuit_tick`: integer .
- **Observable information:** Fully observable game state across all agents.
## Action space
- Phase 1: `pass_to_rider(target_id)`: target .
- Phase 2: `sprint(direction)`: .
- Phase 2 (Ball Carrier): `throw_ball(target_rider_id)`.
## Playability notes
- **Single-player-vs-AI:** Natural asymmetric multi-agent team challenge. AI implements cooperative passing trees in Phase 1 and spatial pursuit/interception geometry in Phase 2.
- **Group games (n>4):** 4v4 model captures the team dynamics. Can be scaled from 3v3 to 6v6 without altering the formal mechanics.
- **Physical-skill games:** Physical carrying stamina, sudden sprinting, and throwing accuracy are parameterized into distance-based Bernoulli success models.
- **What is lost in the adaptation:** Physical exhaustion from carrying weight, tactile handoffs, and real-time wrestling balance.
## Implementation hints
- Separate the engine state machine into two distinct phase controllers (`MountedController` and `PursuitController`).
- Pre-compute Euclidean/Manhattan distance matrices on the grid.
- First milestone: Implement Phase 1 pass loop and scoring before adding the Phase 2 pursuit grid simulation.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Sahrawi piggyback cavalry ball game (El-Gbeiba) (Western Sahara). (n.d.). Games of Countries. https://gamesofcountries.com/games/eh-western-sahara/kbiba
@misc{gamesofcountries-eh-western-sahara-kbiba,
title = {Sahrawi piggyback cavalry ball game (El-Gbeiba) (Western Sahara)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/eh-western-sahara/kbiba}
}