Formal Specification
Driving the Pig — Formal Specification
Lithuania · stick-team · Confidence: low
← Back to game pageImplementation Suitability
Suitability: adaptation-requiredFidelity: discretizedGap-fills: 10
# Kiaulės varymas — AI-optimized specification
## General idea
Kiaulės varymas is an asymmetric territory-defense, stick-handling, and goal-driving game played on a circular ring of holes surrounding a central goal depression. One designated herder attempts to strike a wooden block (the "pig") into the central hole or steal an unguarded perimeter hole with their stick, while perimeter defenders must balance the risk of leaving their protective hole to intercept the rolling pig against the threat of immediate dispossession.
## Formal model
- **Abstraction taken:** Discretized. Continuous 2D terrain is modeled as a circular spatial layout consisting of a center hole at and perimeter holes distributed evenly at radius [gap-fill]. Ballistic motion of the "pig" is modeled via 2D velocity vectors with ground friction damping [gap-fill]. Stick occupancy of each hole is maintained as an explicit discrete state variable.
- **Player/agent count:** agents (): 1 active herder () and defenders ().
- **Turn model:** Real-time ticked simulation () [gap-fill]. All agents submit movement and stick striking actions simultaneously each tick.
## Formal rules
R1. Setup:
- perimeter holes are placed at positions where .
- Each defender is assigned to hole with stick status `in_hole = true`.
- The "pig" projectile begins at initial position [gap-fill] with .
- Herder starts inside the circle with `in_hole = false`.
R2. Pig Physics and Movement:
- Each tick, , and with friction [gap-fill].
R3. Action Types:
- `move(target_pos)`: Translate agent position at speed .
- `strike_pig(impulse_vector)`: Apply impulse to the pig (valid only if ). Executing this action forces `in_hole = false`.
- `guard_hole(hole_id)`: Maintain stick contact in specified hole (valid only if ).
- `claim_vacant_hole(hole_id)`: Thrust stick into an unoccupied perimeter hole (`occupant = None`).
R4. Perimeter Hole Capture:
- If a defender leaves hole (`in_hole = false`) to strike the pig, hole becomes vacant.
- If the herder successfully executes `claim_vacant_hole(H_k)`, role transfer occurs immediately: becomes the new herder, becomes the defender of , and the sub-round resets [gap-fill].
R5. Sinking the Pig (Central Goal):
- If the pig enters the central hole depression ( with ), the goal triggers ("Kiaulė dvare!").
- Goal Scramble Phase: All perimeter hole assignments are wiped (`in_hole = false` for all agents). All agents race to claim the perimeter holes. The single agent who fails to secure a hole is assigned as the herder for the subsequent round.
R6. Prohibited Contacts: Kicking the pig with feet, blocking the pig with body mass, or striking opponent sticks/shins is penalized by an immediate free strike for the offended party [gap-fill].
R7. Match Limit: The game terminates after goal resets or a maximum duration of ticks per round [gap-fill].
## Edge cases
- Tie at the end condition: In the scramble phase, if two agents attempt `claim_vacant_hole(H_k)` on the exact same tick, the agent with closer geometric distance claims the hole; ties broken uniformly at random [gap-fill].
- A player with no legal move: Not applicable — `move()` and `guard_hole()` are always valid actions.
- Repetition / cycles (and the loop-breaking rule): Defenders perpetually turtling in their holes without striking are forced into action by the herder's unimpeded ability to roll the pig directly into , triggering the mandatory scramble phase.
- Simultaneous claims on the same resource or position: Perimeter holes have discrete capacity 1; exclusive access is resolved by arrival timestamp / distance priority.
- Player elimination mid-round; turn order repair: Not applicable — all players remain active across all rounds, rotating between herder and defender roles.
- Resource exhaustion (pieces, tokens, space, time): Round terminates in an automatic scramble reset if ticks [gap-fill].
- Termination guarantee: Guaranteed by the finite match round ceiling and round tick timer .
## State representation
- Persistent state: Agent count , active herder ID, cumulative herder-duration counters per agent, completed goal count.
- Per-turn ephemeral state: Agent positions , stick states (`in_hole` booleans), perimeter hole occupancy table , pig coordinates and velocity , active scramble flag.
- Observable information: Fully observable — all agent coordinates, hole states, and pig velocities are visible to all participants.
## Action space
- `move(x, y)`: Move toward coordinate target.
- `strike_pig(vx, vy)`: Strike the projectile toward a target trajectory.
- `guard_hole(hole_id)`: Anchor stick securely in assigned hole.
- `claim_vacant_hole(hole_id)`: Insert stick into an empty perimeter hole.
## Playability notes
- Single-player-vs-AI: Highly engaging — human can play as the lone herder maneuvering the ball and baiting AI defenders out of position, or as a defender coordinating perimeter protection.
- Group games (n>4): Natively designed for 5–15 players; reduction to 2 agents (1 herder, 1 defender, 1 perimeter hole, 1 center hole) functions mechanically as an intense 1v1 duel.
- Physical-skill games: Stick swings, ball rolling angles, and sprint reactions are abstracted into velocity vectors and radius-based reach checks.
- What is lost: The visceral thrill of stick clashes, chaotic shouter banter, and the physical dash to jam a stick into a dirt divot are replaced by collision logic.
## Implementation hints
Spatial geometry requires a 2D continuous canvas or high-resolution grid with circle collision queries for the center hole and perimeter holes.
First milestone: Build the single-hole defense and stick-claiming mechanic (R3–R4) before implementing the multi-agent scramble phase.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Driving the Pig (Lithuania). (n.d.). Games of Countries. https://gamesofcountries.com/games/lt-lithuania/kiaules-varymas
@misc{gamesofcountries-lt-lithuania-kiaules-varymas,
title = {Driving the Pig (Lithuania)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/lt-lithuania/kiaules-varymas}
}