Command Palette

Search for a command to run...

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

SS14 Netcode Architecture

БесплатноБез исполняемых скриптовНе проверен

Architecture guide for networking in Space Station 14 — Lidgren integration, NetManager abstraction, message system, game state synchronization, PVS, network…

makura-gamesот makura-games★ 74 звезды на GitHub

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

SS14 network architecture

Stack overview

The SS14 networking stack consists of several layers of abstraction, from low-level transport to game state synchronization logic:

┌─────────────────────────────────────────────┐
│ Content (game systems) │
│  RaiseNetworkEvent / ComponentState / Dirty  │
├─────────────────────────────────────────────┤
│         ServerGameStateManager              │
│         ClientGameStateManager              │
│         GameStateProcessor                  │
├─────────────────────────────────────────────┤
│              PVS System                     │
│ (filtering the visibility of entities) │
├─────────────────────────────────────────────┤
│       NetMessage / MsgState / MsgGroups     │
│ (typed messages with serialization)│
├─────────────────────────────────────────────┤
│            NetManager                       │
│ (wrapper over Lidgren, control │
│ channels, packet dispatch) │
├─────────────────────────────────────────────┤
│     Lidgren (NetPeer/NetServer/NetClient)   │
│          UDP + reliability layer            │
└─────────────────────────────────────────────┘

Lidgren: transport layer

SS14 uses the Lidgren library for UDP transport. The engine does not use Lidgren directly in the game code - all work is done through the INetManager and NetMessage abstractions.

Lidgren configuration

The engine configures Lidgren via CVars:

  • MTU - Maximum Transmission Unit. Packets larger than MTU are fragmented. Default ~1408 bytes
  • Simulation of network problems - for testing:
    • net.fakeloss — percentage of lost packets (0.0–1.0)
    • net.fakelagmin — minimum delay in seconds
    • net.fakelagrand - random additional delay
    • net.fakeduplicates — chance of packet duplication
  • Buffers — net.sendbuffersize, net.receivebuffersize
  • AppIdentifier - string to identify the protocol (via CVars.NetLidgrenAppIdentifier)

Time synchronization

When initialized, the engine synchronizes NetTime Lidgren with its own RealTime:

NetTime.SetNow(_timing.RealTime.TotalSeconds);

This is critical for packet timings to work correctly.

NetMessage: typed message system

All network messages are inherited from the abstract class NetMessage.

Message groups (MsgGroups)

Each message belongs to a group that determines the default delivery method:

Group Delivery Destination
Core ReliableUnordered Connections, disconnections, ticks
Entity Unreliable Game state synchronization
String ReliableOrdered Chat, text messages
Command ReliableUnordered Commands client → server
EntityEvent ReliableOrdered ECS events between server and client

Lidgren delivery methods

  • Unreliable - no guarantee of delivery, no order. The fastest
  • ReliableUnordered — delivery guarantee, without order guarantee
  • ReliableOrdered - guarantee of delivery and order (within the sequence channel)

Sequence Channels

Lidgren supports up to 32 channels for ordered messages. Channels 16+ are reserved for internal engine needs. Messages in different channels are ordered independently.

Registration and processing

// Registering a message with a handler
_networkManager.RegisterNetMessage<MsgStateAck>(HandleStateAck);

// Registration without handler (for sending only)
_networkManager.RegisterNetMessage<MsgState>();

NetManager: network management

NetManager is the central point of the network subsystem. It implements both interfaces: IClientNetManager and IServerNetManager.

Main processing cycle

The ProcessPackets() method is called every frame and does:

  1. Reads all incoming messages from Lidgren peers
  2. Classifies by NetIncomingMessageType:
    • Data → deserializes to NetMessage, calls the registered callback
    • StatusChanged → handles connections/disconnections
    • VerboseDebugMessage, WarningMessage, ErrorMessage → logs
  3. Updates Prometheus metrics (sent/received packets, bytes, resends)
  4. Recycles used Lidgren buffers

StringTable

To save traffic, message type names are passed as numeric IDs via StringTable. When connecting, the server and client synchronize the mapping table.

Channels (NetChannel)

Each connection is represented by NetChannel, which stores:

  • Lidgren NetConnection
  • User ID (NetUserId)
  • Ping
  • Authentication status

Synchronizing the game state (GameState)

GameState structure

GameState — a snapshot of the game state at a specific tick. Contains:

  • EntityStates — changed states of entity components
  • PlayerStates — player session states
  • EntityDeletions — deleted entities
  • FromSequence / ToSequence — tick range (delta state)
  • LastProcessedInput — the last client input processed by the server

Delta states

The server sends the delta between two ticks, rather than the full state each time. `FromSequen

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

Установить SS14 Netcode Architecture в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл SS14 Netcode Architecture?

Architecture guide for networking in Space Station 14 — Lidgren integration, NetManager abstraction, message system, game state synchronization, PVS, network events, and component networking

Как установить скилл SS14 Netcode Architecture?

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

Скилл SS14 Netcode Architecture запускает скрипты?

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

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

Сравнить SS14 Netcode Architecture с