Skip to main content
Formal Specification

Ball and Bat — Formal Specification

Afghanistan · ball-team · Confidence: low

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 3
# Top Danda — AI-optimized specification ## General idea A traditional bat-and-ball field game. A batter tosses and strikes a cloth/rubber ball deep into the outfield using a wooden club (*danda*) and sprints between the home crease and a distant safe base (*dawa*) to score runs, while fielders catch fly balls or retrieve and throw the ball to hit the runner or strike the home crease to record outs. ## Formal model - **Abstraction taken:** Continuous ball flight aerodynamics, sprint velocities, and live ball-tagging throws are discretized onto a 1D running corridor (X∈[0,40] meters) connecting Home Crease (X=0) and the Distant Safe Base (X=40), coupled with a 2D outfield sector for ball trajectories and fielder retrieval times. - **Player/agent count:** 2 teams (Team A and Team B), 6 to 10 agents per team. - **Turn model:** Sequential batting lineup within an inning; active play during a hit resolves as simultaneous ticks until runner is safe, scores, or is eliminated. ## Formal rules R1. **Match Setup:** A standard match consists of 2 complete innings (each team bats once). An inning concludes when all M batters on the batting team are eliminated (`outs == M`). R2. **Batting Phase:** - The active batter at Home Base (X=0) selects swing power and angle: `STRIKE_BALL(power, angle)`. - The batter has up to 3 strike attempts. Missing 3 swings results in a strikeout (*soot* / out). - When a hit occurs, the ball landing coordinate (rb,θb) is sampled from an outfield distribution (rb∈[15,80] meters). R3. **Fly Out Resolution:** - If any fielder is within catch radius (Rcatch=3.0m) of the landing coordinate, a catch check is evaluated: P(catch)=0.65. - If caught on the fly, the batter is out immediately; no base running occurs. R4. **Base Running & Fielding Chase:** If the ball lands uncaught on the ground: - The batter becomes a Runner, attempting to sprint from X=0→X=40→X=0 (total 80m circuit). - Runner advances at sprint speed: Vrun=6.0 m/s (discretized to 1.0s ticks = 6.0 meters/tick). - Nearest fielder moves to ball, retrieves it (Tretrieve=distVfield+1.0s), and may: 1. `THROW_AT_RUNNER()`: Throw ball to peg runner while runner is outside safe zones (X∈(0,40)). Hit probability: P(hit)=max⁡(0.10,0.90−0.02×distance). 2. `THROW_TO_HOME_CREASE()`: Throw ball to hit the home crease before runner returns (P(hit crease)=0.75). - [gap-fill: running speeds, retrieval time equation, and throw accuracy formulas]. R5. **Scoring & Safe Staging:** - If the runner completes the full circuit (0→40→0) without being struck or having the crease broken, the batting team scores +1 point (*namra*). - **Staging at Base (*Dawa*):** If the ball is returned too quickly, the runner may stop safely at X=40. The runner is immune from outs while inside the safe zone and may complete the return leg home when the next teammate hits the ball. [gap-fill: safe staging mechanics]. - If the runner is pegged by the ball or the home crease is broken while the runner is in transit, the runner is eliminated (`status = OUT`). R6. **Inning Rollover & Match Victory:** - When all M batters on a team are eliminated, the inning ends, and teams swap batting/fielding roles. - The team with the highest cumulative point score after equal innings wins. ## Edge cases - Tie at the end condition: If scores are tied after 2 innings, each team plays a 2-batter sudden-death extra inning; team scoring more runs wins. [gap-fill: 2-batter extra inning tiebreaker]. - A player with no legal move: Not applicable; the active batter always has the legal action to swing. - Repetition / cycles: Bounded because each batter can take at most 3 swing attempts, and the total out limit (M) per inning strictly terminates the inning. - Simultaneous claims on the same resource or position: The safe base (X=40) has capacity for multiple staged runners; all staged runners can advance home simultaneously on subsequent outfield hits. - Player elimination mid-round; turn order repair: When a batter/runner is out, they are removed from the active lineup; the next batter on the roster immediately steps into the home crease. - Resource exhaustion (pieces, tokens, space, time): Batting lineup roster (M) is finite and strictly exhausts with each recorded out. - Termination guarantee: Provably terminates because the number of remaining batters in an inning decrements monotonically upon every out until reaching 0. ## State representation - **Persistent state:** - `current_inning`: integer (1..2) - `batting_team`: `Team A | Team B` - `match_scores`: `{team_a: integer, team_b: integer}` - `outs_count`: integer (0..M) - `batting_lineup_index`: integer - `staged_runners_at_dawa`: list of runner IDs - **Per-play ephemeral state:** - `batter_attempts_left`: integer (1..3) - `ball_pos`: `{r, theta}` - `runner_pos_x`: float (0..40) - `runner_direction`: `OUTWARD | INWARD | SAFE_AT_DAWA` - `play_status`: `BATTING | RUNNING | COMPLETED` - **Observable information:** Fully observable. Out counts, team scores, fielder positions, and runner coordinates on the track are public knowledge. ## Action space - `strike_ball(power, angle)`: Precondition: `play_status == BATTING` and `attempts_left > 0`. - `sprint_advance()`: Precondition: `play_status == RUNNING`. - `hold_safe_at_dawa()`: Precondition: `runner_pos_x >= 40.0`. - `field_and_throw(target_type)`: enum `[TARGET_RUNNER, TARGET_CREASE]`. ## Playability notes - Single-player-vs-AI: Very dynamic and engaging. As a batter/runner, the player evaluates field gaps and timing risks (sprinting for the full circuit vs. stopping at the safe base); as fielders, AI agents coordinate cutoff relays and pegging throws. - Group games (n>4): Standard 8v8 format scales cleanly to a 2-agent duel (1 Batter/Runner vs. 1 Fielder/Pitcher) on a reduced field without losing the core risk-reward running decisions. - Physical-skill games: Physical batting timing, throwing accuracy, and sprinting stamina are parameterized as distance distributions, catch radii, and velocity constants. - What is lost in the adaptation: The physical sting of hard-thrown rag balls hitting the runner's back, sprinting on rocky pasture ground, and post-match victory celebrations. ## Implementation hints Medium complexity. Requires coordinating the ball trajectory calculation with runner 1D track progression and fielder retrieval timers. Suggested first milestone: implement batting trajectory and 1D runner sprint logic against a deterministic ball return clock, then add fly catches, staged runners at *dawa*, and fielding throws.

Download as JSON

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

Download JSON
Cite this page

Ball and Bat (Afghanistan). (n.d.). Games of Countries. https://gamesofcountries.com/games/af-afghanistan/top-danda

@misc{gamesofcountries-af-afghanistan-top-danda,
  title = {Ball and Bat (Afghanistan)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/af-afghanistan/top-danda}
}