Massive multiplayer, what should i use?

0 favourites
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • Hi! I wanna add multiplayer using construct 2 on my project, i've already done projects using sockets (scribble.ws) or official multiplayer plugin but it was on low number of players, it was not working really well, it wasn't how i expected it to be, it worked but i wanted it to work even better. So my idea is to make a multiplayer game, using some kind of console, i think some of you know what i mean, in most of the actual games, players or server hosters setup a server simply by launching it and setting up the good settings (like in terraria, minecraft,starbound ect...), i wan't to make the same using construct 2.

    I wanna ask you guys, what should i use for this, the server hosted by someone should be able to handle more than 100+ players, and i don't think c2 plugin should be able to do that. Basically, i want it to starts using settings from a file, then load the item database, npcs, ect, then when i player connects, loads the player database, spawns it with his caracter, and everytime something happens on the screen, like a new item or a new skill, it'll add it to the database at the good character line ID, i want everything to be localy using arrays so then the server administrators will be able to edit everything they want.

    So that's why i'm requesting help on what kind of "plugin" or sockets or anithing related i should use precisly for this kind of project. Thanks!

  • again³

    the scirra multiplayer object has nothing to do with connection speed or capacity; it uses a peer to peer connection which means that the first player to connect is the host, then the host connection dictate the number of players/performance.

    now then... if you want to make a online multiplayer game using construct, the best option is the multiplayer object since is good and ready to go; but if you want to build a game with a "server", you will need to setup one outside the C2 and program a way so the server is always the "first player" to connect, meaning the server will be the host

    my best advice is to make a small game using the multiplayer example inside C2 and see how far you can go with connection P/P to see if is doable, like a proof of concept so you dont spend months and discover that no one can play it because of lag

  • Also...

    100+ players connected concurrently... and considering you need to pass info to a database. You are talking 1 hosted server, the actual reality is you will need 10+ dedicated servers just for your database... and many more to load balance.

    Best bet is to start small, use C2 multiplayer (it is awesome) build a following and expand as your user base expands.

  • There are several questions that can be discussed separately, as there is little overlap.

    1. Console. It's a nicety, and shines in automated/scripted environments to be able to pass/process complex commands, but in the end it's only an interface to the underlying systems. If you need an actual console for low-level management of objects/sessions, C2 might not be the best choice. C2 gives maximum productivity when working at high-level, on entities, behaviours and events.

    2. Data management. There are some good tutorials to get C2 to interact with a remote SQL database. Beyond that, it all depends on your projects. Your specifications need to be analysed to deduce a relevant set of data structures, tables, interfaces, queries, etc.

    3. Bandwidth. As the previous posts mention, the user connection if the limiting factor. C2 provides a built-in host/peers architecture, not a server/client ; subtle difference.

    "the server hosted by someone should be able to handle more than 100+ players"

    If a user is hosting the session, we can break it down and analyse what it means in terms of bandwith. A typical ADSL2+ connection gives you a 800kbits/s upstream bandwidth. 100kbytes/s, that's the maximum hard-limit to play with. What follows is a bit simplified, but gives an idea of the order of magnitude of the problem.

    Also, bandwidth requirement is exponential (more players = more data to send to more peers, see mutliplayer tutorials 1 Concepts page 9)

    Say you have 100 peers controlling a sprite that moves around smoothly on a shared map. You need at least a position (x,y) that we'll encode into 4 bytes (2 16b floats or int). The state of the game requires 400 bytes (position of all of the players). At an update rate of 15fps to be conservative, that's already : 400 bytes data x 100 peers * 15fps updates = 600kbytes. Way above what a home-user connection can handle.

    Even if we're clever (less updates, better packing, partial prediction, etc.) and save a factor 10x, that's still more than 50% of the bandwidth and the players are not doing much yet.

    It's very different if you have 100 players in a turn-based grid layout. Or if you have a dedicate host and a much larger connection.

    But bandwidth is the limiting factor. There's no software technology or plugin around it, it's a technical hard limit. Basically, it's very hard to give specific advice without more infos about the specifications of the project, but "large scale multiple" and "user hosted" don't work well together.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't want to use a player as the host, i want a console to work as the host, but it seems this won't be possible using the c2 mp plugin.

    I don't think i'll need 10dedicated servers, sure i'll need a really big bandwidth nor big specs, but i saw games using only one MySQL database and one console running at one time and it could handle more than 100+ players

  • Well, can we make (using c2 mp plugin) a standalone node-webkit (or browser) build and use it only for sending and receiving infos?

  • If you know the details of your project, it's "easy" to calculate how much bandwidth you need (or at least get a good estimate). Just be aware it grows very quickly.

    With the C2 built-in host/peer model, you can ensure "your" instance is running as the host ; the console is irrelevant and does not reduce or increase the complexity of the networking problem.

  • "can we make a standalone node-webkit (or browser) build and use it only for sending and receiving infos?"

    It can be the same C2 project, with significantly different event sheets, depending on being the host or a peer ; then you can ensure your instance is the host, by having it join the session/room first using the Scirra signalling service.

    Your "host" events would :

    • interface with the database, to read/write centralised data
    • receive inputs from peers
    • run critical gameplay logic
    • broadcast updates to all peers

    The peers "just" send user inputs, display the world based on the host updates, and run non-critical logic (visual effects, animations, etc.)

    Bandwidth issues remain though, and you still need your host on a box with a big pipe if you need to handle lots of peers and data.

  • "can we make a standalone node-webkit (or browser) build and use it only for sending and receiving infos?"

    It can be the same C2 project, with significantly different event sheets, depending on being the host or a peer ; then you can ensure your instance is the host, by having it join the session/room first using the Scirra signalling service.

    Your "host" events would :

    - interface with the database, to read/write centralised data

    - receive inputs from peers

    - run critical gameplay logic

    - broadcast updates to all peers

    The peers "just" send user inputs, display the world based on the host updates, and run non-critical logic (visual effects, animations, etc.)

    Bandwidth issues remain though, and you still need your host on a box with a big pipe if you need to handle lots of peers and data.

    Do you think i can make the server outside of the actual game? A different project

  • The C2 plugin allows the server to be host (ashleys multiplayer ghost shooter does just that) ... but you are still limited to bandwith as Refeuh so elegantly showed... Info has to be passed to and fro from peer to host and host to peers. And host has to send info out to all peers.

    The bottleneck will arrive at some point.

    Depending on the type of game, depends on the strategy. I've seen people break a map up into segments, so only those players in zone A are connected to each other. Those in Zone B, etc this makes because zone B has no interaction with zone A... it also allows the game to appear to have 100's of players on the map, when in fact they aren't actually playing together. The issue comes in(well not an issue, just a matter of brain application) when player moves into another zone, he then has to auto connect to new zone without him knowing it. Its that split second lag, jitter you get when running over some invisible line - lol.

    Lots of ways, but C2 isn't really built for "Massive" multiplayer.... a turn based is possible, but 100's if not 1000's of objects sync'd with 100's of players - I doubt it very much.

  • Remember we aren't talking singnalling server... this just connects host and peers to each other. The server is the actual host server the one that has a chrome installed and running 24/7 as host.

  • Depending on the type of game, depends on the strategy. I've seen people break a map up into segments, so only those players in zone A are connected to each other. Those in Zone B, etc this makes because zone B has no interaction with zone A... it also allows the game to appear to have 100's of players on the map, when in fact they aren't actually playing together. The issue comes in(well not an issue, just a matter of brain application) when player moves into another zone, he then has to auto connect to new zone without him knowing it. Its that split second lag, jitter you get when running over some invisible line - lol.

    Oh reminds me of the pokemon multiplayer prototype i made using Websockets, it was nice, i could teleport player on another instance.

    Speaking of my project, i don't think i'll have alot of problems with zones, i already planned it, there won't be that much zones

  • Do you think i can make the server outside of the actual game? A different project

    Yep, I'm actually doing it.

    Speaking of my project, i don't think i'll have alot of problems with zones, i already planned it, there won't be that much zones

    You might want to consider sharding your host, depends on your game genre. Pokemonesque movement id fine, but for fast pace you'd want to run several zones/host instead.

  • Also...

    100+ players connected concurrently... and considering you need to pass info to a database. You are talking 1 hosted server, the actual reality is you will need 10+ dedicated servers just for your database.

    This sounds incredibly unrealistic to me. I run web servers that get thousands and thousands of uniques a day, and they hum along fine on a single mid grade server. If you needed 10 dedicated servers for 100+ players MMOs would not be technically or financially feasible. The some of the higher traffic websites in the world typically operate on fewer than a handful of servers.

    If you are serious about an MMO you probably do not want to be using construct2, and if you in, in the very least, you need to write your server daemon in something that is not in C2 (C++, maybe Node, Java, Go, etc)

  • [quote:2823bbuw]Do you think i can make the server outside of the actual game? A different project

    The C2 project is where you define the objects to synchronise, what to synchronise, and the format of the data. Then C2 handles it all under the hood for you.

    If you don't do that, it means you'll end up fighting the system more than using it.

    It doesn't mean it's not doable (I'm sure DuckfaceNinja has some clever tricks to share ), it means it'll be counter-productive. You still have the option of web sockets. But when talking "easy" C2 multiplayer, think "Risk of Rain", not "Realm of the Mad God", for example.

    As for a standalone "server", if you have the knowledge to analyse the C2 marshalling to write a separate system that will interact with a C2 peer or multiplayer-enabled object, you have the knowledge to write your entire system altogether, which would be easier in the first place as you wouldn't need to fight the existing structure. Though we're talking significant amount of work for a veteran networking programmer.

    C2 is designed to fast productivity for simple games. If it's not saving you time, you're not using the right tool.

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