Multiplayer signalling and TURN server ?

  • I've tried the Multiplayer object and it works quite well, but it fails to make connections (signalling) on mobile data. From what I've read, probably I reached a NAT which blocks the connection.

    Not only that, but some networks block P2P so a solution is a TURN server. From what I get, the TURN server acts as the middleman and all communications go trough it (instead of P2P). Is that correct ?

    Is there any way to skip the signalling, or get the host address sent trough a text/link ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can run your own TURN server if you're willing to configure it and pay the bandwidth bills. If you have one, you can tell Multiplayer to use it with the "Add ICE server" action before connecting. Then your connection success rate should be close to 100%.

  • Ashley Thank you for reply, but I still have some questions:

    1. If I use "Add ICE server" action, the Multiplayer plugin will automatically choose the TURN server (even if P2P is supported) ?

    2. Can you recommend a tutorial for a TURN server that can work with C2/C3 ?

    3. Can a TURN server be installed on a cheap VPS host ?

    4. Is there any advantage to use the Multiplayer plugin with TURN server instead of events and WebSocket server ?

  • 1: no, the turn server is if everything else fails and a connection between the two players cannot be established

    2: Debian has a turn server package now so it should be fairly straightforward to look into the package'S help on the Debian website

    3: Yes (also consider turn server service providers so you don'T have to pay for a cheap VPS in multiple countries and end up paying a fortune every month)

    4: You don'T have to pay for the bandwidth of your peer to peer games,

    you don'T need a server unlike webcoskets, this means that with webRTC players can communicate directly with the game's host with low latency, and all of your game host game logic can be implemented in construct. If you were to use websockets as a relay between your players and host you have to pass through the server twice drastically increasing the latency in your game. If you don'T write your server code then good luck implementing server game logic.

    webRTC allows for multiple data-channels both reliable and unreliable, whereas web-sockets are reliable only, it's easy to implement and there are multiple construct tutorials and documentation available and also users in the community with experience that can help you

    turn server are cheaper than websockets server since all they do is relay data, they don,T have to run server code

    note: nothing stops you from using both, such as using websockets for global chat or game invites or whatever and keeping webrtc for game room data

  • yoyoEleanor Thank you for the detailed responses. Indeed, WebRTC looks better suited for this job (when it works).

    I have another question: For what is used INSTANCE_NAME when connecting to the signalling server ?

  • You can have multiple rooms with the same name like "level10" and they might have different populations so you can choose to either auto-join or join a specific instance like the instance your friend is in

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)