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 폴더 제거.
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
---
|
||||
id: wiki-2026-0508-micro-management
|
||||
title: Micro-management (RTS)
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Micro, RTS Micro, Unit Micro, StarCraft Micro]
|
||||
duplicate_of: none
|
||||
source_trust_level: B
|
||||
confidence_score: 0.85
|
||||
verification_status: applied
|
||||
tags: [game-design, rts, ai, alphastar, reinforcement-learning, starcraft, esports]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack: { language: python, framework: pysc2|sc2|gymnasium }
|
||||
---
|
||||
|
||||
# Micro-management (RTS)
|
||||
|
||||
> 한 줄: RTS에서 개별 유닛을 정밀 컨트롤(이동·공격·스킬)해 전투력을 극대화하는 행위 — APM·반응 속도·상황 인지의 종합. AlphaStar가 인간 상위 0.2%를 돌파한 RL 벤치마크.
|
||||
|
||||
## 핵심
|
||||
- **Macro vs Micro**: macro = 경제·생산·확장, micro = 유닛 컨트롤. 프로는 둘 다.
|
||||
- **APM**: Actions Per Minute. 인간 프로 200-400, AlphaStar 비공식 cap 280 (인간 수준 제한).
|
||||
- **핵심 기술**: focus fire, kiting (stutter step), spreading (스플래시 회피), flanking, target priority, 시거리 활용.
|
||||
- **AI 벤치마크**: SC2 (DeepMind PySC2/AlphaStar), Dota 2 (OpenAI Five), Honor of Kings (JueWu) — long-horizon, partial observation, multi-agent의 종합 시험대.
|
||||
- **현대 RL**: self-play + league training (AlphaStar), PPO/IMPALA, large-scale distributed.
|
||||
|
||||
## 결정 기준
|
||||
| 목표 | 접근 |
|
||||
|---|---|
|
||||
| RTS AI 학습 환경 | PySC2 (SC2), microRTS (가벼움), Stratagus |
|
||||
| 단순 micro 봇 | 스크립트 + finite state machine |
|
||||
| 강화학습 | PPO + LSTM/transformer policy |
|
||||
| 멀티 유닛 협동 | MARL (QMIX, MAPPO) |
|
||||
| 모방 학습 시작 | Replay 데이터 → behavior cloning |
|
||||
| 대규모 학습 | League / population-based training |
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### PySC2 minimal agent
|
||||
```python
|
||||
from pysc2.agents import base_agent
|
||||
from pysc2.lib import actions, features
|
||||
|
||||
class MicroAgent(base_agent.BaseAgent):
|
||||
def step(self, obs):
|
||||
super().step(obs)
|
||||
marines = [u for u in obs.observation.feature_units
|
||||
if u.unit_type == features.PlayerRelative.SELF and u.alliance == 1]
|
||||
if not marines: return actions.FUNCTIONS.no_op()
|
||||
target = pick_lowest_hp_enemy(obs)
|
||||
if target is not None:
|
||||
return actions.FUNCTIONS.Attack_screen("now", [target.x, target.y])
|
||||
return actions.FUNCTIONS.no_op()
|
||||
```
|
||||
|
||||
### Kiting (stutter step) 의사 코드
|
||||
```python
|
||||
def stutter_step(unit, enemy):
|
||||
if unit.weapon_ready:
|
||||
return Action.attack(enemy)
|
||||
if dist(unit, enemy) < unit.range and enemy.range > unit.range:
|
||||
return Action.move(away_from(enemy))
|
||||
return Action.move(toward(enemy)) # close gap
|
||||
```
|
||||
|
||||
### Focus fire (target priority)
|
||||
```python
|
||||
def focus_target(my_units, enemies):
|
||||
# threat = damage * speed / hp_remaining
|
||||
return min(enemies, key=lambda e: e.hp / max(e.threat, 1))
|
||||
```
|
||||
|
||||
### PPO with PySC2 (sketch)
|
||||
```python
|
||||
import gymnasium as gym
|
||||
from stable_baselines3 import PPO
|
||||
env = gym.make("SC2MoveToBeacon-v0") # 단순 micro env
|
||||
model = PPO("MultiInputPolicy", env, n_steps=2048, batch_size=64,
|
||||
learning_rate=3e-4, gamma=0.99, verbose=1)
|
||||
model.learn(total_timesteps=2_000_000)
|
||||
```
|
||||
|
||||
### League training 개념 (AlphaStar)
|
||||
```python
|
||||
# Main agents + Main exploiters + League exploiters; PFSP matchmaking
|
||||
# Prioritized Fictitious Self-Play: 약한 상대일수록 자주 매칭하지 않음
|
||||
```
|
||||
|
||||
### Replay-based behavior cloning
|
||||
```python
|
||||
# 1) replay parse → (state, action) pairs
|
||||
# 2) supervised cross-entropy on actions
|
||||
# 3) RL fine-tune from BC checkpoint (jumpstart RL exploration)
|
||||
```
|
||||
|
||||
## 🔗 Graph
|
||||
- 상위: [[Reinforcement-Learning]]
|
||||
- 관련: [[PPO]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
- 게임 디자인 토론(LLM brainstorm): 새 유닛 micro skill 설계, 카운터 분석.
|
||||
- 코드 어시스트: PySC2 보일러플레이트, replay parser.
|
||||
- LLM 단독으로 RTS 플레이는 비현실적 (실시간·연속 액션 부적합) — RL과 결합.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **APM만 추구** — 의미 없는 클릭 (spam). EPM (effective APM)이 중요.
|
||||
- **모든 유닛 attack-move** — 마이크로 포기. 부대 분리·focus fire·kiting 조합.
|
||||
- **RL 환경에서 sparse reward만** — 학습 안 됨. shaping (kill, hp 차이) + curriculum.
|
||||
- **single-agent로 multi-unit RTS 학습** — 정책 collapse. 적절한 abstraction (군 단위) 또는 MARL.
|
||||
- **AlphaStar 재현 시도 with 작은 GPU** — 수만 TPU-day 필요. microRTS·SMAC 같은 축소 환경부터.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- 중복 후보 없음.
|
||||
- 검증: 표준 task — MoveToBeacon, CollectMineralShards, DefeatRoaches (PySC2 mini-games)·SMAC 시나리오 win-rate.
|
||||
|
||||
## 🕓 Changelog
|
||||
- 2026-05-08 | Phase 1 — 자동 시드.
|
||||
- 2026-05-10 | Manual cleanup — PySC2/PPO/league 패턴, kiting 의사코드, RL 안티패턴 정리.
|
||||
Reference in New Issue
Block a user