How do I test multiplayer ?

Get help using Construct 2

Post » Wed Mar 09, 2016 1:51 pm

Hello Community,
I'm using the MultiplayerSystem in my new game and I'm struggling with a very silly issue: How do I test multiplayer games?

I'm having problems even with the Local Preview to just check if everything is moving and animating right , because when I open two browsers to test, one of then become freezed. I think this is a feature from the modern browsers since they stop javascript rendering when the browser window is not the focused one.

In a more complex approch, I don't no how to test diferent bandwidths or when the peer disconnects and then reconnects.

Has anyone here who had experience with that and like to share? I'm felling really lost right now :(
-- Ze - Z - Zé --
B
19
S
4
G
1
Posts: 26
Reputation: 1,921

Post » Wed Mar 09, 2016 2:36 pm

I have the same question & I'll be following this thread if someone can please answer to the question by pxzin.
B
3
Posts: 1
Reputation: 177

Post » Wed Mar 09, 2016 2:51 pm

I assume you're talking about Multiplayer object.

Have you guys read the series of Ashley's tutorials?
https://www.scirra.com/tutorials/892/mu ... 1-concepts

Building a multiplayer game can bring tons of surprises if you lack with knowledge. It is crutial to understand how WebRTC data channels work etc.

Regarding second window. In my case window/game/app freezes if you have it as an inactive tab in the browser or if you minimize it. So just put that tab to be a separate browser instance and just leave it behind, don't minimize it to the taskbar.
ImageImageImage
B
27
S
16
G
80
Posts: 1,019
Reputation: 44,757

Post » Wed Mar 09, 2016 6:49 pm

@BackendFreak Thanks for your reply :)

I already read the Ashley's series, but I will read again to be sure. However my problem isn't about understand WebRTC (I already have some experience using that with webapps) , but just how to test it. It is not easy to emulate bandwidth and maybe someone knows an efficient method to do that.

About browser instances, they become inactive on focusout even if i don't minimize. E.g: I'm using 2 monitors where the Host and the Peer stay in separated browsers (Chrome and Firefox). The game still runing and nothing is lost, but I can't see the rendering. When the focus back to one of then, everything is updated to the correct place.
The real problem here is that I can't see if my animations are correct rendering between Host/Peer.

For now, I need to compile the project and test with 2 computers or virtual machines .
-- Ze - Z - Zé --
B
19
S
4
G
1
Posts: 26
Reputation: 1,921

Post » Wed Mar 09, 2016 7:09 pm

I'm not sure about this but did you disable "Pause On Unfocus" in the project propeties?
ImageImageImage
B
63
S
23
G
78
Posts: 661
Reputation: 44,935

Post » Wed Mar 09, 2016 7:11 pm

Two seperate chrome windows, non minimized works for me.

As for emulating bandwidth, VMs are probably your best bet, but I wouldn't think it worth the trouble... bandwidth is generally not an issue unless you start getting into huge numbers of peers, and in that case it only matters for the host and you'll probably want a dedicated host on a big pipe anyway. Latency is usually the main thing to worry about, and even then you usually don't have much control over that.
Mistakes were made.
B
52
S
26
G
110
Posts: 1,623
Reputation: 62,167

Post » Wed Mar 09, 2016 7:31 pm

@TheRealDannyyy
That is it! Thank you! :D

@oosyrag
So, bandwidth only will affect the initial assets download, right? (considering a browser webgame)
About latency, yeah ... my first test under a 3G connection show me the real struggle =(

Problem solved, thank you all :D
-- Ze - Z - Zé --
B
19
S
4
G
1
Posts: 26
Reputation: 1,921

Post » Wed Mar 09, 2016 7:42 pm

Bandwidth is important for the host, as the bandwidth required for data transmission scales for every peer that connects - the host has to send and receive from ALL the peers, while each peer only has to send and receive from the host.

3g or 4g, you can have a very large bandwidth on a cellular connection, but generally speaking the latency will ALWAYS be bad. This is why real time synchronous mobile games are very rare. Most mobile games are either asynchronous, or set up in a way where timing and lag don't make little difference on game play. Otherwise, you will need to develop some creative and robust lag compensation techniques, which can be done, just troublesome.
Mistakes were made.
B
52
S
26
G
110
Posts: 1,623
Reputation: 62,167


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests