Formal Specification
Portuguese Sack Race — Formal Specification
Portugal · strength-endurance · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: abstractedGap-fills: 4
# Corrida de Sacos — AI-optimized specification
## General idea
A simultaneous-tick sprint race along a 20-meter track where agents balance forward hopping velocity against tripping risk. Each tick, agents choose a hopping intensity; higher intensities achieve greater forward displacement but carry higher probabilities of stumbling, which incurs recovery time penalties.
## Formal model
- **Abstraction taken:** Two-legged constrained jumping is modeled as a 1D position progression `x(t)` with stochastic step displacement and an intensity-dependent tripping probability.
- **Player/agent count:** 2 agents (1v1 match).
- **Turn model:** Simultaneous tick-based progression (`dt = 1` tick, max 40 ticks).
## Formal rules
R1. Setup: Track length `L = 20.0m`. Both agents start at position `x = 0.0`. Finish line at `x >= 20.0`. State per agent includes `position: float`, `stun_ticks: int (initially 0)`.
R2. On each tick `t`, if `stun_ticks == 0`, an agent selects an effort mode:
- `CAUTIOUS_HOP`: `displacement ~ N(0.8m, 0.1m)`, trip probability `P(trip) = 0.02`.
- `NORMAL_HOP`: `displacement ~ N(1.3m, 0.2m)`, trip probability `P(trip) = 0.10` [gap-fill].
- `POWER_HOP`: `displacement ~ N(1.9m, 0.3m)`, trip probability `P(trip) = 0.25` [gap-fill].
R3. Stumble Resolution:
- If trip occurs: `displacement = 0.0m`, and the agent incurs `stun_ticks = 2` (must spend 2 full ticks getting back up and stabilizing inside the sack [gap-fill]).
- If no trip: `position(t + 1) = position(t) + max(0.0, displacement)`.
R4. Recovery: If an agent starts a tick with `stun_ticks > 0`, they take no displacement action and decrement `stun_ticks = stun_ticks - 1`.
R5. Win condition: The first agent to cross `x >= 20.0` wins.
R6. Tiebreaker: If both agents cross `x >= 20.0` on the exact same tick, the agent with the strictly greater final position wins [gap-fill]. If tied to within 0.01m, a 10m tiebreaker sprint is executed.
## Edge cases
- Tie at the end condition: Resolved by comparing final displacement past 20.0m on the crossing tick; if equal within 1cm, a 10m runoff is run.
- A player with no legal move: Not applicable; choosing a hopping mode or recovering from stun is deterministic.
- Repetition / cycles: Bounded by max 40 ticks; position is monotonically non-decreasing.
- Simultaneous claims on the same resource or position: Agents run in parallel lanes; no physical collision penalties.
- Player elimination mid-round: If an agent disconnects, the remaining agent finishes the sprint.
- Resource exhaustion (pieces, tokens, space, time): Hard cap of 40 ticks ensures finite horizon.
- Termination guarantee: Monotonically increasing position with positive expected advance (`E[dx] > 0.8m/tick`) guarantees crossing within ~15–25 ticks.
## State representation
- Persistent state: `track_length: float = 20.0`, `race_tick: int`.
- Per-agent state: `position: float`, `stun_ticks: int`, `has_finished: bool`.
- Minimal observable information: Fully observable public track state.
## Action space
- `hop(mode: Enum)`: where `mode in {CAUTIOUS_HOP, NORMAL_HOP, POWER_HOP}`.
## Playability notes
- Single-player-vs-AI: Engine-ready. Highly dynamic push-your-luck racing against AI pace.
- Group games (n>4): Extends trivially to n agents running parallel lane simulations.
- Physical-skill games: Constrained jumping balance modeled as a risk-reward push-your-luck probability trade-off.
- What is lost in the adaptation: Burlap friction, foot cramping, and the chaotic spectacle of faceplants.
## Implementation hints
Extremely simple 1D state array. Suggested milestone 1: Implement the tick loop with 3 hopping modes and stumble recovery, and verify race termination within 20 ticks.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Portuguese Sack Race (Portugal). (n.d.). Games of Countries. https://gamesofcountries.com/games/pt-portugal/corrida-de-sacos
@misc{gamesofcountries-pt-portugal-corrida-de-sacos,
title = {Portuguese Sack Race (Portugal)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/pt-portugal/corrida-de-sacos}
}