Skip to main content
Formal Specification

Herding the Pig (Pig Driving) — Formal Specification

Latvia · stick-team · Confidence: low

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 8
# Cūkas ganīšana — AI-optimized specification ## General idea An asymmetric territorial stick-and-puck game played on a circular hub-and-spoke graph. A lone "shepherd" agent attempts to drive a rolling puck ("the pig") into a central pit or seize an unoccupied perimeter station; defending agents must balance leaving their protective stations to bat the puck away against the catastrophic risk of having their home station stolen while vacant. ## Formal model - **Abstraction taken:** Continuous physical pasture terrain, stick swings, and hole-jabbing are abstracted into a 2D planar graph with a central goal node H0 (the pig pen) and K radial perimeter station nodes H1,…,HK located at radius R. The continuous physical puck is modeled as a 2D point mass with velocity damping and collision response, and stick strikes are modeled as impulse vectors with angular error sampling. - **Player/agent count:** 1 shepherd agent and K perimeter defenders (3≤K≤9). - **Turn model:** Synchronous discrete-time simulation ticks (e.g. 1 tick = 0.25 s). ## Formal rules R1. **Topology setup:** Central node H0 at (0,0). K perimeter stations H1,…,HK arranged uniformly along circle of radius R=10 units [gap-fill]. R2. **Initial state:** Each defender i∈{1…K} occupies station Hi with stick status `anchored`. The shepherd starts at (R+2,0). The puck starts at a random perimeter spawn point (R+4,θ) with zero velocity [gap-fill]. R3. **Agent action space per tick:** - Defenders with `anchored` stick can choose: `maintain_anchor()` or `unanchor_and_move(direction)` [gap-fill]. - Unanchored defenders and the shepherd can choose: `move(direction)`, `strike_puck(power, target_angle)`, or `anchor_stick(station_id)`. R4. **Station vulnerability:** A perimeter station Hi is `protected` if and only if an agent is within distance ϵ=1.0 and executes `anchor_stick(H_i)`. While vacant or unanchored, Hi is `open`. R5. **Puck dynamics and striking:** - Striking the puck requires agent distance to puck ≤1.5 units. - Resulting puck velocity v→=power⋅uˆ(θ+Δθ) where Δθ∼𝒩(0,σ2) [gap-fill]. - Puck decelerates by friction coefficient μ=0.15 per tick [gap-fill]. R6. **Central goal condition:** If puck distance to H0≤1.0 with speed below capture threshold vmax⁡=2.0, the pig is penned. All defenders immediately enter `scramble` state: every agent must run to and anchor at a different station. The single agent unable to claim an open station becomes the new shepherd [gap-fill]. R7. **Station theft condition:** If the shepherd executes `anchor_stick(H_i)` on any `open` perimeter station Hi, the previous owner of Hi becomes the new shepherd immediately [gap-fill]. R8. **Round structure and match termination:** A match consists of M=10 rounds. Scoring tracks time spent as shepherd (least cumulative time wins) [gap-fill]. ## Edge cases - Tie at the end condition: not applicable — ranked by cumulative shepherd time; equal times broken by fewest times dispossessed. - A player with no legal move: not applicable — movement or anchor maintenance is always available. - Repetition / cycles: bounded by round tick cap Tmax⁡=600 ticks; if no goal or theft occurs within Tmax⁡, the puck is forcefully respawned near center. - Simultaneous claims on the same resource or position: during a scramble, if two agents attempt `anchor_stick(H_i)` on the same tick, the agent closer to Hi gets the station; if equidistant, resolved by lower agent ID. - Player elimination mid-round: not applicable — all players remain in game; roles transition dynamically. - Resource exhaustion: not applicable — fixed set of holes and 1 puck. - Termination guarantee: guaranteed by fixed round count M and maximum tick timeout per round Tmax⁡. ## State representation - Persistent state: station coordinates {H0,…,HK}, current role assignment (`shepherd_id`, defender IDs), cumulative shepherd time per agent, current round index. - Per-turn ephemeral state: puck position (xp,yp) and velocity (vx,vy), agent positions (xi,yi), station anchor statuses (`open` / `protected`), tick counter t. - Observable information: full public observability — positions of all agents, puck coordinates, velocity, and station occupancy are known to all agents. ## Action space - `maintain_anchor()`: keep stick firmly in current station. - `unanchor_and_move(direction)`: release station and move ≤1.0 units. - `move(direction)`: move ≤1.0 units across open field. - `strike_puck(power, target_angle)`: apply impulse to puck (power ∈[0,5], angle ∈[−π,π]). Precondition: distance to puck ≤1.5. - `anchor_stick(station_id)`: claim and lock station. Precondition: distance to Hi≤1.0, station is `open`. ## Playability notes - Single-player-vs-AI: natural — human plays as shepherd attempting to outsmart defender positioning, or as a station defender deciding optimal risk timing to strike incoming pucks. - Group games (n>4): seamlessly supports 4 to 10 agents. Reduction to 2 agents (1 shepherd vs 1 defender with 2 stations) preserves the risk-reward tradeoff of leaving a base to block. - Physical-skill games: stick dexterity and swinging accuracy abstracted into parameterized impulse physics and angular variance. - What is lost: physical contact between wooden sticks, dynamic footwork in dirt, and chaotic scrambling collisions. ## Implementation hints Medium complexity due to 2D continuous puck kinematics interacting with discrete station anchor states. First milestone: build the 2D arena with static station nodes, implement basic puck rolling/friction, and test the anchor/theft logic with stationary AI defenders.

Download as JSON

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

Download JSON
Cite this page

Herding the Pig (Pig Driving) (Latvia). (n.d.). Games of Countries. https://gamesofcountries.com/games/lv-latvia/cukas-ganisana

@misc{gamesofcountries-lv-latvia-cukas-ganisana,
  title = {Herding the Pig (Pig Driving) (Latvia)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/lv-latvia/cukas-ganisana}
}