Formal Specification
Over the Roof — Formal Specification
Iceland · ball-team · Confidence: low
← Back to game pageImplementation Suitability
Suitability: adaptation-requiredFidelity: discretizedGap-fills: 5
# Yfir — AI-optimized specification
## General idea
A traditional Icelandic outdoor ball game played across an opaque roof or building (barn, shed, or garage) with zero line of sight between two teams. One team throws a ball blindly over the roof ridge shouting "Yfir!"; if the receiving team catches the ball on the fly before it hits the ground, they launch a stealth ambush, sprinting around both ends of the building to tag or pelt opposing players with the ball, absorbing struck opponents permanently into their team until one side captures all players.
## Formal model
- **Abstraction taken:** Continuous rooftop ball physics, acoustics, and building corner navigation are discretized into a 2-sided topology (Side A and Side B connected by Left Corner and Right Corner corridors) with hidden information across the central roof obstruction. Player movement, fly catches, and ambush tags are resolved via discrete time-ticks and stochastic accuracy checks. [gap-fill] Corner corridor lengths, tagging probabilities, and round limits formalize domestic playground rules.
- **Player/agent count:** 2 teams (initially 4 agents each, total ; team sizes vary dynamically as players are captured).
- **Turn model:** Alternating rooftop throw phases with real-time ticked simultaneous movement during ambush phases.
## Formal rules
R1. Setup: The environment consists of two opposite sides (Side A and Side B) separated by an opaque roof barrier. Two corner transit paths (Left Corridor and Right Corridor) connect Side A and Side B, requiring ticks to traverse [gap-fill]. Initially, Team A occupies Side A and Team B occupies Side B.
R2. The Rooftop Throw: The active throwing team chooses a thrower who tosses the ball over the roof ridge, broadcasting the public call "Yfir!".
- Throw resolution:
- . If the throw fails to clear the roof, the ball rolls back to the thrower's side, and the throw must be retried.
- If the ball clears the roof, it rolls down the opposite side onto the receiving territory, taking ticks to reach ground level.
R3. Receiving Resolution:
- While the ball is in flight, receiving agents on the opposite side attempt an interception. Probability of catching the ball before ground contact: .
- **Bounce (Missed Catch):** If no agent catches the ball on the fly, the ball touches the ground on the receiving side. The receiving team picks up the ball and immediately executes a return throw over the roof per R2.
- **Fly Catch (*Gripið á lofti*):** If an agent catches the ball in the air, the catch is kept silent (no public notification to the throwing team). The game instantly transitions to Phase 4 (The Ambush).
R4. The Ambush (*Umsátrið*):
- Upon a fly catch, receiving agents immediately allocate routes to sprint around the building via Left Corridor or Right Corridor. One agent holds the ball (or executes a stealth handoff).
- The throwing team receives no notification until receiving agents emerge from the corridors onto their side (or after a sensory delay of 2 ticks [gap-fill]).
- The throwing team must scramble and flee through the corner corridors toward the opposite side to achieve safety.
- The ball carrier may throw the ball at any fleeing opponent within line of sight: .
R5. Player Conversion (*Liðaskipti*):
- Any throwing-team agent struck by the ball before reaching the opposite safe side is captured and permanently transferred to the receiving team's roster.
- If the ball carrier throws and misses all targets, the ball becomes dead.
- All surviving players from both teams regroup on opposite sides of the building for the next round.
R6. Victory Condition:
- A team wins immediately when it captures all players, reducing the opposing team to 0 players.
- [gap-fill] If neither team captures all players within **20 rounds**, the team with the larger roster wins; if rosters are tied, one sudden-death round is played.
## Edge cases
- Tie at the end condition: Handled in R6; if rosters are equal at round 20, sudden-death rounds continue until a conversion breaks the tie [gap-fill].
- A player with no legal move: Not applicable — throwing and moving actions are always available.
- Repetition / cycles: Continuous non-catch bounce exchanges are bounded by the non-zero fly-catch probability () on every throw, combined with the R6 20-round limit.
- Simultaneous claims on the same resource or position: In the ambush phase, corner corridors permit bidirectional movement; collisions or simultaneous passes are resolved in deterministic order (ball carrier actions take precedence).
- Player elimination mid-round; turn order repair: Players are not eliminated from the game; they switch team rosters, dynamically adjusting and while conserving total population ().
- Resource exhaustion: One ball in play; player count is constant and strictly conserved.
- Termination guarantee: Guaranteed by the absorbing states and in a finite Markov chain with positive transition probabilities, capped by the R6 round ceiling.
## State representation
- Persistent state:
- `roster_team_A`: list of agent IDs.
- `roster_team_B`: list of agent IDs.
- `round_number`: integer `[1..20]`.
- `active_throwing_side`: `{SIDE_A, SIDE_B}`.
- Per-round ephemeral state:
- `ball_location`: `{SIDE_A, OVER_ROOF, SIDE_B, IN_TRANSIT_CORRIDOR}`.
- `fly_catch_occurred`: boolean.
- `ball_carrier_id`: agent ID.
- `agent_positions`: map `{agent_id: {SIDE_A, SIDE_B, LEFT_CORRIDOR, RIGHT_CORRIDOR}}`.
- Observable information:
- Imperfect information: Team on Side A cannot observe positions, catches, or ball carrier identity on Side B until agents emerge into shared line-of-sight in corridor exits.
## Action space
- Throwing phase: `throw_over_roof(power, angle)`.
- Ambush phase (Attackers): `sprint_corridor(corridor_id)`, `pass_ball(teammate_id)`, `throw_tag(target_agent_id)`.
- Ambush phase (Defenders): `flee_corridor(corridor_id)`, `evade_tag()`.
## Playability notes
- Single-player-vs-AI: Natural — human commands one team or controls an individual player navigating hidden information and auditory cues.
- Group games (n>4): Reduces smoothly to 2v2 (1 thrower, 1 runner per side) without loss of ambush dynamics.
- Physical-skill games: High rooftop throws, fly catching, and ball-tag accuracy are abstracted into scalar attribute checks.
- What is lost in the adaptation: The authentic auditory tension of listening to the scuff of the ball rolling down tin/turf roofs and the adrenaline of sudden physical corner ambushes are translated into line-of-sight visibility states.
## Implementation hints
- Model the map as two large nodes (`SIDE_A`, `SIDE_B`) connected by two directional transit edges (`CORRIDOR_L`, `CORRIDOR_R`) with delay weights.
- Ambush phase can be implemented as a short 10-tick discrete event simulation.
- Suggested first milestone: implement R2 (roof throw/bounce loop), R3 (fly catch check), and R5 (simple player transfer on tag).
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Over the Roof (Iceland). (n.d.). Games of Countries. https://gamesofcountries.com/games/is-iceland/yfir
@misc{gamesofcountries-is-iceland-yfir,
title = {Over the Roof (Iceland)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/is-iceland/yfir}
}