Formal Specification
Seven Stones — Formal Specification
Iran · ball-team · Confidence: low
← Back to game pageImplementation Suitability
Suitability: adaptation-requiredFidelity: discretizedGap-fills: 2
# Haft Sang — AI-optimized specification
## General idea
A high-intensity asymmetric team evasion and building game. Attackers attempt to collapse and reconstruct a 7-element tower at court center, while stationary ball-carrying defenders use passing trees to establish clear tag vectors on mobile attackers.
## Formal model
- **Abstraction taken:** The 15x20m pitch is discretized into a 2D coordinate grid with the tower at `(0, 0)`. Simulation runs on discrete time ticks (`0.5s`). Throws, passes, and tags are modeled as distance-attenuated stochastic events. Defenders holding the ball have speed locked to 0.
- **Player/agent count:** 2 teams of `K` agents each (`3 <= K <= 7`). Team 0 = Attackers/Builders, Team 1 = Defenders/Taggers.
- **Turn model:** Two-phase model (Sequential Opening Throws -> Simultaneous Real-Time Ticked Active Phase).
## Formal rules
R1. Court Topology:
- Pitch: `x ∈ [-10, 10]`, `y ∈ [-7.5, 7.5]`.
- Central circle: radius `1.0m` at `(0, 0)`.
- Stack height: integer `0..7`. Starts at 7 in Opening Phase.
- Throwing line: `x = -7.0`.
R2. Opening Throw Phase:
- Attackers sequentially execute `throw_at_stack()`.
- Hit probability: `P(hit) = skill_throw * 0.45`. [gap-fill]
- If hit succeeds: `stack_height` is set to 0 (tower collapsed); transition to Active Phase.
- If all attackers throw and miss: Roles swap immediately, new round begins.
R3. Active Play Phase Actions per Tick:
- **Attackers (Team 0):**
- `move(dx, dy)`: Move up to max speed.
- `stack_stone()`: Valid when inside circle (`dist <= 1.0`) and `stack_height < 7`. Takes 1 tick.
- `hold()`: Remain in position.
- **Defenders (Team 1):**
- `move(dx, dy)`: Move up to max speed (valid only if NOT holding ball).
- `pass_ball(target_id)`: Precondition: holding ball, `target_id` is teammate.
- `tag_attacker(target_id)`: Precondition: holding ball, `target_id` is active attacker.
- `retrieve_ball()`: Precondition: ball is free and co-located.
R4. Action Resolution Order per Tick:
- 1. Defender passes: `P(pass) = max(0.1, skill_pass * (1.0 - dist / 15.0))`.
- 2. Defender tag attempts: `P(tag) = max(0.05, skill_tag * (1.0 - dist / 10.0))`. If successful, target attacker is eliminated (`active = false`).
- 3. Agent spatial movements update.
- 4. Attacker stone stacking: If builder inside circle is not tagged on this tick, `stack_height += 1`.
R5. Round Win Conditions:
- **Attacker Win:** If `stack_height == 7`, Team 0 wins round (+1 point).
- **Defender Win:** If all attackers are eliminated before stack reaches 7, Team 1 wins round (+1 point).
R6. Match Termination:
- First team to reach 3 points wins match.
## Edge cases
- **Tie at the end condition:** Round victory conditions are mutually exclusive; match ends first to 3 points.
- **A player with no legal move:** Ball-carrying defenders cannot move; legal actions are strictly constrained to passing or tagging.
- **Repetition / cycles:** Bounded by monotonic attacker elimination or monotonic stone restacking. A tick limit of 600 ticks [gap-fill] awards round to defenders on timeout.
- **Simultaneous claims on stacking:** If multiple attackers execute `stack_stone()` simultaneously, exactly 1 stone is added per tick.
- **Player elimination mid-round:** Eliminated attackers are deactivated immediately; remaining attackers continue uninterrupted.
- **Resource exhaustion:** Stones are finite (7); stacking the 7th stone triggers immediate attacker victory.
- **Termination guarantee:** Guaranteed by finite attacker lives, finite stone count, and tick safety cap.
## State representation
- **Persistent state:**
- `match_scores: Tuple[int, int]`.
- `round_number: int`.
- `roles: Tuple[int, int]`.
- **Ephemeral round state:**
- `phase: enum {OPENING_THROWS, ACTIVE_PLAY}`.
- `stack_height: int` (0..7).
- `agent_positions: Array[2 * K] of Vector2D`.
- `agent_alive: Array[2 * K] of bool`.
- `ball_state: Tuple[str, Optional[int], Vector2D]` (status `held` or `free`, carrier ID, coordinates).
- `tick_counter: int`.
- **Information set:** Fully observable common knowledge.
## Action space
- `throw_opening()`: Precondition: Phase 0, active thrower.
- `move(dx: float, dy: float)`: Precondition: Phase 1, within pitch, non-carrier if defender.
- `stack_stone()`: Precondition: Phase 1, attacker in central circle.
- `pass_ball(target_id: int)`: Precondition: Phase 1, defender holding ball.
- `tag_attacker(target_id: int)`: Precondition: Phase 1, defender holding ball.
- `retrieve_ball()`: Precondition: Phase 1, defender co-located with free ball.
- `hold()`: Always valid.
## Playability notes
- **Single-player-vs-AI:** Highly playable. Player commands an attacker orchestrating distraction runs and dash-ins while AI defenders run passing trees to trap the player.
- **Group games:** Scales naturally from 3v3 to 7v7 without altering tactical dynamics.
- **Physical-skill model:** Throwing precision and dodging agility are mapped to distance-dependent probability curves.
- **What is lost:** Physical stone-balancing speed and manual dodging feints.
## Implementation hints
Construct the tick loop resolving ball transfers prior to position updates. Ensure the stationary carrier rule is strictly enforced to make passing the only means of rapid ball progression.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Seven Stones (Iran). (n.d.). Games of Countries. https://gamesofcountries.com/games/ir-iran/haft-sang
@misc{gamesofcountries-ir-iran-haft-sang,
title = {Seven Stones (Iran)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/ir-iran/haft-sang}
}