Massive multiplayer, what should i use?

Discussion and feedback on Construct 2

Post » Tue Oct 14, 2014 12:50 pm

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!
B
6
S
2
Posts: 46
Reputation: 769

Post » Tue Oct 14, 2014 2:50 pm

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
B
48
S
5
G
6
Posts: 210
Reputation: 6,277

Post » Tue Oct 14, 2014 3:08 pm

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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Tue Oct 14, 2014 3:19 pm

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.
Last edited by Refeuh on Tue Oct 14, 2014 3:22 pm, edited 1 time in total.
Image
B
23
S
9
Posts: 237
Reputation: 2,207

Post » Tue Oct 14, 2014 3:22 pm

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
B
6
S
2
Posts: 46
Reputation: 769

Post » Tue Oct 14, 2014 3:25 pm

Well, can we make (using c2 mp plugin) a standalone node-webkit (or browser) build and use it only for sending and receiving infos?
B
6
S
2
Posts: 46
Reputation: 769

Post » Tue Oct 14, 2014 3:27 pm

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.
Image
B
23
S
9
Posts: 237
Reputation: 2,207

Post » Tue Oct 14, 2014 3:37 pm

"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.
Image
B
23
S
9
Posts: 237
Reputation: 2,207

Post » Tue Oct 14, 2014 3:45 pm

Refeuh wrote:"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
B
6
S
2
Posts: 46
Reputation: 769

Post » Tue Oct 14, 2014 3:47 pm

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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Next

Return to Construct 2 General

Who is online

Users browsing this forum: kanjmarrie and 1 guest