Skip to content

Multiplayer

Underpig edited this page May 25, 2020 · 2 revisions

Multiplayer

This guide will provide you the foundations of Server Controllers to enable you to develop multiplayer games

Server Controllers

The Server Controller nodes are useful for sending information from a server to a client seamlessly.

Inputs:
  • Value
    • The value to send
  • Host
    • The IP address of the host server
    • Host and port remain the same for both server and clients
    • When left blank, it will connect to any IP address on the port on the local network
  • Port
    • The port through which to send
  • Type (Server, Client)
    • The type of the controller
Outputs:
  • Value
    • The value received from the client

Server

  • Servers provide a host server to which clients may connect and may send and receive messages

Client

  • Clients may join any host server and may send and receive messages

Example

  • Server
    • Value: 1.0
    • Host: 0.0.0.0
    • Port: 1000
    • Received Value: 0.0
  • Client
    • Value: 0.0
    • Host: 0.0.0.0
    • Port: 1000
    • Received Value: 1.0

Multiplayer Servers

While developing for multiplayer can be difficult, Server Controllers and other associated nodes can assist in production. Foundations for multiplayer often consist of rooms for connection, associating players to their respective rooms, and communicating between devices in a timely fashion. Server Controllers can also communicate between programs. An example may exist as follows:

Servers This program moves the object to the mouse's x-position in each respective computer. It sends the mouse's computer through the network. Currently, multiplayer is only supported on local networks, but configuration of the router can enable cross-network multiplayer.

  • Checks if the server is active
  • If the server is inactive, it initializes the server
  • If the server is active, it joins the server
  • Sends the mouse's x-position to their respective connected computers
  • Reads the connected computer's mouse's x-position and sets the object's transform