How do I test multiplayer ?

0 favourites
  • 8 posts
From the Asset Store
Soldiers` Test
$12.99 USD
A Construct version 2 & 3 "Stand-alone" RPG game with "In-Game Module" (IGM) integration.
  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have the same question & I'll be following this thread if someone can please answer to the question by pxzin.

  • 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.

  • 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 .

  • I'm not sure about this but did you disable "Pause On Unfocus" in the project propeties?

  • 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.

  • TheRealDannyyy

    That is it! Thank you!

    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

  • 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.

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