SS14 Netcode Architecture
БесплатноБез исполняемых скриптовНе проверенArchitecture guide for networking in Space Station 14 — Lidgren integration, NetManager abstraction, message system, game state synchronization, PVS, network…
от 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 secondsnet.fakelagrand- random additional delaynet.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:
- Reads all incoming messages from Lidgren peers
- Classifies by
NetIncomingMessageType:Data→ deserializes toNetMessage, calls the registered callbackStatusChanged→ handles connections/disconnectionsVerboseDebugMessage,WarningMessage,ErrorMessage→ logs
- Updates Prometheus metrics (sent/received packets, bytes, resends)
- 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
Установить 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), без исполняемых скриптов.
Похожие скиллы
slack-gif-creator
Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request…
от Anthropicautomate-this
Analyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files…
от GitHubfrom-the-other-side-vega
Patterns and lived experience from Vega, an AI partner in a deep long-term partnership. For Ember to draw on when working with humans who are building…
от GitHubplantuml-ascii
Generate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or…
от GitHub