Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

synchronization-algorithms

БесплатноЗапускает вложенные скриптыНе проверен

Network synchronization, lag compensation, client prediction, and state consistency for responsive multiplayer games.

pluginagentmarketplaceот pluginagentmarketplace★ 60 звёзд на GitHub9 установок в других каталогах

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

Multiplayer Synchronization

Synchronization Techniques

┌─────────────────────────────────────────────────────────────┐
│                    SYNC TECHNIQUES OVERVIEW                  │
├─────────────────────────────────────────────────────────────┤
│  CLIENT PREDICTION:                                          │
│  → Execute input locally before server confirms             │
│  → Feels responsive, requires reconciliation               │
│  Best for: FPS, action games                                │
├─────────────────────────────────────────────────────────────┤
│  INTERPOLATION:                                              │
│  → Display positions between known states                   │
│  → Smooth visuals, adds latency                            │
│  Best for: Other players, NPCs                              │
├─────────────────────────────────────────────────────────────┤
│  ROLLBACK NETCODE:                                           │
│  → Rewind game state on correction                          │
│  → Re-simulate with corrected data                          │
│  Best for: Fighting games, precise timing                   │
├─────────────────────────────────────────────────────────────┤
│  LOCKSTEP:                                                   │
│  → All clients advance together                             │
│  → Deterministic, waits for slowest                        │
│  Best for: RTS, turn-based                                  │
└─────────────────────────────────────────────────────────────┘

Client Prediction & Reconciliation

PREDICTION FLOW:
┌─────────────────────────────────────────────────────────────┐
│  Frame N:                                                    │
│  1. Capture input                                           │
│  2. Predict result locally (immediate response)            │
│  3. Store input + predicted state                          │
│  4. Send input to server                                   │
│                                                              │
│  Frame N+RTT:                                                │
│  5. Receive server state for Frame N                       │
│  6. Compare with stored prediction                         │
│  7. If mismatch: RECONCILE                                 │
│     a. Snap to server state                                │
│     b. Re-apply all inputs since Frame N                   │
│     c. Smooth correction to avoid visual pop               │
└─────────────────────────────────────────────────────────────┘
// ✅ Production-Ready: Prediction Buffer
public class PredictionBuffer
{
    private const int BUFFER_SIZE = 128;
    private readonly PredictionEntry[] _buffer = new PredictionEntry[BUFFER_SIZE];

    public void Store(uint tick, InputPayload input, PlayerState predictedState)
    {
        int index = (int)(tick % BUFFER_SIZE);
        _buffer[index] = new PredictionEntry
        {
            Tick = tick,
            Input = input,
            PredictedState = predictedState
        };
    }

    public void Reconcile(uint serverTick, PlayerState serverState)
    {
        int index = (int)(serverTick % BUFFER_SIZE);
        var entry = _buffer[index];

        if (entry.Tick != serverTick) return; // Stale data

        float error = Vector3.Distance(entry.PredictedState.Position, serverState.Position);
        if (error < 0.01f) return; // Within tolerance

        // Misprediction detected - reconcile
        PlayerState currentState = serverState;

        // Re-simulate all inputs since server tick
        for (uint t = serverTick + 1; t <= CurrentTick; t++)
        {
            int idx = (int)(t % BUFFER_SIZE);
            if (_buffer[idx].Tick == t)
            {
                currentState = SimulateInput(currentState, _buffer[idx].Input);
            }
        }

        // Apply corrected state (with smoothing)
        ApplyCorrectedState(currentState);
    }
}

Interpolation

INTERPOLATION BUFFER:
┌─────────────────────────────────────────────────────────────┐
│  RECEIVE: [State T-100ms] [State T-50ms] [State T-now]     │
│                                                              │
│  RENDER: Display interpolated position between T-100ms      │
│          and T-50ms based on current render time           │
│                                                              │
│  WHY: Always have two states to interpolate between        │
│       (render behind real-time by buffer amount)           │
│                                                              │
│  BUFFER SIZE:                                                │
│  • Too small: Choppy when packets delayed                  │
│  • Too large: Everything feels delayed                     │
│  • Typical: 100-200ms for other players                    │
└─────────────────────────────────────────────────────────────┘

Rollback Netcode

ROLLBACK FLOW (Fighting Games):
┌──────────────────────
Полный SKILL.md на GitHub

Установить synchronization-algorithms в Claude Code и Claude Desktop

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

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

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

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

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

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

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

assets/sync_config.yamlreferences/SYNC_GUIDE.mdscripts/sync_helper.py

FAQ

Что делает скилл synchronization-algorithms?

Network synchronization, lag compensation, client prediction, and state consistency for responsive multiplayer games.

Как установить скилл synchronization-algorithms?

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

Скилл synchronization-algorithms запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить synchronization-algorithms с