While developing a multiplayer game in C++, I ran into an interesting problem: how should clients and servers communicate in a way that makes the meaning of each message explicit?
Most networking solutions focus on transporting data. But I wanted to explore a different question:
What if the communication model itself could describe the purpose of every message?
That question eventually led me to design INER, a semantic communication protocol based on four message types.
The idea behind INER
INER stands for:
- Intention: A client requests an action that may change the server's state.
- Notification: A client sends information without requesting a state change.
- Event: The server communicates something that has happened.
- Response: The server communicates the result of an intention.
The protocol defines two roles: Authority and Obedient.
The Authority controls the authoritative state, while the Obedient communicates with it through structured messages.
In a typical multiplayer game, the server acts as the Authority and the client acts as the Obedient.
A simple example
Imagine a multiplayer survival game.
A player wants to open a door.
Instead of sending a generic message, the client sends an Intention requesting that action.
The server validates the request and sends back a Response, indicating whether the action was approved, denied, partially approved, or failed.
If the door opens, the server can communicate that occurrence through an Event.
Now imagine the client wants to report information that does not request an authoritative state change. That can be expressed through a Notification.
These distinctions are simple, but they establish explicit responsibilities for each message.
What INER does not do
An important design decision was keeping the protocol independent of networking technology.
INER does not define:
- Sockets or connections
- TCP, UDP, or another transport
- Thread management
- Application update loops
It describes message semantics and their representation.
The networking implementation is a separate responsibility.
This separation lets me reason about communication independently of how messages are physically delivered.
From a protocol to a C++ library
I eventually implemented INER in LightnerX, an open-source C++ networking library built around Valve's GameNetworkingSockets.
LightnerX provides networking components, message interpretation, connection management, callbacks, and message batching.
But INER itself is a separate concept.
The protocol describes what messages mean. The library provides components for representing, interpreting, and transporting them.
Is this abstraction useful?
I'm still exploring the design and its tradeoffs.
Four explicit message categories provide structure, but they also introduce conventions that applications must follow.
I'm particularly interested in how other developers approach this problem.
- Do you distinguish action requests from informational messages in your networking architecture?
- Do you use a similar message classification system?
- Would you prefer this kind of semantic separation, or does it introduce unnecessary complexity?
I'd love to hear how other developers design their client-server communication.
GitHub: https://github.com/pietroth/LightnerX
This article was written with AI assistance and reviewed by the project author.
Top comments (0)