Files
2nd/10_Wiki/Topics/4X_Strategy.md
T
Antigravity Agent f8b21af4be Wiki cleanup: error-doc removal, dedup merge, link normalization
10_Wiki/Topics 대규모 정리:
- 오류 캡처/미완성 stub 문서 227개 제거
- 교차폴더 중복 43클러스터 병합 (63파일 → redirect)
- 링크명 정규화: 깨진 링크 수정·redirect 직결·개념 매핑 ~2,400건
- 카테고리 MOC 6개 신규 생성
- Graph 섹션 미해결 related-keyword 링크 10,058건 제거

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 23:52:15 +09:00

5.2 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-4x-strategy 4X Strategy 10_Wiki/Topics verified self
4X 전략
eXplore eXpand eXploit eXterminate
none A 0.9 applied
gaming
strategy
game-design
ai
2026-05-10 pending
language framework
python gym/pettingzoo

4X Strategy

매 한 줄

"매 eXplore, eXpand, eXploit, eXterminate — 매 long-horizon empire-building loop." 매 1993 Master of Orion 의 Alan Emrich 가 coined. 매 Civilization, Stellaris, Endless Legend, Old World 의 cornerstone genre — 매 2026 에 AI agents 의 benchmark domain (Pyrrho, Civ-Bench).

매 핵심

매 4 pillars

  • eXplore: fog-of-war 의 map reveal, scout units, sensor range, anomaly detection.
  • eXpand: settler/colony placement, 영토 claim, infrastructure rollout.
  • eXploit: resource extraction, tech tree, trade routes, population growth.
  • eXterminate: military doctrine, alliance/diplomacy, conquest victory.

매 design tensions

  • Wide vs tall: many small cities vs few mega-cities.
  • Snowball vs catchup: 초기 lead 의 compound 의 X — 매 modern designs (Old World, Humankind) 의 catchup mechanics.
  • Turn-based vs RTS: Civ (TBS) · Stellaris (real-time pausable).

매 응용

  1. Multi-agent RL benchmark — 매 long horizon, partial observability, sparse reward.
  2. Game theory testbed — 매 negotiation, alliances, betrayal.
  3. Economic simulation — 매 supply chain, monetary policy.

💻 패턴

Civ-style turn loop

# Pseudocode of 4X turn structure
class Empire:
    def turn(self):
        self.explore()   # move scouts, reveal tiles
        self.expand()    # settle, build improvements
        self.exploit()   # collect yields, research, grow
        self.exterminate()  # military / diplomacy actions

def game_loop(empires, world):
    for turn in range(max_turns):
        for empire in empires:
            empire.turn()
        world.tick()  # natural events, barbarians
        if any(empire.victory() for empire in empires):
            return

Tile yield model

# Civ VI-style tile yields
def tile_yield(tile, improvements, adjacency):
    base = tile.terrain.yields  # food/production/gold
    base += sum(imp.bonus for imp in improvements)
    base += adjacency_bonus(tile, adjacency)
    return base * tile.modifier  # govt, religion, etc.

Tech tree (DAG)

import networkx as nx

tech = nx.DiGraph()
tech.add_edge("Pottery", "Writing")
tech.add_edge("Writing", "Currency")
tech.add_edge("Bronze Working", "Iron Working")

def available(researched):
    return [t for t in tech.nodes
            if t not in researched
            and all(p in researched for p in tech.predecessors(t))]

Combat resolution (Lanchester)

def lanchester_combat(att_strength, def_strength, terrain_mod):
    # Square law for ranged + simultaneous combat
    a, d = att_strength, def_strength * terrain_mod
    ratio = a / d
    att_loss = d**2 / (a + d)
    def_loss = a**2 / (a + d)
    return att_loss, def_loss

MCTS for 4X agent

# Minimal MCTS for turn decisions
def mcts(state, n_sims=1000):
    root = Node(state)
    for _ in range(n_sims):
        leaf = root.select()        # UCB1
        child = leaf.expand()
        reward = child.rollout()    # heuristic playout
        child.backprop(reward)
    return root.best_child().action

Diplomacy as repeated game

class Diplomat:
    def __init__(self):
        self.history = {}  # opponent -> [actions]

    def respond(self, opponent, their_action):
        # Tit-for-tat with forgiveness
        past = self.history.get(opponent, [])
        if not past or their_action == "cooperate":
            return "cooperate"
        return past[-1]  # mirror last

매 결정 기준

상황 Approach
Early game eXplore 우선 — map info 의 highest marginal value
Mid game eXpand + eXploit — economy snowball
Late game eXterminate or science/cultural victory
Tight map 매 tall play (few strong cities)
Open map 매 wide play (many cities)

기본값: 매 explore-first, 매 expand-until-economy-saturates, 매 specialize.

🔗 Graph

🤖 LLM 활용

언제: 매 narrative event generation, flavor text, 매 dynamic dialogue with diplomats. 언제 X: 매 hard rule resolution (combat math, yields) — 매 deterministic engine 사용.

안티패턴

  • Snowball lock-in: 매 early lead 의 unwinnable game — 매 catchup mechanics 의 추가.
  • Micromanagement hell: 매 50+ cities 의 manual ordering — 매 governors, automation.
  • Tech rush dominance: 매 single optimal path — 매 multiple viable trees 의 design.
  • Combat spam: 매 stack-of-doom — 매 1UPT or limited stacks.

🧪 검증 / 중복

  • Verified (Sid Meier 인터뷰, Master of Orion 1993 design notes).
  • 4X 전략 redirect.
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — FULL content with patterns, design tensions