Command Palette

Search for a command to run...

Назад к скиллам
скилл № 26888

authoritative-server

Use when the user asks about an authoritative game server, dedicated server, server tick loop, snapshots, input authority, server reconciliation, rollback or…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить authoritative-server в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Authoritative Server — Deep Engineering Guide

Purpose

The server is the single source of truth. Clients only intend; the server decides. This skill covers the server tick loop, world-state serialization, input authority, reconciliation/rollback, lag compensation and session/connection management that make online games correct, cheat-resistant and smooth under real network loss.

Agent Protocol

Trigger

"authoritative server", "server tick loop", "server reconciliation", "lag compensation", "dedicated server", "input authority".

Input Context

  • Genre, player count, tick rate target
  • Engine/language of server
  • Hosting model

Output Artifact

Server loop design and code. No file unless requested.

Response Format

Tick: {Hz}
Loop: {receive -> simulate -> snapshot -> send}
Authority: {what server validates}
Code: {snippet}

1. Why Authoritative

  • Clients are untrusted: a modified client shouldn't teleport, duplicate items, or confirm kills it didn't earn.
  • Server-authority = the only place where state can be validated + validated state is shared.
client sends INPUT (intent)        → net
server runs sim (authoritative)    → sim decides
server sends SNAPSHOT (state)      → net
client renders (interpolated)      → visual

1.1 The Trust Boundary

Decided by Where
Compile-time rules, rules engine (damage, physics) server
Cosmetic-only (VFX transform, emote) client
Compromise (authoritative with client prediction) server + prediction

Pick: full authoritative (server runs everything; client is dumb viewer) vs client-predicted (client predicts its own move; server reconciles) vs client-side prediction + server rollback (fast action games). All start from "server is truth".

2. Server-Side Simulation Can't Afford a Game-Loop Problem

2.1 Fixed Timestep

  • Server tick: fixed 30–64 Hz (30 for strategy, 60 for aimful shooters; 128 for esports aimers).
  • Derive the tick count from an accumulator over a monotonic clock (see game-loop-and-timestep), then sleep until the next tick deadline instead of spinning; never scale gameplay by the measured frame time.
// server main loop:
tick = 0;
while (running) {
    dtFromWallClock = now - last;
    accumulator += dtFromWallClock;
    while (accumulator >= TICK_MS) {
        SimulateTick(tick);         // deterministic, fixed dt
        accumulator -= TICK_MS;
        tick++;
    }
    netOutputs[ticksToSend].Flush();
}

2.2 Deterministic Sim

The server sim must be deterministic given a seed: with lockstep-grade discipline (see multiplayer-netcode and skills/game/game-engine/ecs-pattern/references/ecs-netcode.md) so replay, spec or tests reproduce identically. No fast-math, no wall-clock, no rand() global.

  • RNG: per-entity/instance seeded, tick-advanced — reproducible.
  • Physics stepping: fixed dt = stable.

3. Input Authority & The Input Pipeline

client: sample input → serialized command {tick, seq, buttons, aim} → UDP
server: collect per-tick input, run queued commands, apply at tick boundary, optionally re-sim (rollback)

Key properties:

  • Tick-stamped commands: each command carries the client tick it was generated for; the server buffers a small amount (a jitter buffer of 1-3 ticks) and applies it at that tick, dropping commands that arrive too late.
  • Input history buffer on server: replay recent inputs if a rolled-back tick needs them.
  • Client command throttling: cap commands/second; server drops excess (anti-abuse).

3.1 Client Prediction ↔ Server Reconciliation

  • Client predicts its own motion (renders its projection).
  • Server reconciles the actual authoritative value each tick; client corrects only if the mismatch exceeds a tolerance (e.g. a few cm of position error), and smooths small corrections over several frames.
  • Tolerance + extrapolation clipping prevent wild rubber-banding (see rollback-and-reconciliation.md).

4. World-State Snapshot Serialization

Server serializes deltas, not full state:

Approach Cost Use
Full state large lobbies, tiny games, keyframes
Delta (since last ack) efficient standard
Interest-gated masks minimal open world (see interest-management skill)

Snapshot minimal components:

  • matchId, tick, seq, per-entity: {entityId, flags, bits...}.
  • Compressed position: quantized to a fixed grid (e.g. int16/int32 at 1 cm), sent as deltas against the acked baseline.
  • Entities unchanged since last snapshot: omitted (per-entity dirty flags).

See multiplayer-netcode for engine-level replication formats.

5. Reconciliation, Rollback & Lag Compensation

5.1 Rollback (Fighters, Fast Games)

Client predicts; server re-sims when input ran in the wrong order (delayed arrival). Server stores the last N-tick state frames; on late arrival re-runs tick with the corrected input:

server ke
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/connection-and-session.md
  • references/input-authority.md
  • references/lag-compensation.md
  • references/rollback-and-reconciliation.md
  • references/tick-loop.md
  • references/world-state-snapshot.md

FAQ

Что делает скилл authoritative-server?

Use when the user asks about an authoritative game server, dedicated server, server tick loop, snapshots, input authority, server reconciliation, rollback or lag compensation on the server. Produces tick loop and world-state design. Not for client-side prediction (use multiplayer-netcode) or fleet scaling (use scaling-architecture).

Как установить скилл authoritative-server?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл authoritative-server запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить authoritative-server с