Skip to main content
Formal Specification

Sarah's Life (Alley Dodgeball) — Formal Specification

Israel · ball-team · Confidence: high

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 3
# Chayei Sarah — AI-optimized specification ## General idea Chayei Sarah is a free-for-all spatial combat game of positional restrictions. Players navigate a narrow 1D corridor. The active ball carrier cannot move and must throw to eliminate standing opponents, who become sitting "captives" at their current coordinates. The game features a complex "prisoner-chain" system: a captive is immediately resurrected if their original captor is hit, or if a standing runner steps within their adjacent radius, triggering a touch-swap. ## Formal model - **Abstraction taken:** The narrow alleyway is discretized as a long 1D grid X∈[1,20]. - **Player/agent count:** 4 to 12 players. - **Turn model:** Simultaneous-movement ticks. ## Formal rules R1. **State variables per player:** - `x` (1..20). - `state`: Enum `[ACTIVE, CAPTIVE]`. - `captor_id`: ID of the player who eliminated them (defaults to 0). R2. **The Launch:** At round start, the ball is at X=10. All players are spawned at random positions. The ball remains inactive for 3 ticks (simulating the 3 bounces). On tick 4, the ball becomes active, and players can move to grab it. R3. **Active Play Movement:** - **Active Players:** Can move 1 cell in either direction per tick. - **Active Carrier:** If holding the ball, they cannot move (`velocity` 0). They can only throw. - **Captive Players:** Must stand still (cannot move) at their current coordinate xcaptive. R4. **Throwing & Catching:** - The carrier executes `throw_ball(target_player_id)`. - The trajectory is checked for line-of-sight. If no obstacle, the target resolves: - Target can attempt a `catch_ball()` action. Success rate: P(catch)=0.20. - If caught, the Shooter's state is set to `CAPTIVE` with `captor_id = target_id`, and the target becomes the active carrier. - If hit (not caught), target's state is set to `CAPTIVE` with `captor_id = shooter_id`. The ball becomes loose at the target's cell. R5. **Chain Release and Sitting Tags:** - **Captor Elimination:** If Player B (who is active) is hit and becomes `CAPTIVE` under Player C, the engine sweeps all players with `captor_id == B`. Their state is reset to `ACTIVE`, and `captor_id` is set to 0 (chain release). - **Sitting Tag:** [gap-fill] If an active player steps on a cell adjacent to a `CAPTIVE` player (|xactive−xcaptive|≤1), the captive can execute `tag_passerby()`. - Success rate is 100% if the active player stood still on that cell. - On tag, the active player's state is set to `CAPTIVE` (retaining their own captor), and the captive's state is reset to `ACTIVE`. R6. **Win Condition:** The game terminates when only one player has `state == ACTIVE`. That player is declared the winner. ## Edge cases - **Tie at the end condition:** Not applicable; only one player can be active at the end. - **A player with no legal move:** Any player can always choose to stand still. - **Repetition / cycles:** A infinite cycle of mutual captures is theoretically possible if captives constantly tag passersby. [gap-fill] To guarantee termination, after 100 ticks, sitting tags are disabled; after 150 ticks, the playing field shrinks by 2 cells from both ends every 10 ticks, forcing direct throws and rapid elimination. - **Simultaneous claims on the same resource:** If two players enter a cell containing a loose ball, the player who has been `ACTIVE` longest gets priority. - **Player elimination mid-round:** Removed from grid; any captives they held are immediately released. - **Resource exhaustion:** Not applicable. - **Termination guarantee:** Guaranteed by R5 (shrinking field and disabled tags). ## State representation - **Persistent state:** - `players`: Array of `(id, x, state, captor_id)`. - `ball_carrier_id`: Integer. - `ball_x`: Integer. - `tick_count`: Integer. - **Per-tick ephemeral state:** - `committed_moves`: Map of `player_id` to integer. ## Action space - `move_to(x)`: Step to adjacent cell. - `throw_ball(target_id)`: Throw at target. Precondition: agent is active ball carrier. - `tag_passerby()`: Captive tags adjacent runner. - `grab_ball()`: Collect loose ball in same cell. ## Playability notes - **Single-player-vs-AI:** Highly playable. The user weaves through a narrow corridor, dodging throws while avoiding sitting captives. AI agents manage the ball dynamically, prioritizing players who have captured the most captives to trigger large chain releases. - **Group games (n>4):** Standard format. - **Physical-skill games:** [gap-fill] Throw accuracy decays based on distance: P(hit)=clamp(1.0−0.08×distance,0.2,0.9). - **What is lost in the adaptation:** The physical exertion of running in a tight brick alleyway, the panic of dodging a fast ball at close range, and the tactile coordination of catching are lost. ## Implementation hints - Implement the 1D line and the 3-tick launch timer. - Write the prisoner-chain sweep algorithm that executes recursive releases. - Implement the proximity-check that enables sitting tags. - Build an AI that calculates the "value" of a target based on how many captives their elimination would release.

Download as JSON

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

Download JSON
Cite this page

Sarah's Life (Alley Dodgeball) (Israel). (n.d.). Games of Countries. https://gamesofcountries.com/games/il-israel/chayei-sarah

@misc{gamesofcountries-il-israel-chayei-sarah,
  title = {Sarah's Life (Alley Dodgeball) (Israel)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/il-israel/chayei-sarah}
}