interest-management
Use when the user asks about interest management, area of interest, network relevancy, network culling, replication priority or observer sets in multiplayer…
от j4flmao★ 47 звёзд на GitHub
Установить interest-management в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Interest Management — Deep Engineering Guide
Purpose
Nobody needs everything. A 100-player battle server could broadcast 6 MB/s to everyone — unviable. Interest management (IM) decides who gets what, at what rate, with the least CPU — turning O(players²) broadcast into near-O(visible) traffic.
Agent Protocol
Trigger
"interest management", "area of interest", "relevancy", "network culling", "replication priority", "observer set".
Input Context
- Player and entity counts, world size
- Bandwidth budget per client
- Existing replication system
Output Artifact
Interest/priority design and code. No file unless requested.
Response Format
Relevancy: {grid | radius | PVS}
Budget: {bytes/s per client}
Priority: {formula}
Code: {snippet}
1. The Two Sides of the Problem
- State replication — entity position/hp/anim may repeat at different rates.
- Event delivery — spell casts, deaths, pickups happen once, must be reliable.
IM solves state (per-entity rate, per-observer mask). Events live in a separate reliable queue (see references/event-queue.md).
2. The Interest Model
observer O (a client)
interest(O) = { entities E : dist(O,E) <= radius && comesFrom(visibility(O,E)) && O.state needs }
Two classic models:
| Model | Idea | Cost |
|---|---|---|
| Spatial (distance/relevance) | entities within radius get replicated | cheap; dumb (sees through walls) |
| Visibility/occlusion | only what O's camera/query can see | accurate; more compute |
| Hybrid (recommended) | spatial first, then per-entity relevance mask | standard |
2.1 The Relevance Mask
Each entity has a bitmask of actor channels (movement, HP, items, emotes). Each observer subscribes to channels; IM intersects: interest = entitiesNear(O) ∩ channels(O) ∩ channels(E).
Per-channel update rates may differ (see §5), so a snapshot packet = union of per-channel deltas.
3. Spatial Messaging (Quad/Grid/Hash)
- Use a spatial hash of entity AABBs for O(1) per-observer "who's near me":
- grid cell 32–64 m; rebuild chunk when movement > 1 cell.
- Query = O's cell + neighbors (radius-dependent).
- Add a cheap occlusion pre-step: sphere-vs-frustum first when cameras matter (see
game-engine/math-foundationcollision refs).
4. Observer Sets & Recompute Caching
Recomputing all interests every frame is wasteful. Cache:
- Static scopes (the room/level a player is in) — compute once at join; update only on teleport/room-change.
- Dynamic scopes: recompute on movement threshold (moved > N units or tick recency) + on cast/aggro events.
scopeCache[O] = {lastRecomputeTick, recomputeThreshold}
if E moved out of O's radius → remove
if E entered radius and channel matches → add
5. Per-Channel Rate Limiting (Detail LOD)
Different data needs different frequencies:
| Channel | Rate | Why |
|---|---|---|
| movement | 30–60 Hz | smoothness |
| HP/mana | 10–20 Hz | low change |
| items/emote | 4–10 Hz | occasional |
| spell effects (critical) | reliable + on-event | must-arrive |
Cost trick: detail reduces with distance (network LOD): entity at 200 m → movement 10 Hz, no HP, no inventory; at 10 m → full rate. This is the network analog of render LOD (see scaling-architecture).
6. The Entity Queue & Dirty Flags
Server per-observer maintains:
dirtyIds(entities changed since last send to that observer).replicatedmap (entityId → last sent tick or channel version).
Send loop per observer:
for id in valueSet(interestedIntersection dirty):
send delta bytes for changed channels (quantized)
Complexity ≈ O(|interest(O)|) per observer, per tick — a per-observer packet builder that stops early on a byte budget (see skills/game/game-server/authoritative-server/references/world-state-snapshot.md budgets).
7. Reliability Split (State vs Events)
| Type | Transport | Policy |
|---|---|---|
| replicated state (transform, hp) | unreliable (UDP) | latest wins; loss = just staler |
| events (kill, spawn, loot) | reliable (UDP+ACK) | must arrive once, in order |
Never put rare-events on the lossy channel (missed "you won" = rage). Events go through the event queue with an ACK list; on disconnect, replay the unACKed.
8. Fizzling & Aggregation Under Budget
If a snapshot would exceed the per-observer byte budget:
- Drop lowest-priority channels first (emote → items → HP).
- Coarsen quantization for distant entities (e.g. fewer position bits).
- Never drop movement below minimum playable (lag fairness).
9. Interest vs Server Tick Cost Model
| Metric | Budget |
|---|---|
| interest recompute | amortized per movement, not per tick |
| per-observer send loop | < 0.05 ms |
| memory for scope cache | ≤ a few MB |
| packet bytes/clients | the real cost — [interest solves the multiplier] |
If the world is huge (open MMO), shard by region rather than interest-only (a view r
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/budgeting-and-prioritization.md
- references/event-queue.md
- references/network-lod.md
- references/observer-sets.md
- references/state-vs-event-replication.md
- references/visibility-and-spatial.md
FAQ
Что делает скилл interest-management?
Use when the user asks about interest management, area of interest, network relevancy, network culling, replication priority or observer sets in multiplayer games. Produces visibility, priority and bandwidth budgeting design. Not for rendering culling (use render-graph) or matchmaking (use matchmaking-lobby).
Как установить скилл interest-management?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл interest-management запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…