-
Notifications
You must be signed in to change notification settings - Fork 6
Multiplayer
This guide will provide you the foundations of Server Controllers to enable you to develop multiplayer games
The Server Controller nodes are useful for sending information from a server to a client seamlessly.
- 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
- Value
- The value received from the client
- Servers provide a host server to which clients may connect and may send and receive messages
- Clients may join any host server and may send and receive messages
- Server
- Value:
1.0
- Host:
0.0.0.0
- Port:
1000
- Received Value:
0.0
- Value:
- Client
- Value:
0.0
- Host:
0.0.0.0
- Port:
1000
- Received Value:
1.0
- Value:
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:
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