Formal Specification
Peace on Earth (Hong Kong Paper-and-Pencil Battle Game) — Formal Specification
Hong Kong · board-abstract · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 4
# Tin Haa Taai Ping — AI-optimized specification
## General idea
A turn-based tactical fortress construction and artillery battle game based on Hong Kong *Tin Haa Taai Ping* (Peace on Earth). Two players duel via Rock-Paper-Scissors rounds, using victories to progress through a discrete tech tree (inscribing four fortress characters, erecting flags, raising concentric defense shields, and building artillery cannons) to systematically penetrate and destroy the opponent's base.
## Formal model
- **Abstraction taken:** None required. The paper-and-pencil drawing actions, tech-tree prerequisites, shield layers, and destruction hierarchy form a direct finite state machine.
- **Player/agent count:** 2 players (Player 0 and Player 1).
- **Turn model:** Simultaneous-decision rounds. Each round consists of: (1) simultaneous Rock-Paper-Scissors gesture submission, (2) round winner action selection (build, repair, or attack).
## Formal rules
R1. **Setup & Fortress Base:** Both players start with an empty fortress box. Infrastructure counters are initialized to zero: , , , .
R2. **Turn Initiation (Rock-Paper-Scissors):** Both players simultaneously submit .
- Ties () yield 0 action points; turn advances to next round.
- The winner earns 1 Action Point () to execute immediately; the loser takes no action.
R3. **Construction Phase & Prerequisites:**
- **Step 1 — Base Slogan (寫字):** Action `WRITE_CHAR` increments base characters (, spelling "天" "下" "太" "平"). Precondition: .
- **Step 2 — Flags (插旗):** Action `BUILD_FLAG` increments . Precondition: , .
- **Step 3 — Shields (保護罩):** Action `BUILD_SHIELD` increments . Precondition: , .
- **Step 4 — Weapons (造炮):** Action `BUILD_WEAPON` increments . Precondition: , .
R4. **Combat & Infiltration (開炮攻擊):**
- A player with may choose action `ATTACK` against the opponent.
- **Strict Penetration Order:** Damage penetrates the target's defenses inward in mandatory sequence:
1. If opponent : opponent .
2. Else if opponent : opponent .
3. Else if opponent : opponent .
4. Else: opponent .
R5. **Repairs (修復):** An attacked player may use winning action points to rebuild destroyed shields, flags, or weapons, provided prerequisite minimums are met.
R6. **Victory Condition:** The game terminates immediately when an opponent's base character count reaches after having reached full construction (or when all 4 characters are crossed out). The surviving fortress player wins.
R7. [gap-fill] Technology tree progression: Strict tier prerequisites requiring 4 Characters before Flags, Flag before Shields, and Shield before Weapons.
R8. [gap-fill] Structural capacity limits: Maximum 3 flags (), maximum 3 shields (), and maximum 3 weapons ().
R9. [gap-fill] Defensive barrier rule: An attacker cannot damage shields while enemy weapons exist, cannot damage flags while shields exist, and cannot damage base characters while flags exist.
R10. [gap-fill] Loop-breaking round limit: Maximum 100 RPS rounds (). If uncompleted, player with higher total surviving infrastructure points () wins; ties broken by sudden-death RPS rounds.
## Edge cases
- **Tie at the end condition:** Deterministically resolved by R10 (total infrastructure score, then sudden-death RPS).
- **A player with no legal move:** When winning an RPS round, an agent always has at least one valid action (either a build, repair, or attack option).
- **Repetition / cycles:** Symmetrical back-and-forth repairs and attacks are strictly bounded by R10's 100-round cap.
- **Simultaneous claims on the same resource or position:** RPS outcomes are mutually exclusive (one winner or draw); actions are executed sequentially per round winner.
- **Player elimination mid-round:** Not applicable (2-player duel).
- **Resource exhaustion:** Component capacities are bounded by finite maximums ().
- **Termination guarantee:** Guaranteed by absorbing defeat state ( under attack) and R10's 100-round terminal threshold.
## State representation
- **Persistent state:** `max_rounds: 100`, `tech_caps: {chars: 4, flags: 3, shields: 3, weapons: 3}`.
- **Per-player state:**
- `chars: int` ()
- `flags: int` ()
- `shields: int` ()
- `weapons: int` ()
- **Per-turn ephemeral state:**
- `round_number: int`
- `rps_moves: Tuple[str, str]`
- `round_winner: Optional[int]`
- `executed_action: Optional[str]`
- **Observable information:** Fully observable game state. Both players' paper drawings, fortress status, and move histories are public.
## Action space
- `play_rps(move)`: Parameters: `move in {ROCK, PAPER, SCISSORS}`. Preconditions: both players simultaneously.
- `write_char()`: Increments `chars`. Preconditions: RPS winner, `chars < 4`.
- `build_flag()`: Increments `flags`. Preconditions: RPS winner, `chars == 4`, `flags < 3`.
- `build_shield()`: Increments `shields`. Preconditions: RPS winner, `flags >= 1`, `shields < 3`.
- `build_weapon()`: Increments `weapons`. Preconditions: RPS winner, `shields >= 1`, `weapons < 3`.
- `attack()`: Damages opponent outer layer. Preconditions: RPS winner, `weapons >= 1`.
## Playability notes
- **Single-player-vs-AI:** Highly engine-ready. AI balances Rock-Paper-Scissors opponent modeling / pattern prediction with strategic decision-making on when to build extra shields vs rush weapons.
- **Group games (n>4):** Operates natively as a 1-on-1 duel. In group settings, tournament brackets or multi-base free-for-all variants apply.
- **Physical-skill games:** Pure paper-and-pencil strategic state machine; zero physical dexterity required.
- **What is lost in the adaptation:** Hand-drawn quirky doodles of tanks and laser cannons, pencil graphite smudges, and dramatic vocal sound effects ("PEW PEW!").
## Implementation hints
- Compact discrete state vector: `(chars_0, flags_0, shields_0, weapons_0, chars_1, flags_1, shields_1, weapons_1)`.
- Action resolution is a deterministic lookup once RPS winner is established.
- Branching factor: 3 RPS choices per turn; 1 to 5 action choices for the RPS winner.
- First milestone: Headless 2-player simulation verifying tech-tree unlock progression, damage penetration hierarchy, and game-over detection.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Tin Haa Taai Ping (Hong Kong). (n.d.). Games of Countries. https://gamesofcountries.com/games/hk-hong-kong/tin-haa-taai-ping
@misc{gamesofcountries-hk-hong-kong-tin-haa-taai-ping,
title = {Tin Haa Taai Ping (Hong Kong)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/hk-hong-kong/tin-haa-taai-ping}
}