Multi-player - multi server - how would you do it?

0 favourites
  • 7 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Ok, so here's my basic idea for a game and I'm trying to decide if it'll work in C2/3 or if I need to slog through Unity.

    The game is basically going to be a moba. There will be a login/matchmaking server. Once a client readies up for a game and the matchmaker finds players it will create and start a game server. Clients are then transferred from the login server to the game server. Once a match has ended the clients are transferred back to the login server and the game server shuts down freeing resources (think LoL or Dota2). I definitely don't want this to be a p2p multiplayer. I want it server controlled.

    I think I know how this can be done using C2 with Ajax, PHP and MySQL. What I'd like to hear is how you'd approach this type of configuration using C2/3. In particular, how you'd handle the game server. Would you do an NW.js export and just have PHP copy and run the game server or ????

    Thanks

  • Ok, so here's my basic idea for a game and I'm trying to decide if it'll work in C2/3 or if I need to slog through Unity.

    The game is basically going to be a moba. There will be a login/matchmaking server. Once a client readies up for a game and the matchmaker finds players it will create and start a game server. Clients are then transferred from the login server to the game server. Once a match has ended the clients are transferred back to the login server and the game server shuts down freeing resources (think LoL or Dota2). I definitely don't want this to be a p2p multiplayer. I want it server controlled.

    I think I know how this can be done using C2 with Ajax, PHP and MySQL. What I'd like to hear is how you'd approach this type of configuration using C2/3. In particular, how you'd handle the game server. Would you do an NW.js export and just have PHP copy and run the game server or ????

    Thanks

    A LoL/DOTA-style MOBA or RTS is pretty ambitious using these technologies. I think you are going to run into two major issues:

    Message rate limitations: In my experience, trying to send more than a few messages per second to a php/MySQL server will quickly overwhelm your server, as it has to receive the message and read/write to the hard disk synchronously every time. In something like LoL or a traditional RTS, each player might clicking several times a second, and each of these might generate a message to the server, quickly overwhelming it. This is just for a single game. If you have 10 games going on simultaneously, each game might require its own server, quickly driving your costs through the roof.

    Lack of an integer data type: Because of the large number of units involved, MOBAs and RTS games don't try to send the entire game state over the network. This would require gigabytes of data every second. Instead, they only send player inputs, and each computer is responsible for computing the results of all of the inputs. This requires a deterministic computation. To do this, you really need to be using integers instead of floating point numbers. Because it runs in a browser, you don't have direct access to integer data types in Construct, and this will introduce errors and inconsistencies between different player's computer's versions of the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, this can be done by using built-in multiplayer plugin like in this template.

    The server can be represented as a stand-alone application or even a browser window. Moba games usually have only ten players in each room, so it will not be a problem for C2.

  • A LoL/DOTA-style MOBA or RTS is pretty ambitious using these technologies. I think you are going to run into two major issues:

    Message rate limitations: In my experience, trying to send more than a few messages per second to a php/MySQL server will quickly overwhelm your server, as it has to receive the message and read/write to the hard disk synchronously every time. In something like LoL or a traditional RTS, each player might clicking several times a second, and each of these might generate a message to the server, quickly overwhelming it. This is just for a single game. If you have 10 games going on simultaneously, each game might require its own server, quickly driving your costs through the roof.

    Lack of an integer data type: Because of the large number of units involved, MOBAs and RTS games don't try to send the entire game state over the network. This would require gigabytes of data every second. Instead, they only send player inputs, and each computer is responsible for computing the results of all of the inputs. This requires a deterministic computation. To do this, you really need to be using integers instead of floating point numbers. Because it runs in a browser, you don't have direct access to integer data types in Construct, and this will introduce errors and inconsistencies between different player's computer's versions of the game.

    Hi and thanks for the input. Right now, what I'm looking at is a 8v8 moba. Each of those has speed and direction to be determined. Each of those can also fire up to 8 bullets each, 1 'direct fire' weapon and one semi-tracking weapon. Naturally, other data will need to be kept track of such as hit points, a shield and energy. While most of the time it won't have all of that on any one client's screen at a time, it is a possibility. Now, I know for a fact that UDP can keep up with this kind of data as it'll be a variation on a much older game that used UDP. What I'm concerned with is whether a NW.js game server and a C2/3 Web client can handle this kind of information using the multi-player plugin. Unity could do all of this with a lot of power left over. But creating a win/linux/mac client for it and writing code in c# is a nightmare I'd rather not deal with.

  • Well, this can be done by using built-in multiplayer plugin like in this template.

    The server can be represented as a stand-alone application or even a browser window. Moba games usually have only ten players in each room, so it will not be a problem for C2.

    See my reply above. The question is, can it handle upwards of 150 moving objects and 16 players and all the settings needed for those objects?

  • > Well, this can be done by using built-in multiplayer plugin like in this template.

    > The server can be represented as a stand-alone application or even a browser window. Moba games usually have only ten players in each room, so it will not be a problem for C2.

    >

    See my reply above. The question is, can it handle upwards of 150 moving objects and 16 players and all the settings needed for those objects?

    It will depend on many things:

    1. Your code optimisation.

    2. Server Internet bandwidth

    3. Server hardware

    I think, C2 will not be a bottleneck in your case.

  • Fair enough! Although I haven’t tried Scirra’s service myself, I don’t imagine that Unity’s service would be any better than Scirra’s based on this kind of load.

    My comments above were based on the assumption that you would need hundreds of units, but if you have only a handful of units and you can probably update game state several times a second. If determinism isn’t required, then there isn’t a requirement for integer data types.

    I am totally excited to see you try to get this working. I think the concept is really cool and ambitious.

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