DeukPack Protocol (Messaging Runtime)¶
DeukPack Protocol is a high-performance binary serialization and intelligent message handling engine designed for communication between game servers, clients, and AI agents.
Core Values¶
1. High-Performance Serialization¶
DeukPack provides several to dozens of times faster serialization performance compared to existing general-purpose serializers.
- FastPacket Optimization: Minimizes GC pressure and copying using ArrayPool and buffer pooling techniques.
- Multi-Wire Support: Supports both Thrift-compatible (tbinary, tcompact) and DeukPack-native (pack, json) formats.
- Zero-Copy: Maximizes performance by returning views instead of copies during reading.
2. Intelligent Message Handling (Dispatching)¶
Provides a mechanism to handle thousands of packets without latency.
- O(1) Handler Mapping: Instantly maps packet IDs (msgId) to dedicated handlers via ProtocolRegistry.
- Automatic Code Generation: Automatically generates serialization code and handler interfaces from IDL declarations alone.
3. AI Data Guardrail¶
Ensures system integrity in environments where AI agents participate in communication. - Runtime Type Validation: Instantly validates whether unstable data generated by AI matches the IDL spec during serialization. - Deterministic State Guarantee: Forces the AI's variable output into DeukPack's deterministic schema.
Feature Comparison (Advantages over Protobuf)¶
| Category | DeukPack Protocol | Protobuf |
|---|---|---|
| Message Handling | msgId·ProtocolRegistry integration (O(1) dispatch) | Requires separate application-level implementation |
| Type Information | Runtime schema recovery via GetSchema() | Centered on reflection/descriptors, lacks tool integration |
| Meta Data | Direct link to game tables via MetaTableRegistry | Specialized for data messages, no table management system |
| Serialization | Mixed-IDL: Supports Thrift/Proto compatible formats | Strictly proprietary formats |
Feature Summary¶
| Category | Content |
|---|---|
| Wire (Compatible) | Thrift-compatible tbinary, tcompact, tjson (C#/C++/JS) |
| Wire (Native) | pack (tagged binary), json, yaml (Optimized for JS/Node) |
| Database | SQLite (DpSqliteProtocol) DDL and access code generation |
| Schema Meta | Field schemas, protocol type strings, Excel header integration |