Formal Specification
Saharan piggyback ball-tag game (L-Kbayba) — Formal Specification
Morocco · ball-team · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: discretizedGap-fills: 2
# Kabbouba — AI-optimized specification
## General idea
A physical team game transitioning dynamically between two phases: a coupled mounted passing phase (where riding agents attempt consecutive passes while their mounted partner agents perturb balance) and an uncoupled chase phase (where riders scatter across a 2D arena while former mounts retrieve the dropped ball to snipe a fleeing rider and invert roles).
## Formal model
- **Abstraction taken:** The 2D soft-terrain arena () is modeled with continuous positions and synchronous discrete ticks (). In Phase 1, pairs of agents share a coupled coordinate with physical balance perturbation noise. In Phase 2, agents uncouple into independent pursuit/fleeing agents.
- **Player/agent count:** 2 teams (), each with agents.
- **Turn model:** Synchronous real-time ticks across two dynamic state phases.
## Formal rules
R1. **Setup & Pairing:**
- Arena bounded by .
- Team (Riders) and Team (Mounts).
- Each rider is paired with mount at shared position .
- Ball starts in possession of rider 0. Phase = 1 (*Mounted Passing*).
R2. **Phase 1: Mounted Passing Mechanics:**
- Each tick, the ball-carrier rider must decide to `hold_ball()` (max 25 ticks / 5 seconds) or `pass_ball(target_rider_id)`.
- Mounts execute `perturb_balance(dx, dy)` to induce angular disturbance .
- Pass trajectory is a stochastic vector toward target rider:
- Catch probability .
- If catch succeeds: Ball transferred to target rider; passing streak .
- If catch fails or ball hits ground: Phase immediately transitions to 2 (*Scatter & Snipe*).
R3. **Phase 2: Scatter & Snipe Mechanics:**
- Uncoupling: All riders and mounts detach into independent agents.
- Fleeing: All agents execute `flee(dx, dy)` at max sprint speed ().
- Chasing: All agents move toward ball position; the nearest mount executes `retrieve_ball()`.
- Ball Snipe: The ball-holding mount executes `throw_at_rider(target_rider_id, power)`:
- Linear raycast projectile towards target.
- If ball collides with any fleeing rider: **Hit Confirmed!** Roles invert (), and Phase 1 restarts.
- If throw misses or goes out of bounds: **Miss!** scores point, roles do not swap, and Phase 1 restarts with original teams.
R4. **Victory Condition:**
- [gap-fill] The first team to accumulate 5 points in the riding role wins the match.
## Edge cases
- **Tie at the end condition:** Not applicable — points are awarded strictly to the current riding team upon a defender miss.
- **A player with no legal move:** Movement and passing actions are always available while active.
- **Repetition / cycles:** Bounded by a hard tick cap per round ( ticks in Phase 2); [gap-fill] if mounts fail to retrieve and throw within 300 ticks, riders are awarded the round point.
- **Simultaneous claims on the same resource or position:** If two mounts reach the ball on the exact same tick, the mount with higher agility attribute receives possession.
- **Player elimination mid-round; turn order repair:** No permanent eliminations occur; role inversion operates symmetrically across all players.
- **Resource exhaustion:** Exactly 1 ball and a fixed agent pool.
- **Termination guarantee:** Guaranteed by finite Phase 2 tick limits and non-decreasing point totals toward 5.
## State representation
- **Persistent state:** Team scores , current riding team ID , round count.
- **Dynamic game state:** Phase , pass streak counter, ball state (position, velocity, carrier ID).
- **Agent states:** Positions , velocities, role , partner ID.
- **Observable information:** Fully observable state for all agents.
## Action space
- Phase 1: `pass_ball(rider_id, power)` (Rider), `perturb_balance(angle, force)` (Mount).
- Phase 2: `flee(dir_x, dir_y)` (Rider), `retrieve_ball()` (Mount), `throw_at_rider(rider_id, power)` (Mount).
## Playability notes
- **Single-player-vs-AI:** Highly dynamic: human plays as active rider (timing passes against AI mount wobbles, sprinting to dodge throws) or as mount (intercepting and aiming snipe throws).
- **Group games ():** Excellent multi-agent cooperative environment: AI mounts coordinate passing lanes and crossfire throws.
- **Physical-skill games:** Passing and throwing accuracy modeled via standard 2D Gaussian aim dispersion.
- **What is lost in the adaptation:** The physical sheer exhaustion of carrying a human being on one's back in soft Saharan sand.
## Implementation hints
- Implement as a 2D state machine switching between coupled movement physics (shared coordinate with local offset) and uncoupled free-agent flocking.
- First milestone: Implement 1v1 pair (1 Rider on 1 Mount) testing pass drop trigger and single-target chase snipe.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Saharan piggyback ball-tag game (L-Kbayba) (Morocco). (n.d.). Games of Countries. https://gamesofcountries.com/games/ma-morocco/kabbouba
@misc{gamesofcountries-ma-morocco-kabbouba,
title = {Saharan piggyback ball-tag game (L-Kbayba) (Morocco)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/ma-morocco/kabbouba}
}