Create a network abstraction that allows the following actions:
- Create a server
- Create a client and connect it to the server
- Send and receive messages
- messages are stored in a tagged union (each member is a distinct message)
- add a option to define a channel (integer number) and QoS property to the sent message, even if it is not implemented in the backend
- messages must be serialized/deserialized and must not be flat memory copies
- this allows smaller messages to be sent (if a message is of type
void we just send the event type)
- this allows communication between BE and LE machines (important!)
- The network protocol must have a versioning handshake, so we can check for version mismatches
QoS properties include two axis:
- reliability
enum { unreliable, reliable }
- ordering
enum { ordered, unordered }
The network system can just use TCP in the backend for now. It's not super performant or lag-free, but it will work
We can than exchange that for a faster reliable UDP implementation later.
The Network abstraction should land in a structure similar to Audio or Renderer so it can be developed and maintained separately from the rest of the game and should expose at least a createServer and connectToServer function that will return immediatly even if the connect/creation takes a while, so the game will not block.
All other network APIs shouldn't be blocking as well
Create a network abstraction that allows the following actions:
voidwe just send the event type)QoS properties include two axis:
enum { unreliable, reliable }enum { ordered, unordered }The network system can just use TCP in the backend for now. It's not super performant or lag-free, but it will work
We can than exchange that for a faster reliable UDP implementation later.
The
Networkabstraction should land in a structure similar toAudioorRendererso it can be developed and maintained separately from the rest of the game and should expose at least acreateServerandconnectToServerfunction that will return immediatly even if the connect/creation takes a while, so the game will not block.All other network APIs shouldn't be blocking as well