Formal Specification
Walnut Game — Formal Specification
Bulgaria · gambling-stake · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: probabilistic-proxyGap-fills: 3
# Igra na orehi — AI-optimized specification
## General idea
A turn-based spatial staking and target-collision game. Players contribute physical walnut tokens into a bounded 2D target circle and execute continuous force/angle shots using a designated shooter token to disperse the cluster across boundary perimeters. Successful extractions grant token ownership and immediate turn extensions.
## Formal model
- **Abstraction taken:** The 2D physical collision of irregular spheroids (walnuts) is abstracted into a 2D elastic collision model with radial scatter vectors parameterized by shot accuracy, projectile mass, and cluster density.
- **Player/agent count:** players ().
- **Turn model:** Sequential turn rotation with conditional continuation on successful capture.
## Formal rules
R1. Setup:
- Target circle has center with radius metres ( m). Baseline is at .
- Each player stakes walnuts (). Total pot walnuts are placed inside the circle in a clustered configuration.
R2. Turn Order:
- Each player submits a distance calibration throw toward baseline . Player with minimum landing error shoots first, followed in ascending order of error.
R3. Shooting Action:
- Active player submits shot vector from current shooter position (initial throw from baseline ).
- [gap-fill] Shooter trajectory ends at .
R4. Collision and Scatter Resolution:
- For each remaining walnut in the circle, if , walnut receives impulse .
- New position: .
- Extraction check: If , walnut has exited the circle and is captured by the active player (added to player's bank ).
R5. Turn Continuation:
- If count of captured walnuts in current shot :
- Active player collects captured nuts.
- Active player retains turn and shoots next shot from current resting position (or from baseline if exited the arena).
- If : Turn ends immediately; turn passes to next player in sequence .
R6. [gap-fill] Turn Runout Cap: An active player may execute at most 5 consecutive shots in a single turn to ensure fair rotation among all participants.
R7. Victory Condition:
- Game terminates immediately when all staked walnuts have been cleared from the target circle ().
- The player with the highest accumulated walnut count wins the pot.
R8. [gap-fill] Tiebreaker: If multiple players tie for most captured walnuts, tied players execute one sudden-death shot at a single target nut; closest displacement wins.
## Edge cases
- Tie at the end condition: Resolved by R8 sudden-death target throw.
- A player with no legal move: Not applicable — shooting action is always available while walnuts remain in the pot.
- Repetition / cycles: Bounded: The number of remaining target walnuts is strictly non-increasing and monotonically decrements toward 0; each shot with 0 captures forces a turn pass.
- Simultaneous claims on the same resource or position: Turns are strictly sequential; exact token IDs are tracked and removed from the active circle upon capture.
- Player elimination mid-round; turn order repair: If a player disconnects, their bank remains fixed; turn skips disconnected player ID in sequence.
- Resource exhaustion: Target pot decrements to exactly 0, triggering game termination R7.
- Termination guarantee: Enforced by finite pot , mandatory turn pass on miss (R5), and runout cap (R6).
## State representation
- Persistent state: Player bank counts , active player index , shooter coordinates.
- Per-turn ephemeral state: Array of remaining walnut positions , consecutive hit counter, current shot vector.
- Observable information: Fully observable — all token positions, boundaries, and player bank totals are public knowledge.
## Action space
- `shoot_cluster(angle, force)`: Precondition: Caller is active player, pot has remaining walnuts ().
## Playability notes
- Single-player-vs-AI: Natural — Human plays vs 1..7 AI agents with parameterized physical shot accuracy and aim selection logic.
- Group games (n>4): Fully scalable; rotation order seamlessly supports up to 8 players.
- Physical-skill games: Accuracy modeled via 2D normal distribution with variance determined by agent `accuracy` attribute; collision impulse modeled via basic 2D elastic vector mathematics.
- What is lost: The tactile surface friction of cobblestones vs dirt and the distinct shell weight of individual walnuts are abstracted into uniform physics parameters.
## Implementation hints
Low complexity. The 2D collision resolution can be implemented with simple radial impulse vectors pushing nearby points outward from the impact center. Suggested first milestone: implement the circle extraction check and verify that random shots reliably clear the pot within a bounded number of turns.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Walnut Game (Bulgaria). (n.d.). Games of Countries. https://gamesofcountries.com/games/bg-bulgaria/igra-na-orehi
@misc{gamesofcountries-bg-bulgaria-igra-na-orehi,
title = {Walnut Game (Bulgaria)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/bg-bulgaria/igra-na-orehi}
}