Skip to main content
Formal Specification

Seven Stones — Formal Specification

Israel · ball-team · Confidence: high

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 3
# Sheva Avanim — AI-optimized specification ## General idea Sheva Avanim (Seven Stones) is a team-based tactical game of spatial control. After a stone tower is toppled, the attacking team must rebuild it piece-by-piece at the origin while the defending team retrieves a ball and passes it to eliminate attackers. The central mechanical constraint is that defenders cannot run while holding the ball, requiring them to use rapid, coordinated passes to surround the origin. ## Formal model - **Abstraction taken:** The playing field is a discretized 2D grid X∈[−5,5],Y∈[−5,5]. The stone tower is at the origin (0,0). - **Player/agent count:** Two teams of 4 agents: Team A (Builders) and Team B (Defenders). - **Turn model:** Simultaneous-movement ticks (500 ms length). ## Formal rules R1. **State variables:** - Each agent has: `id`, `team`, `x`, `y`, `is_eliminated` (boolean). - The board has: `tower_stacked_height` (0..7), `stones_scattered` (list of coordinates), `ball_carrier_id` (agent ID, or 0 if ball is loose), `ball_coords` (x,y). R2. **The Throw Leg:** - The round starts with Team A at Y=−4 and the tower at (0,0). - An agent from Team A executes `throw_at_tower()`. The probability of a successful hit is 60%. - If hit, the tower is toppled (`tower_stacked_height` set to 0), and stones are scattered randomly in a 1-meter radius around (0,0). The ball lands at a random loose coordinate, and active play begins. - If Team A fails three times, roles immediately swap. R3. **Active Play Movement (per tick):** - **Team A (Builders):** Any non-eliminated Team A agent can move up to 1 cell in any direction (including diagonals). - **Team B (Defenders):** - Any non-eliminated Team B agent *who is not carrying the ball* can move up to 1 cell in any direction. - The Team B agent *carrying the ball* cannot move (`velocity` strictly 0). R4. **Ball Mechanics (Team B):** - The ball carrier can execute `pass_ball(target_agent_id)` or `throw_at_player(target_agent_id)`. - `pass_ball` has a success rate of 90% (loose ball lands in target's cell). - `throw_at_player` has a success rate of P(hit)=clamp(1.0−0.15×distance,0.1,0.9). - If a throw at a Team A player succeeds, that player's `is_eliminated` is set to `true`, and the ball becomes loose in that cell. R5. **Rebuilding Mechanics (Team A):** - [gap-fill] A Team A agent standing at (0,0) can execute `place_stone()` if they are carrying a scattered stone. This action takes exactly 2 continuous ticks of standing still at (0,0) to complete. - Successfully placing a stone increments `tower_stacked_height` by 1. R6. **Win Conditions:** - **Team A Wins:** If `tower_stacked_height` reaches 7, Team A immediately wins the round, scoring 1 point. - **Team B Wins:** If all 4 Team A agents have `is_eliminated == true`, Team B immediately wins the round, scoring 1 point. ## Edge cases - **Tie at the end condition:** Not applicable; win conditions are mutually exclusive. - **A player with no legal move:** Any agent can always stand still or move to an adjacent free cell. - **Repetition / cycles:** If defenders hold the ball indefinitely without passing or throwing, [gap-fill] the game enforces a 20-tick shot clock; if no pass or throw is made within 20 ticks, the ball is automatically placed at (0,0) as loose, breaking any stalemate. - **Simultaneous claims on the same resource:** If a Team A and Team B player enter the same cell containing a loose ball, the defender takes priority. - **Player elimination mid-round:** Handled directly; `is_eliminated` prevents further turns and they are removed from the active grid layer. - **Resource exhaustion:** Not applicable. - **Termination guarantee:** Guaranteed by R4 (eventual elimination of all runners) and R5 (eventual completion of the 7-stone stack), coupled with the shot clock (R3 cycle breaker). ## State representation - **Persistent state:** - `agents`: Array of `(id, team, x, y, is_eliminated)`. - `tower_stacked_height`: Integer (0..7). - `ball_coords`: (x,y). - `ball_carrier_id`: Integer (ID of holder). - `shot_clock`: Integer. - **Per-tick ephemeral state:** - `committed_actions`: Map of `agent_id` to actions. ## Action space - `move_to(x, y)`: Move to an adjacent cell (R3 limits). - `pass_ball(target_id)`: Pass ball to a teammate (Defenders only). - `throw_at_player(target_id)`: Attempt to eliminate a Builder (Defenders only). - `pick_up_stone(stone_coords)`: Grab a scattered stone. - `place_stone()`: Place a stone on the tower (Builders only, requires (0,0) proximity). ## Playability notes - **Single-player-vs-AI:** Highly playable. The user controls a Builder, attempting to collect stones and rebuild the tower, while AI defenders deploy zone defense (surrounding the origin) and AI builders act as decoys. - **Group games (n>4):** Standard team structure generalizes cleanly. - **Physical-skill games:** [gap-fill] Direct physical throws and passes are abstracted as probability functions decaying over distance. - **What is lost in the adaptation:** The physical dodging, catching of the ball, high-speed running, and the manual haste of stacking flat stones are represented as digital coordinates and probability variables. ## Implementation hints - Implement the 2D coordinate grid and simultaneous-movement engine. - Write the distance calculation and the decay formula for throwing accuracy. - Create a state manager that validates stone collection and the 2 continuous-tick requirement for rebuilding. - Design an AI for defenders to coordinate: "If carrier, target nearest builder. If non-carrier, move to position between nearest builder and (0,0)."

Download as JSON

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

Download JSON
Cite this page

Seven Stones (Israel). (n.d.). Games of Countries. https://gamesofcountries.com/games/il-israel/sheva-avanim

@misc{gamesofcountries-il-israel-sheva-avanim,
  title = {Seven Stones (Israel)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/il-israel/sheva-avanim}
}