Multiplayer & Dedicated Server

0 favourites
  • 9 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hi,

    I haven't found a good and direct answer to the following question...

    How does one associate a C2 multiplayer game with a dedicated server? I understand its been done by using the browser object and opening a tab...but thats all information i could dig up, how is this done and how does the events differ from the peer to peer. I have managed to develop a p2p and even successfully ran it mobile.

    Using a server to play host is essential since a peer to peer game play could simply end when the player who host decides to...leave.

    The top down multiplayer running on the scirra server is spot on my requirement, would a simple example CAPX be a possibility Ashley ?

    Thanks

  • * moved. This section is more appropriate for a discussion on how C2 multiplayer works.

  • * moved. This section is more appropriate for a discussion on how C2 multiplayer works.

    Thanks Zenox

  • I'm not sure if I understand your question.

    To put host game instance on the server, I believe you can simply export it to NWjs and run it on the server.

  • I'm not sure if I understand your question.

    To put host game instance on the server, I believe you can simply export it to NWjs and run it on the server.

    Hi thanks for the reply

    I simply want to know how to achieve an online multiplayer where the server plays the permanent role as host regardless of any peer disconnecting, the room will continue to be active for the remaining participants even if the first joined has left.

    Currently with peer 2 peer the first player becomes host and when disconnected all other players are forced to leave...so even tho i understand how to build a game around p2p, i can't wrap my head around how a server is used through the events.

    My knowledge so far is that the browser object are being used to open a new tab on the server and then so the multiplayer object uses that tab to join before any player and becomes host to create a solid foundation for the peers.

    But how...

  • Host is the first player who connects to the signaling server room/game. So yes - you just have to put it on some server, run it and keep it alive (simply not killing the process). That's how you get a stable game no matter how many players connect or disconnect, because the first one (host) is all the time online.

    You said that you know how it works and that you've managed to do a Multiplayer game so I am confused about the part where you say "how a server is used through the events". What exactly is unclear for you here?

    Regarding this "My knowledge so far is that the browser object are being used to open a new tab on the server and then so the multiplayer object uses that tab to join". I don't think that browser object has anything to do here. Multiplayer object and signaling server take care about communication via WebRTC.

  • Host is the first player who connects to the signaling server room/game. So yes - you just have to put it on some server, run it and keep it alive (simply not killing the process). That's how you get a stable game no matter how many players connect or disconnect, because the first one (host) is all the time online.

    You said that you know how it works and that you've managed to do a Multiplayer game so I am confused about the part where you say "how a server is used through the events". What exactly is unclear for you here?

    Regarding this "My knowledge so far is that the browser object are being used to open a new tab on the server and then so the multiplayer object uses that tab to join". I don't think that browser object has anything to do here. Multiplayer object and signaling server take care about communication via WebRTC.

    Ah now i understand what you mean, yes according to other posts i probably miss understood when preferred to opening a tab on the browser...i thought it should be done through the events but as you state it makes a lot more sense, thank you for correcting.

    Alright so its pretty straightforward and similar to p2p.

    Regarding the method of running a active game on the server, how is that accomplished? If i were to close my browser tabs and or disconnect from the uploaded game...wouldn't that have the same result as p2p because i'm unaware of any way to keep a HTML5 game running on its own.

    Thanks for the help

  • For host I suggest to export the game to NWjs (desktop), and run it directly from the OS on the server. That will give you much better performance rather than opening a browser on the server and run an HTML5 directly from the browser.

    As long as the host process will be active on the server you will have an online open world where players (peers) can connect to. You can even have a lot of server instances in order to handle more players as it is usually done with high traffic mmorpgs etc.

    Now regarding peers (players), they can join or disconnect from the server. It has no impact on server/game stability (unless you code it to be). When player closes a browser tab then it simply disconnects from the server, and such an event should be handled by you in your host events (for instance you might want to inform the rest of players that the particular one lost connection/quit).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cool, i think i'm wrapping my head around it now. Thank you greatly, this is the type of information i was looking for, appreciate.

    I will give it some testing

    Kind regards.

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