Skip to content

Create the networking basics #16

@ikskuh

Description

@ikskuh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions