Multiplayer connectivity problems

Discussion and feedback on Construct 2

Post » Thu Jul 24, 2014 9:22 am

Hello there,
@Ashley

today I tried to test the game with two devices on mobile networks (low bandwidth) and it was not possible to establish the connection. The host registered the peer, but didn't let it in.

I also noticed that it does not connect if the connection bandwidth is low even on wifi network, which previously worked with high bandwidth.

Does multiplayer object use this traversal standards to overcome NAT/Firewall issues:

Interactive Connectivity Establishment (ICE) – RFC 5245 http://tools.ietf.org/html/rfc5245
Session Traversal Utilities for NAT (STUN) - RFC 5389 http://tools.ietf.org/html/rfc5389
Traversal Using Relay NAT (TURN) - RFC 5766 http://tools.ietf.org/html/rfc5766

I just tried this WebRTC demo and it worked on all networks which I used (wi-fi at home and office, mobile, lan)
https://opentokrtc.com/

Also this instant messaging demo works on all my networks:
http://demo.easyrtc.com/demos/demo_inst ... aging.html

Looks like the current implementation of Multiplayer Plugin has some issues.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Thu Jul 24, 2014 10:43 am

WebRTC handles ICE, STUN and TURN internally. There is not much for us to add or change there. I've tested it and connected through with a Nexus 5 over both Wifi and HSPA+, but some network configurations (e.g. symmetric NAT) block peer-to-peer connections by their very design. This can be worked around in some cases such as with a TURN server (perhaps this is what the demo you said worked does), which you can host yourself and add to the multiplayer object using the 'Add ICE server' action. However connectivity issues largely stem from highly restrictive network configurations, or flakey workarounds to IPv4 exhaustion (IPv6 should improve the situation a lot). Without knowing more about your specific network setups it's hard to comment more, but anywhere without severe restrictions should connect through just fine.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,496

Post » Thu Jul 24, 2014 10:47 am

Thanks for the reply, I will try to setup a TURN server - hopefully it will help.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Thu Jul 24, 2014 11:00 am

@Ashley
Noob questions:

Here https://code.google.com/p/rfc5766-turn-server/ I found an open source STUN server by google:
https://code.google.com/p/rfc5766-turn-server/

If I set it up and connect with "Add ICE Server", will it work together with Multiplayer Plugin?

There's also a public STUN server provided by google: stun.l.google.com:19302
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Thu Jul 24, 2014 2:51 pm

Adding a STUN server won't help - the Multiplayer object has a built-in list of several public STUN servers, including the one you mentioned, and they all work the same. Only TURN servers help connections happen where they might otherwise not happen, and since they act as a relay you will have to pay the bandwidth cost of all data going through them (which is also why we don't host one and why there probably aren't any free public TURN servers out there). But if you add your own TURN server using that action, it should use it if it can't otherwise connect directly.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,496

Post » Thu Jul 24, 2014 3:25 pm

Good, bandwidth is not a problem.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Fri Aug 01, 2014 9:18 am

@Ashley
I installed the turn server and it's running, but in order to connect to it I have to specify username and password (credential). I can't find the way to do it in C2 events. There's only Add ICE server command. Can I add username and password to the "Add ICE server" string somehow?

I tried something like this, but it doesn't work: "turn:[email protected]<11.22.33.44>, credential:test"

So far I found this:

In your Javascript code where the RTCPeerConnection is created, reference the TURN server as follows:

var pc_config = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}, {"url":"turn:[email protected]<turn_server_ip_address>", "credential":"my_password"}]};
pc_new = new webkitRTCPeerConnection(pc_config);

Another question is, where should "Add ICE server" be useded: before On signalling connected or after
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Sun Aug 03, 2014 11:20 am

@Ashley
Is it right to add a TURN server in C2 like this:

js - {"url":"turn:[email protected]<turn_server_ip_address>", "credential":"my_password"}]};
C2 - "turn:[email protected]<turn_server_ip_address>,credential:my_password"

E.g. In multiplayer example where should the TURN server be added, before on signalling connected or after, or may be somwhere else?
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Sun Aug 03, 2014 3:01 pm

@xoros - could you please let me know if you get this working? I have the same issues.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Sun Aug 03, 2014 3:28 pm

@Tobye - sure, now I have to figure out how to properly add a TURN surver to C2 multiplayer. Currently my TURN server doesn't log anything by using this "turn:[email protected]<turn_server_ip_address>,credential:my_password"
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Next

Return to Construct 2 General

Who is online

Users browsing this forum: brupibo and 11 guests