Formal Specification
Khan Scramble / Plunder the Khan — Formal Specification
Kazakhstan · dexterity-small · Confidence: low
← Back to game pageImplementation Suitability
Suitability: adaptation-requiredFidelity: probabilistic-proxyGap-fills: 5
# Khantalapai — AI-optimized specification
## General idea
Khantalapai is a traditional group knucklebones game played with 21 sheep astragalus pieces, including one distinctively dyed *Khan* bone. The active player rolls all 21 bones into the center; if the *Khan* lands in the highest position (*Alshy*), an instant simultaneous scramble is triggered where all players race to snatch bones. Otherwise, the round enters a precise turn-based matching phase where players flick matching-stance bones against each other without disturbing adjacent pieces.
## Formal model
- **Abstraction taken:** The 21-bone scatter is modeled as a discrete stochastic roll generating landing stances and 2D coordinates. [gap-fill] The *Talapai* physical scramble is abstracted into a simultaneous multi-agent lot-allocation resolver parameterized by agent reaction speed , while the precision matching flick is modeled via distance-dependent collision probabilities.
- **Player/agent count:** 2 to 6 agents (standard 2-agent duel or 4-agent group).
- **Turn model:** Round starts with a single caster; branches into either simultaneous reaction (*Talapai*) or sequential clockwise precision flick turns.
## Formal rules
R1. **Inventory and Bone Stance Distribution:**
- Exactly 21 astragalus bones: 20 standard bones () and 1 master bone ().
- [gap-fill] Each rolled bone independently assumes one of 4 stances according to empirical sheep astragalus geometric probabilities: , , , .
- Each agent starts with a score of 0 captured bones.
R2. **The Cast & Branching Evaluation:**
- The active caster rolls all remaining uncollected bones onto the playing circle.
- If is among the rolled bones and lands in stance :
- **Talapai Trigger:** All agents execute a simultaneous scramble.
- Each agent claims a random share of the uncollected bones proportional to normalized reaction speed: .
- [gap-fill] The agent with the highest sampled draw claims (+5 bonus points).
- All bones are collected, and the round terminates immediately.
- If is not in (or has already been captured):
- The game proceeds to the **Pair-Matching Phase** with the active caster as the initial shooter.
R3. **Pair-Matching Phase (Precision Shooting):**
- The active shooter selects an origin bone and a target bone from the table such that:
- (e.g. both are *Bük*, *Shik*, *Täyke*, or *Alshy*).
- Neither nor is , unless is the only remaining bone of that stance on the table.
- The shooter executes `flick(origin_id, target_id)`.
- **Resolution:**
- Stochastic hit test: .
- If clean hit: Both and are removed from the table and added to the active agent's capture bank (+2 points). The active agent retains the turn and may shoot again.
- If miss or foul (striking a non-matching bone or disturbing bystander bones): No bones are captured. The turn ends immediately and passes clockwise to the next agent.
R4. **Capturing the Khan in Matching Phase:**
- can only be legally targeted when no other pair of matching standard bones remains, or as the target of the final matching standard bone.
- Capturing via matching flick awards 5 points.
R5. **End Condition and Match Winner:**
- The round terminates when all 21 bones have been captured from the table.
- Each agent's score is computed: .
- [gap-fill] In case of a tie in total points across players at the end of a round, tied players roll a single bone simultaneously, with highest stance winning the tie-break.
## Edge cases
- **Tie at the end condition:** Explicitly resolved by R5 [gap-fill] (sudden-death single-bone stance roll among tied players).
- **A player with no legal move:** If the table has remaining bones but no two bones share the same stance (an unmatchable configuration): all remaining unmatchable bones are gathered and re-cast by the active player.
- **Repetition / cycles (and the loop-breaking rule):** In the matching phase, if all players in a full cycle around the circle fail consecutively to make a valid capture, all remaining bones on the table are re-cast by the current player.
- **Simultaneous claims on the same resource or position:** In the *Talapai* trigger (R2), simultaneous claims are resolved by the multinomial allocation resolver parameterized by agent reaction speeds.
- **Player elimination mid-round; turn order repair:** Not applicable; all players remain active throughout all rounds.
- **Resource exhaustion (pieces, tokens, space, time):** Bones on the table monotonically decrease towards 0 on every successful capture.
- **Termination guarantee: why the game provably ends:** In the *Talapai* branch, all bones are consumed in 1 tick; in the matching branch, every successful flick consumes 2 bones from a finite set of 21. Re-casts occur only when no legal pairs exist, ensuring strict termination.
## State representation
- **Persistent state:**
- `bones`: Array of 21 structs `{id: 0..20, is_khan: bool, status: table/captured, stance: Enum, pos: (x, y)}`.
- `player_scores`: Array of integers.
- `active_player`: Integer .
- `consecutive_misses`: Integer counting misses since last capture.
- **Per-turn ephemeral state:**
- `khan_alshy_triggered`: Boolean flag.
- `flick_pair`: Tuple of `(origin_id, target_id)`.
- `flick_success`: Boolean.
- **Observable information:** Fully observable. All bone positions, stances, and player scores are visible to all agents.
## Action space
- `cast_bones()`: Roll all remaining bones (only valid at start of round or upon mandatory re-cast).
- `scramble_react()`: Simultaneous action submitted during a *Talapai* trigger.
- `flick(origin_id, target_id)`: Select 2 matching-stance bones on table and execute shot.
## Playability notes
- **Single-player-vs-AI:** Natural. 1 human vs 1–5 AI agents. AI evaluates matching pairs by maximum expected capture probability.
- **Group games (n>4):** Scales smoothly from 2 to 6 agents; reduction to 2 agents preserves both the scramble tension and the matching duel.
- **Physical-skill games:** Modeled via two orthogonal agent attributes: `reaction_speed` (for Talapai) and `aim_accuracy` (for flick shooting).
- **What is lost in the adaptation:** Physical hand collisions during the chaotic *Talapai* scramble and fine tactile fingertip control when aiming near clustered bones.
## Implementation hints
- Implement bone stance rolling using a fixed discrete probability vector `[0.15, 0.15, 0.35, 0.35]`.
- For the matching phase, generate a legal pair matrix where .
- First milestone: Implement the roll and *Talapai* branch, then implement matching-pair filtering and capture state updates.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Khan Scramble / Plunder the Khan (Kazakhstan). (n.d.). Games of Countries. https://gamesofcountries.com/games/kz-kazakhstan/khantalapai
@misc{gamesofcountries-kz-kazakhstan-khantalapai,
title = {Khan Scramble / Plunder the Khan (Kazakhstan)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/kz-kazakhstan/khantalapai}
}