Formal Specification
Bat and Trap (Kentish Pub Batting Game) — Formal Specification
United Kingdom · dexterity-throw · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: probabilistic-proxyGap-fills: 1
# Bat and Trap — AI-optimized specification
## General idea
An asymmetric bat-and-ball pub game where batting agents execute a two-stage mechanic (striking a seesaw trap lever to launch a rubber ball, then driving it forward between two posts 21 yards away). A successful drive scores 1 run, while the fielding team responds by attempting an aerial catch or bowling the ball back from 21 yards to hit a small 5-inch flap on the trap to dismiss the batsman.
## Formal model
- **Abstraction taken:** The pitch is modeled as a 2D corridor of length 63 ft (21 yards) and width 13.5 ft. The strike trajectory produces an exit angle `theta` and velocity `v`. The fielding response is modeled via two stochastic resolution layers: (1) an aerial intercept check by the 8 fielders, and (2) an underarm bowling aim roll toward the trap flap (target width 5 in).
- **Player/agent count:** 2 teams of 8 agents (or 2 individual agents in 1v1 singles format).
- **Turn model:** Sequential per-stroke turn structure within an innings. The active batsman executes strokes repeatedly until dismissed, whereupon the next teammate in order steps up.
## Formal rules
R1. **Match Structure:** A match consists of 1 innings per team (or best of 3 innings). The team batting second wins immediately if their total runs exceed the first team's score.
R2. **Batting Stroke Execution:** On their turn, the active batsman submits:
- `strike(power: float in [0..1], elevation_angle: float, horizontal_aim: float)`
R3. **Launch & Contact Roll:**
- The ball spring height and strike timing are sampled. With probability `P_miss = max(0.02, 0.15 * (1.0 - batter_skill))`, the batter whiffs. Missing twice in a row results in `DISMISSAL_WHIFF`.
- If contact succeeds, the ball travels along trajectory `(x_end, y_end, z_max)`.
R4. **Fielding Intercept & Scoring:**
- *Catch Check:* If `z_max > 3.0 ft` and flight time allows, each of the 8 fielders within range has an interception probability based on fielding skill. A successful catch results in `DISMISSAL_CAUGHT` (0 runs scored).
- *Gate Check:* If not caught, if `-6.75 <= y_end <= +6.75` ft at `x = 63.0 ft` and height `z <= 7.0 ft`, the stroke scores `1 RUN`.
- *Wide / High Hit:* If the ball misses the gate envelope, `0 RUNS` are scored.
R5. **Bowling Challenge (Flap Attack):**
- If the batter is not dismissed on the catch, the fielding team selects a bowler from their 8 agents to deliver the ball from `x = 63.0 ft` back at the trap flap `(x=0, y=0, z=0)`.
- Bowling impact `(y_bowl, z_bowl)` is sampled from a 2D Gaussian centered on `(0, 0)` with variance `sigma_bowl` inversely proportional to bowler accuracy.
- If `|y_bowl| <= 2.5 in` and `0 <= z_bowl <= 5.0 in`: the flap is knocked down, resulting in `DISMISSAL_BOWLED`.
- Otherwise: the batsman survives and retains any run scored in R4.
R6. [gap-fill] Batsman Retirement / Over Limit:** In team play, an individual batsman may score a maximum of 20 runs in a single turn before mandatory retirement to prevent unbounded single-batter games.
R7. **Innings End:** An innings concludes when all 8 batsmen of the batting team are dismissed (or retired).
## Edge cases
- **Tie at the end condition:** If both teams have equal runs after full innings, a 1-over (1 batter per side, 3 balls) sudden-death tie-break is played.
- **A player with no legal move:** Not applicable; striking the trap ball is always a mandatory available action.
- **Repetition / cycles:** Inning termination is guaranteed by non-zero dismissal probability per stroke (via catch or bowling challenge) and the R6 run-cap per batter.
- **Simultaneous claims on the same resource:** Not applicable; batting and fielding actions execute in strict sequential phases.
- **Player elimination mid-round:** If an agent disconnects or is disqualified during batting, that batsman slot is marked `DISMISSED` with 0 runs.
- **Resource exhaustion:** Trap resets automatically; innings is strictly bounded by 8 dismissals.
- **Termination guarantee:** Each stroke has a strictly positive lower-bounded probability of dismissal `P_dismiss >= P_bowled > 0`, ensuring finite expected strokes per innings.
## State representation
- **Global state:** `innings_score: [int, int]`, `active_team: int in [0, 1]`, `active_batter_index: int in [0..7]`, `runs_current_batter: int`.
- **Per-stroke ephemeral state:** `ball_trajectory: (float, float, float)`, `stroke_result: Enum(RUN, NO_RUN)`, `dismissal_event: Optional[Enum(CAUGHT, BOWLED, WHIFF)]`.
- **Observable information:** Fully public scoreboard, batter stats, bowler fielding positions.
## Action space
- `batter_strike(power: float, elevation: float, aim_offset: float)`: Parameterized batting stroke aiming through the post gate.
- `fielding_position(agent_id: int, pos_x: float, pos_y: float)`: Defensive deployment of 8 outfielders.
- `select_bowler(agent_id: int)`: Choose teammate to execute the underarm 21-yard throw.
## Playability notes
- **Single-player-vs-AI:** Highly engaging asymmetric game. Human can bat against AI fielders/bowlers and subsequently take the mound to bowl out the AI batting order.
- **Group games reduction:** Reduces naturally to 1v1 singles where each agent alternately bats and bowls until 3 wickets fall.
- **Physical-skill games:** Modeled via two independent skill distributions: batting trajectory accuracy and 21-yard target bowling dispersion.
- **What is lost in the adaptation:** The manual sensation of timing the upward rise of the trap ball and the distinct timber sound of the flap clacking flat.
## Implementation hints
Modularize into three sub-models: `TrajectoryGenerator`, `CatchEvaluator`, and `BowlingResolver`. Because all action resolutions are sequential, the state machine is straightforward with no complex concurrency.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Bat and Trap (Kentish Pub Batting Game) (United Kingdom). (n.d.). Games of Countries. https://gamesofcountries.com/games/gb-united-kingdom/bat-and-trap
@misc{gamesofcountries-gb-united-kingdom-bat-and-trap,
title = {Bat and Trap (Kentish Pub Batting Game) (United Kingdom)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/gb-united-kingdom/bat-and-trap}
}