Formal Specification
Pillow Fight on a Beam — Formal Specification
Sri Lanka · wrestling-combat · Confidence: low
← Back to game pageImplementation Suitability
Suitability: adaptation-requiredFidelity: probabilistic-proxyGap-fills: 3
# Kotta Poraya — AI-optimized specification
## General idea
Kotta Poraya is a traditional Sri Lankan festival balance combat duel. Two contestants sit astride a smooth, elevated horizontal beam with one arm bound behind their back, wielding a cloth pillow in their free hand. Combatants deliver strikes targeting the opponent's torso and head while absorbing blows through thigh clamping and hip adjustments, attempting to destabilize the opponent and unseat them from the beam into the landing pit below.
## Formal model
- **Abstraction taken:** Continuous physical equilibrium on a cylinder is discretized into a 1D balance scalar `B_i in [-1.0, +1.0]` for each combatant `i in {1, 2}`, where `0.0` represents perfect upright stability and `|B_i| >= 1.0` triggers an unseating fall. In each simultaneous round, combatants choose a strike or defensive stance.
- **Player/agent count:** Exactly 2 combatant agents (Agent 1 and Agent 2).
- **Turn model:** Simultaneous discrete rounds (ticks).
## Formal rules
R1. Setup:
- Initial balance states: `B_1 = 0.0`, `B_2 = 0.0`.
- Both combatants start with Stamina `S_1 = 100`, `S_2 = 100`.
- Max round limit `T_max = 40` rounds.
R2. Action Selection:
- In each simultaneous round `t`, both agents choose one action from:
- `Heavy_Overhead_Strike`: High impact, high commitment. Stamina cost `-15`. Base impact torque `I = 0.45`.
- `Fast_Side_Swipe`: Quick strike, lower impact. Stamina cost `-8`. Base impact torque `I = 0.25`.
- `Dodge_Lean`: Evade incoming strike. Stamina cost `-5`. Reduces opponent strike hit chance by 60%, but shifts own balance `B += Uniform(-0.15, +0.15)`.
- `Thigh_Clamp_Brace`: Defensive recovery. Consumes 0 stamina, recovers `+10` stamina (max 100). Reduces balance perturbation toward zero: `B = B * 0.5`.
R3. Combat Resolution:
- [gap-fill] Strike accuracy and unbalance resolution:
- If Agent A strikes and Agent B does not dodge: Strike lands cleanly with probability `P(Hit) = 0.85 * (S_A / 100)`.
- If strike lands, Agent B suffers torque: `Delta_B = I * Uniform(0.8, 1.2) * (1.0 - (0.3 if B == BRACE else 0.0))`.
- Balance updates: `B_B(t+1) = B_B(t) + (Delta_B if CoinFlip() else -Delta_B)`.
R4. Fall & Elimination Check:
- If `|B_1| >= 1.0` and `|B_2| < 1.0`: Agent 1 falls off the beam. Agent 2 wins the bout immediately.
- If `|B_2| >= 1.0` and `|B_1| < 1.0`: Agent 2 falls off the beam. Agent 1 wins the bout immediately.
- [gap-fill] Simultaneous Fall: If both `|B_1| >= 1.0` and `|B_2| >= 1.0` in the exact same tick, the agent with the smaller excess `|B| - 1.0` is declared to have fallen second; if tied, an immediate sudden-death round is restarted from `B = 0.0`.
R5. Match Timeout:
- [gap-fill] If neither combatant falls within `T_max = 40` rounds, the combatant with the lower absolute balance displacement `|B|` (more upright) wins the bout on judges' points.
## Edge cases
- Tie at the end condition: Equal `|B|` values at round 40 trigger a 5-round sudden-death tiebreaker.
- A player with no legal move: Not applicable — defensive brace is always legal with 0 stamina.
- Repetition / cycles: Bounded strictly by the 40-round bout ceiling.
- Simultaneous claims on the same resource: Not applicable — actions resolve simultaneously into independent player balance states.
- Player elimination mid-round: The first agent to breach `|B| >= 1.0` is instantly eliminated; bout terminates.
- Resource exhaustion: When stamina reaches 0, strike actions are disabled, forcing the agent into defensive clamp/brace until stamina recovers.
- Termination guarantee: Round counter strictly increments every tick toward `T_max = 40`, guaranteeing finite termination.
## State representation
- Persistent state:
- `bout_score` (mapping of wins across tournament).
- Per-turn ephemeral state:
- `balance_1`, `balance_2` (floats `in [-1.0, +1.0]`).
- `stamina_1`, `stamina_2` (floats `0..100`).
- `round_timer` (integer `1..40`).
- `last_action_1`, `last_action_2`.
- Observable information: Fully observable — balance offsets, stamina levels, and remaining time are public.
## Action space
- `select_combat_action(action_type)`:
- `action_type in {"HEAVY_OVERHEAD", "FAST_SWIPE", "DODGE_LEAN", "THIGH_CLAMP_BRACE"}`.
- Precondition: `HEAVY_OVERHEAD` requires `stamina >= 15`; `FAST_SWIPE` requires `stamina >= 8`.
## Playability notes
- Single-player-vs-AI: Excellent fighting-game dynamic with simultaneous action prediction. AI reads player balance state to time heavy strikes when the player is off-center.
- Group games (n>4): Structured as a single-elimination knockout tournament bracket.
- Physical-skill games: Dynamic core equilibrium and single-arm pillow swinging are mapped to 1D balance perturbation physics and stamina management.
- What is lost in the adaptation: The physical splash into water/mud, the comical pillow thwack sound, and the festive roar of New Year onlookers.
## Implementation hints
Very low complexity state machine. Can be implemented in under 80 lines of code. Milestone 1: implement 4-action simultaneous matrix, balance displacement stochastic updates, fall condition check, and 40-round timeout.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Pillow Fight on a Beam (Sri Lanka). (n.d.). Games of Countries. https://gamesofcountries.com/games/lk-sri-lanka/kotta-poraya
@misc{gamesofcountries-lk-sri-lanka-kotta-poraya,
title = {Pillow Fight on a Beam (Sri Lanka)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/lk-sri-lanka/kotta-poraya}
}