Formal Specification
Herding the Pig (Pig Driving) — Formal Specification
Latvia · stick-team · Confidence: low
← Back to game pageImplementation 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 (the pig pen) and radial perimeter station nodes located at radius . 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 perimeter defenders ().
- **Turn model:** Synchronous discrete-time simulation ticks (e.g. 1 tick = 0.25 s).
## Formal rules
R1. **Topology setup:** Central node at . perimeter stations arranged uniformly along circle of radius units [gap-fill].
R2. **Initial state:** Each defender occupies station with stick status `anchored`. The shepherd starts at . The puck starts at a random perimeter spawn point 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 is `protected` if and only if an agent is within distance and executes `anchor_stick(H_i)`. While vacant or unanchored, is `open`.
R5. **Puck dynamics and striking:**
- Striking the puck requires agent distance to puck units.
- Resulting puck velocity where [gap-fill].
- Puck decelerates by friction coefficient per tick [gap-fill].
R6. **Central goal condition:** If puck distance to with speed below capture threshold , 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 , the previous owner of becomes the new shepherd immediately [gap-fill].
R8. **Round structure and match termination:** A match consists of 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 ticks; if no goal or theft occurs within , 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 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 and maximum tick timeout per round .
## State representation
- Persistent state: station coordinates , current role assignment (`shepherd_id`, defender IDs), cumulative shepherd time per agent, current round index.
- Per-turn ephemeral state: puck position and velocity , agent positions , station anchor statuses (`open` / `protected`), tick counter .
- 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 units.
- `move(direction)`: move units across open field.
- `strike_puck(power, target_angle)`: apply impulse to puck (power , angle ). Precondition: distance to puck .
- `anchor_stick(station_id)`: claim and lock station. Precondition: distance to , 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 JSONCite 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}
}