Skip to main content
Formal Specification

Peg and Bat — Formal Specification

Bulgaria · stick-team · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 4
# Chelik i perushinka — AI-optimized specification ## General idea A traditional bat-and-peg territorial contest where the batting agent executes two strike phases (ground launch and mid-air tip-strike) to drive a pointed peg into the field, while fielders attempt aerial interception or target throws back at home base. It combines spatial bidding (distance estimation) with physical shot-execution risk. ## Formal model - **Abstraction taken:** The continuous projectile trajectory, bat physics, and mid-air timing are abstracted into stochastic outcome resolvers parameterized by strike difficulty and agent aim/power attributes. [gap-fill] The distance-estimation bidding mechanic is formalized as a discrete claim vs. ground-truth check. - **Player/agent count:** 2 teams of k agents (k≥1, standard k=3). - **Turn model:** Phase-based turn structure within an active batter inning, rotating to fielding team upon k outs. ## Formal rules R1. Setup: Home base is positioned at coordinate (0,0) with target trench length Ltrench=1.0 unit. Point target T=100 points. R2. Inning start: Batting team designates an active batter from their roster in fixed sequence. R3. Phase 1 (Launch): Active batter selects launch vector (θ,power). Resolver outputs peg landing coordinate (x1,y1) and airborne flight path. R4. Aerial catch check: If (x1,y1) intersects a fielder's interception radius during flight, `P(catch)` is evaluated. If caught, batter is out (Out Count increments by 1) and turn proceeds to R9. R5. Phase 2 (Fielder return throw): If uncaught, nearest fielding agent throws peg from (x1,y1) toward home base (0,0). If the return trajectory hits the bat lying on base (distance to base <ϵtarget), batter is out and proceed to R9. R6. Phase 3 (Tip-strike): If return throw misses, batter moves to (x1,y1) and executes a tip-strike: - [gap-fill] Batter has up to 3 tipping attempts to launch the peg into the air and strike it forward to a new landing coordinate (x2,y2). R7. Phase 4 (Distance bidding): - Batter submits distance bid B∈ℕ in units of bat length. - True distance D=⌊dist((x2,y2),(0,0))/Lbat⌋. - [gap-fill] If fielding team challenges: if B≤D, batting team scores +B points; if B>D, batting team scores 0 points. If fielding team does not challenge, batting team scores +B points automatically. R8. Turn cycle: If batter was not put out in R4 or R5, batter retains strike and repeats from R3 for a maximum of 3 scoring turns per batter [gap-fill]. R9. Out transition: When an out occurs, batting roster index advances. When all k batters are out, batting and fielding teams swap roles (new half-inning). R10. Victory: First team whose score ≥T wins immediately upon completion of equal half-innings. ## Edge cases - Tie at the end condition: If both teams cross T with equal score after complete innings, one sudden-death tiebreaker inning is played per team. - A player with no legal move: Not applicable — striking, fielding, and bidding actions are always defined within each phase. - Repetition / cycles: Bounded by the finite inning/out structure; each batter either scores points or incurs an out, terminating the inning. - Simultaneous claims on the same resource or position: In fielding phase, if multiple fielders are equidistant from the landing peg, the agent with lower roster ID is prioritized. - Player elimination mid-round; turn order repair: If an agent disconnects, team size k decrements; outs require kcurrent dismissals, preserving turn rotation among remaining agents. - Resource exhaustion: Not applicable — peg and bat are persistent entities reset at the start of each phase. - Termination guarantee: Every half-inning terminates because every batter eventually accumulates an out via R4 or R5; monotonic score accumulation toward T guarantees game termination. ## State representation - Persistent state: Scores (SA,SB), active team ∈{A,B}, batter roster index i∈[0,k−1], out count ∈[0,k−1], total innings completed. - Per-turn ephemeral state: Peg position (x,y), peg airborne flag, current phase ∈{Launch,Return,TipStrike,Bidding}, active bid B. - Observable information: Fully observable coordinates, score, and outs; team bids are public; private skill attributes may be hidden. ## Action space - `launch_peg(angle, power)`: Precondition: Phase == Launch, caller is active batter. - `return_throw(target_coord)`: Precondition: Phase == Return, caller is nearest fielder. - `tip_strike(tap_angle, hit_power)`: Precondition: Phase == TipStrike, caller is active batter. - `submit_bid(units)`: Precondition: Phase == Bidding, caller is active batter. - `challenge_bid(accept_or_challenge)`: Precondition: Phase == Bidding, caller is fielding captain. ## Playability notes - Single-player-vs-AI: Natural — Human controls batter (aim, power, bid); AI controls fielders and opponent batters using stochastic skill models. - Group games (n>4): Reduces cleanly to 2 teams of 1 agent (solitary batter vs solitary fielder) without losing the core launch-return-strike-bid cycle. - Physical-skill games: Modeled via 2D physics vectors combined with Gaussian noise inversely proportional to an agent's `accuracy` attribute. - What is lost: The physical hand-eye dexterity of clipping a small spinning wooden peg out of mid-air is replaced by parameter estimation and probabilistic sampling. ## Implementation hints Branching factor is small if aim angles and bids are discretized (e.g. 8 aim sectors, 5 power tiers). First milestone: Implement the 2D coordinate distance calculation and bidding verification loop with random throw resolvers before integrating fielding heuristics.

Download as JSON

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

Download JSON
Cite this page

Peg and Bat (Bulgaria). (n.d.). Games of Countries. https://gamesofcountries.com/games/bg-bulgaria/chelik-i-perushinka

@misc{gamesofcountries-bg-bulgaria-chelik-i-perushinka,
  title = {Peg and Bat (Bulgaria)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/bg-bulgaria/chelik-i-perushinka}
}