Godot - Multiplayer (HTTP, HTTPS, WebSockets, WebRTC)

Published:

by Wayne Smith

Godot gaming engine supports multiplayer across systems. The video by Yannick (yandeu) of Geckos.io, (A Library using WebRTC for sending data over UDP) vs Websockets, provides a visual example of the differences in speed between WebSockets and WebRTC.

Godot http documentation

HTTP support for downloading large amounts of data, normally by requesting a JSON file for starting a scene. As well as getting graphics and other game resources. When the game starts the current status of the multiuser map, status, and new resources can all be downloaded.

Godot supports https peer to peer

For peer to peer networking equivant to http, Godot supports self signed SSL certificates.

Godot Websocket documentation

Web sockets provide the easiest method for a game to talk to the server and for data exchange. Websockets use TCP which takes a moment to connect and require communications to be acknowledged before they are considered sent.

Godot webRTC documentation

WebRTC provides the fastest method for a game to talk to the server or other players. WebRTC uses UDP when it can -- once a connection is established the data is sent and acted on without waiting for confirmation. To establish a connection between peers, (players), or a local system acting as a server for the game, information on what IP port and port can be used needs to be established, while the information to communicate with an online game server can be known ahead of time. And, the response is sent to the client port used to send a message to the server. The server can then send the message to the players. This is essentially the same thing as a webRTC media server used for streaming video.