New-space-openenv / plugins /cicero /diplomacy_constants.py
Mooizz's picture
Upload folder using huggingface_hub
1070765 verified
"""Diplomacy game constants from the canonical spec.
Used by Cicero plugin for step generation. Not config β€” these are fixed game rules.
"""
from __future__ import annotations
# ─── Powers (7 Great Powers) ──────────────────────────────────────────
POWERS = [
"England",
"France",
"Germany",
"Italy",
"Austria-Hungary",
"Russia",
"Turkey",
]
# ─── Phases per year ──────────────────────────────────────────────────
PHASES = [
"Spring Diplomacy",
"Spring Movement",
"Spring Retreat",
"Fall Diplomacy",
"Fall Movement",
"Fall Retreat",
"Winter Adjustment",
]
# Phases where negotiation happens (before orders)
NEGOTIATION_PHASES = ["Spring Diplomacy", "Fall Diplomacy"]
# ─── Years (game starts 1901) ──────────────────────────────────────────
DEFAULT_YEAR_RANGE = (1901, 1905) # inclusive
# ─── Run defaults (no config) ──────────────────────────────────────────
NUM_STEPS = 5
# ─── Key regions for negotiation context ───────────────────────────────
# Strategic inland provinces (armies only)
INLAND_REGIONS = [
"Bohemia",
"Budapest",
"Galicia",
"Moscow",
"Munich",
"Serbia",
"Ukraine",
"Vienna",
"Warsaw",
]
# Strategic coastal provinces (armies + fleets)
COASTAL_REGIONS = [
"Constantinople",
"London",
"Paris",
"Berlin",
"Rome",
"Bulgaria",
"Rumania",
"St. Petersburg",
"Naples",
]
# Key sea zones
SEA_REGIONS = [
"North Sea",
"English Channel",
"Mediterranean",
"Black Sea",
"Baltic Sea",
]
# All regions for random selection (inland + coastal + sea)
ALL_REGIONS = INLAND_REGIONS + COASTAL_REGIONS + SEA_REGIONS
# ─── Supply centers (34 total) ─────────────────────────────────────────
HOME_SCS: dict[str, list[str]] = {
"England": ["London", "Edinburgh", "Liverpool"],
"France": ["Paris", "Marseilles", "Brest"],
"Germany": ["Berlin", "Munich", "Kiel"],
"Italy": ["Rome", "Venice", "Naples"],
"Austria-Hungary": ["Vienna", "Budapest", "Trieste"],
"Russia": ["Moscow", "St. Petersburg", "Warsaw", "Sevastopol"],
"Turkey": ["Constantinople", "Ankara", "Smyrna"],
}
NEUTRAL_SCS = [
"Norway",
"Sweden",
"Denmark",
"Holland",
"Belgium",
"Spain",
"Portugal",
"Tunis",
"Serbia",
"Greece",
"Romania",
"Bulgaria",
]
# ─── Negotiation domains (topics for LLM prompts) ───────────────────────
NEGOTIATION_DOMAINS: list[tuple[str, str]] = [
("alliance_negotiation", "proposing or renewing an alliance for mutual support"),
("move_coordination", "coordinating army/fleet moves for the coming season"),
("supply_center_deal", "negotiating who gets which Supply Center or territory"),
("support_request", "asking for support on a specific move or defense"),
("threat_assessment", "discussing a rival power's moves or a potential stab"),
]
# ─── Game context string for LLM system prompt ─────────────────────────
GAME_CONTEXT = """
Diplomacy is a strategic board game set in 1914 Europe. 7 players, 34 supply centers, 18 to win.
Powers: England, France, Germany, Italy, Austria-Hungary, Russia, Turkey.
Board: 75 provinces (22 inland, 14 coastal, 19 sea). Units: Army (A), Fleet (F).
Phases: Spring/Fall (Diplomacy β†’ Movement β†’ Retreat), Winter Adjustment.
All orders are simultaneous; negotiation happens before each movement phase.
Key regions: Vienna, Warsaw, Moscow, Constantinople, London, Paris, Berlin, Rome, Serbia, Bulgaria, Galicia, Ukraine.
""".strip()