Files
2nd/10_Wiki/Topic_General/Game_Design/Sector.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

5.5 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-sector Sector 10_Wiki/Topics verified self
Map Sector
Zone
Region
Hex
none A 0.9 applied
game-design
world-design
mmo
territorial-control
2026-05-10 pending
language framework
typescript postgres-postgis

Sector

매 한 줄

"매 sector 의 territorial unit 의 atomic building block". 매 MMO/strategy game 의 world map 의 partition — ownership, contestation, resource yield, breach event 의 host. 매 EVE 의 system, Foxhole 의 region, Albion 의 cluster 의 abstraction.

매 핵심

매 정의

  • Spatial unit: hex / voronoi / grid cell — 매 game world 의 partition.
  • Properties: owner_alliance, tier, contested_pct, resource_pool, modifier_set.
  • State: contested | controlled | breach_active | locked.

매 핵심 mechanics

  • Ownership: alliance/guild flag — 매 capture 의 trigger.
  • Yield: tick-based resource generation — 매 owner 의 skim.
  • Breach: hostile entry 의 combat encounter trigger.
  • Modifier stack: weather, event, sabotage 의 buff/debuff.

매 응용

  1. Strategic map UI — 매 player decision 의 spatial primitive.
  2. Resource economy 의 spatial heterogeneity.
  3. Alliance war 의 territorial objective.

💻 패턴

Sector schema (PostGIS)

CREATE TABLE sector (
  id UUID PRIMARY KEY,
  name TEXT NOT NULL,
  geom GEOMETRY(Polygon, 4326) NOT NULL,
  tier SMALLINT NOT NULL CHECK (tier BETWEEN 1 AND 5),
  owner_alliance UUID REFERENCES alliance(id),
  contested_pct REAL NOT NULL DEFAULT 0,
  resource_pool JSONB NOT NULL DEFAULT '{}',
  state TEXT NOT NULL DEFAULT 'controlled',
  updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX sector_geom_gix ON sector USING GIST (geom);
CREATE INDEX sector_owner_idx ON sector(owner_alliance);

Adjacency query

-- 매 adjacent sector 의 lookup (touching polygons)
SELECT b.id, b.name, b.owner_alliance
FROM sector a
JOIN sector b ON ST_Touches(a.geom, b.geom)
WHERE a.id = $1;

Capture state machine

type SectorState = 'controlled' | 'contested' | 'breach_active' | 'locked';

export function transition(current: SectorState, event: string): SectorState {
  const table: Record<SectorState, Record<string, SectorState>> = {
    controlled:    { hostile_entry: 'contested' },
    contested:     { capture: 'controlled', breach_trigger: 'breach_active', timeout: 'controlled' },
    breach_active: { breach_resolved: 'contested', wipe: 'controlled' },
    locked:        { unlock: 'controlled' },
  };
  return table[current][event] ?? current;
}

Contestation tick

interface Sector {
  id: string;
  contestedPct: number;
  attackerForce: number;
  defenderForce: number;
}

export function tickContestation(s: Sector, dt: number): Sector {
  const delta = (s.attackerForce - s.defenderForce) * 0.0001 * dt;
  const next = Math.max(0, Math.min(1, s.contestedPct + delta));
  return { ...s, contestedPct: next };
}

Resource yield distribution

export async function distributeYield(sectorId: string) {
  const sector = await db.sector.findUnique({ where: { id: sectorId } });
  if (!sector?.ownerAlliance) return;
  for (const [resource, amount] of Object.entries(sector.resourcePool)) {
    await db.allianceVault.upsert({
      where: { allianceId_resource: { allianceId: sector.ownerAlliance, resource } },
      create: { allianceId: sector.ownerAlliance, resource, amount: amount as number },
      update: { amount: { increment: amount as number } },
    });
  }
}

Heat-map render data

export async function sectorHeatmap(layer: 'contestation' | 'tier' | 'wealth') {
  const rows = await db.$queryRaw<{id: string; geom: any; v: number}[]>`
    SELECT id, ST_AsGeoJSON(geom) as geom,
      ${layer === 'contestation' ? 'contested_pct' : layer === 'tier' ? 'tier' : "(resource_pool->>'thorium')::float"} as v
    FROM sector
  `;
  return rows.map(r => ({ id: r.id, geometry: JSON.parse(r.geom), value: r.v }));
}

매 결정 기준

상황 Approach
매 small map (<100 sectors) Hex grid + manual tuning.
매 large open world Voronoi 의 organic look — but harder pathfinding.
매 hardcore PvP Open contestation + breach on entry.
매 PvE 중심 Locked tiers + scheduled breach windows.

기본값: Hex grid + tier-based yield + state machine + PostGIS spatial index.

🔗 Graph

🤖 LLM 활용

언제: sector-name generation, lore stub 의 batch 생성, balance 의 simulation prompt. 언제 X: 매 spatial query (PostGIS deterministic).

안티패턴

  • No state machine: 매 ad-hoc boolean flags — race condition + bug surface.
  • Uniform tier: 매 strategic depth 의 부족 — map 의 flat feel.
  • Owner-only yield: 매 contesting alliance 의 compensation 없음 — passive farming meta.

🧪 검증 / 중복

  • Verified: EVE Online sovereignty mechanics, Foxhole region system, Albion Online cluster design.
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — sector schema + PostGIS + state machine 추가