Skip to content

Multiplayer Protocols

Tom Richardson edited this page Aug 12, 2017 · 2 revisions

From Clients (i.e. not master/host client):

Protocol Name Description
ClientConnectionRegisterMessage When a client first connects to a server, it sends this message to tell the server it's name. The server should then respond with HostConnectionConfirmMessage followed by several other messages to sync the entire game state. (TODO work on complete game state syncing), after all game syncing messages are sent and otherr clients are told of the new client, the server will sent a HostPlayReadyMessage to indicate the new client is ready to go. Alternatively the server could respond with HostDisconnectMessage (e.g. because the server is full)
ClientPlayerUpdatePositionMessage Tells the server this client's player's position. This state is checked against the master, if the state is fine then the new position will be broadcast to all but the origin client (the sending client should assume their movement succeeded). In the case of a failure, the master will broadcast the true position of the client to all, which the origin client can then process and correct itself.

To Clients:

Protocol Name Description
HostNewPlayerMessage Sent to clients to inform them of a new client (the client then spawns a player from the given id)
HostExistingPlayerMessage Sent to new clients informing them of existing clients, (the client doesn't spawn the Player entities from this.)
HostDisconnectMessage Sent to new clients if their connection is refused. With a message attached
HostPlayReadyMessage Sent to new clients if all syncing messages was sent, and they are ready to start playing
HostConnectionConfirmMessage Sent to new clients to provide them with their connection ID, and to confirm that they successfully connected and should start receiving sync data
HostEntityCreationMessage Creates a new entity. Sent to all clients (except master) with an entity and an ID attached
HostEntityDestroyMessage Destroys an existing entity. Sent to all clients (except master) with an ID attached
HostEntityUpdatePositionMessage Updates the position of an existing entity. Sent to all clients (except master) with x, y and an ID attached
HostEntityUpdateProgressMessage Updates the progress of an entity that implements the HasProgress interface. Sent to all clients (except master) with an integer value and ID attached

Gameplay

Design

Asset Creation

User Testing

Code Guidelines


http://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gif

Clone this wiki locally