How to handle multiple layouts in Multiplayer

Get help using Construct 2

Post » Thu Feb 19, 2015 8:59 pm

@lennart I don't want to have multiple tabs open OR have palyers acting as the server in any way at all. The game isn't specifically for 2 people either. I don't know how many people will be in the game and what maps they will be on.
B
46
S
14
G
7
Posts: 603
Reputation: 8,106

Post » Thu Feb 19, 2015 9:26 pm

EncryptedCow wrote:lennart I don't want to have multiple tabs open OR have palyers acting as the server in any way at all. The game isn't specifically for 2 people either. I don't know how many people will be in the game and what maps they will be on.


Even if you have a server running a single tab in a browser ... isnt it capped with connections ?
I believe the browser has 256 soft cap on connections, not sure how it is with webrtc.
I am guessing is that if you want to have a single server running something as host, you will have game instances around that number per window.


I think the smartest approach with this is to have to have players act as a host for a rooms where other peers can join.
Thats how the mechanic of the current plug in is set up and works fine.
You can toy around with instance names and room names and find nice ways to manipulate them to simulate some sort of world with entries and exits everywhere leading you to another layout where you automatically join existing rooms or create on one the fly.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Fri Feb 20, 2015 12:07 am

@lennaert thanks for the suggestions but I am on the same page with @EncryptedCow, I have determined that to make my game project work efficiently, and without all sorts of attempts at circumventing some of the current limitations, I will need to have the ability to manage multiple layouts simultaneously either in export, behavior, or some other feature that enables 1 server, X clients, and Y layouts/maps/rooms.

I understand the limitations, and for one, there are many successful games that don't have a whole ton of concurrent players (take games like Realm of the Mad God for example. Their servers do not usually host many people). I honestly do not expect to have that many concurrent players, and even if I do, that is what having multiple servers is for, like Runescape, Maplestory, AdventureQuest Worlds, Realm of the Mad God, & etc. Or if I do need to support more than 256, then I'd be happy using your suggestions to send players between server instances rather than trying to stuff everyone inside one.

But until then, for sure to make this work efficiently and cleanly, I will need to have the option of managing multiple separate areas through support from Scirra in Construct 2.

I have sent Ashley an email asking more about this subject, and I hope to gain more insight into the possibilities.

In my email I also pointed this out: adding a feature that directly supports the creation of traditional MOGs would be an excellent selling point. There are other products out there that do support online multiplayer games through the web, however, none of them are straightforward, many of them have some sort of licenses more associated with business-class development, and none of them have the same level of simple development that Construct 2 has as an entire IDE. There are many users who would love this engine if the support were right out of the box.

And I would gladly create tutorials and guides on how to start developing an MOG were we to see a feature like this since it would make development that much more straightforward. I understand, Lennaert, the concepts you've brought up, but I think just the fact that they are more hoops to jump through creates issues and winds up much more of a deterrent, especially to potential customers.

On a side note, in the long run, you do not want any data to be passed off to a client machine in, say an MMORPG. People will learn to exploit even the smallest bit of information, which is why I will not develop in that way unless I take the whole "server" right out of the equation and develop a Multiplayer game more like Dark Souls than, say, Runescape.

In that case, yeah, heck a DS-like game would be fun! But that is not what I am developing.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Fri Feb 20, 2015 3:09 am

Wait, my players have to be *on the same layout*? This is a huge, huge problem.

My plan for multiplayer (a zelda-y world that players can move freely around in) was:


-Every screen of the world is a separate layout (makes life easy in a number of ways)

-Players only sync data with other players in the same layout as them (so if you're the only player in a given layout, you're not syncing with anyone)

-Global world variables (is it day or night? Are there orcs attacking the castle?) sync globally once every five seconds (for low bandwidth consumption)

This seems like it would be low data while still allowing the feeling of a 'permanent' world (with most things including character save data handled by the client, at least at first, I'm not a professional operation I don't feel the need to move everything server-side).

But according to what you're saying, this extremely simple vision would be impossible?!

Ugh. :(
B
6
S
1
G
1
Posts: 95
Reputation: 910

Post » Fri Feb 20, 2015 5:38 am

@Televangelist yep, pretty much. I think I'm just going to switch over to a grid based movement system (think FF1), and not require any actual collisions in C2, just grid based collisions which will allow all players to be in their own layout with a relative position of their own map. It's the best I can do with what I have.
B
46
S
14
G
7
Posts: 603
Reputation: 8,106

Post » Fri Feb 20, 2015 12:09 pm

@Televangelist wrote:Wait, my players have to be *on the same layout*? This is a huge, huge problem.

My plan for multiplayer (a zelda-y world that players can move freely around in) was:


-Every screen of the world is a separate layout (makes life easy in a number of ways)

-Players only sync data with other players in the same layout as them (so if you're the only player in a given layout, you're not syncing with anyone)

-Global world variables (is it day or night? Are there orcs attacking the castle?) sync globally once every five seconds (for low bandwidth consumption)

This seems like it would be low data while still allowing the feeling of a 'permanent' world (with most things including character save data handled by the client, at least at first, I'm not a professional operation I don't feel the need to move everything server-side).

But according to what you're saying, this extremely simple vision would be impossible?!

Ugh. :(


No your players do not have to be on the same layout.

As long as you do not want a single host determining everything, you should be in the clear.

ATM it is like, every single layout, requires at least 1 host. Be it peer or a 'super host'


@DatapawWolf, how about writing up your own javascript version of the server side, and use node.js with the web RTC module to communicate with the peers ?
That should be definitely possible, and , if your any good at programming, you can make the host run without the need of a browser.

You would just have to write up the host side of things in a code only set up. Tough, do-able though.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Fri Feb 20, 2015 3:06 pm

lennaert wrote:
@Televangelist wrote:Wait, my players have to be *on the same layout*? This is a huge, huge problem.

My plan for multiplayer (a zelda-y world that players can move freely around in) was:


-Every screen of the world is a separate layout (makes life easy in a number of ways)

-Players only sync data with other players in the same layout as them (so if you're the only player in a given layout, you're not syncing with anyone)

-Global world variables (is it day or night? Are there orcs attacking the castle?) sync globally once every five seconds (for low bandwidth consumption)

This seems like it would be low data while still allowing the feeling of a 'permanent' world (with most things including character save data handled by the client, at least at first, I'm not a professional operation I don't feel the need to move everything server-side).

But according to what you're saying, this extremely simple vision would be impossible?!

Ugh. :(


No your players do not have to be on the same layout.

As long as you do not want a single host determining everything, you should be in the clear.

ATM it is like, every single layout, requires at least 1 host. Be it peer or a 'super host'


Ah, okay! So could I do it like this?

No super hosts; whenever a player moves into a layout, that player becomes the 'peer host' of that layout, and anyone else who enters the layout will enter the peer host's version.

So when a player enters the "Dangerous Cave" layout, the game pings the signaling server to see if anyone else is currently hosting the 'dangerous cave' layout, and if so it connects them, and if not that player becomes the first 'peer host' of the 'dangerous cave' layout. That will work?

And then for syncing global variables, I could use WebKit or something like that for syncing the global variables from a simple data file I host on a server somewhere? So, for example, if the world has a day/night cycle, that will sync up across all players playing the game through a separate mechanism than the multiplayer object?
B
6
S
1
G
1
Posts: 95
Reputation: 910

Post » Fri Feb 20, 2015 3:07 pm

EncryptedCow wrote:@Televangelist yep, pretty much. I think I'm just going to switch over to a grid based movement system (think FF1), and not require any actual collisions in C2, just grid based collisions which will allow all players to be in their own layout with a relative position of their own map. It's the best I can do with what I have.


Is there a good guide to implementing grid-movement collisions somewhere? This was something I was having trouble implementing in my grid-based movement system... assume there's some way of doing it simply/elegantly that I missed. :)
B
6
S
1
G
1
Posts: 95
Reputation: 910

Post » Fri Feb 20, 2015 4:31 pm

@EncryptedCow
@DatapawWolf

You guys are simply going beyond the multiplayer behaviour capabilities of construct 2.

The official multiplayer system is a simple signaling server which connects players with each other, so one player will always be the host.

What you guys are talking about is a simple dedicated server, that's it.
So as long as you're not going to code a dedicated server, there's no way you're ever going to achieve what you're looking for.

From what i've read from Ashley so far... he's not really interested into further developing the multiplayer part.
It looked like he felt that the multiplayer feature was a complete waste of time, because there are not enough people actualy using it. (i'm just interpreting what i've read so far, but his words came pretty close to that) So according to that i would guess that he's not willing to help you in a dedicated server matter.
(i would love to get my hands on a dedicated server version as well)


The only way to prevent players to become host right now is, to run the "main game" on your own server.
What i mean is.... run the game itself on your own private dedicated windows server (for example) which will then always be the host.
That would prevent players to become host themselfs, and you could offer your players a dedicated bandwith.
But it's just a simple and bad workaround.


So either you're going with lennaerts suggestion, which is actually pretty good.
Or you're going to code your own dedicated server.


Using lennaerts suggestion would simply mean that creating an actual (dungeon) instance will just be a new player being abused as a new host.
This would save you an *** full of money rather than being forced to host a dedicated server.

Of course there's a big downside on that, as you would have to rely on the players internet connection/location.
But i'm sure you would be able to add some checks on the players connection to prevent such players to become a host.


If you're actually willing to go for a real MMORPG, just keep in mind that this will require a really fast and big database / a good dedicated server. MMORPGs require the most powerfull servers when it comes to gaming (compared to a shooter for example)
In short: it's expensive
B
40
S
8
G
3
Posts: 159
Reputation: 3,019

Post » Fri Feb 20, 2015 6:16 pm

Everade wrote:@EncryptedCow
@DatapawWolf

You guys are simply going beyond the multiplayer behaviour capabilities of scirra.

The official multiplayer system is a simple signaling server which connects players with each other, so one player will always be the host.

What you guys are talking about is a simple dedicated server, that's it.
So as long as you're not going to code a dedicated server, there's no way you're ever going to achieve what you're looking for.

From what i've read from Ashley so far... he's not really interested into further developing the multiplayer part.
It looked like he felt that the multiplayer feature was a complete waste of time, because there are not enough people actualy using it. (i'm just interpreting what i've read so far, but his words came pretty close to that) So according to that i would guess that he's not willing to help you in a dedicated server matter.
(i would love to get my hands on a dedicated server version as well)


The only way to prevent players to become host right now is, to run the "main game" on your own server.
What i mean is.... run the game itself on your own private dedicated windows server (for example) which will then always be the host.
That would prevent players to become host themselfs, and you could offer your players a dedicated bandwith.
But it's just a simple and bad workaround.


So either you're going with lennaerts suggestion, which is actually pretty good.
Or you're going to code your own dedicated server.


Using lennaerts suggestion would simply mean that creating an actual (dungeon) instance will just be a new player being abused as a new host.
This would save you an *** full of money rather than being forced to host a dedicated server.

Of course there's a big downside on that, as you would have to rely on the players internet connection/location.
But i'm sure you would be able to add some checks on the players connection to prevent such players to become a host.


If you're actually willing to go for a real MMORPG, just keep in mind that this will require a really fast and big database / a good dedicated server. MMORPGs require the most powerfull servers when it comes to gaming (compared to a shooter for example)
In short: it's expensive


What a lot of us are aiming for is a multiplayer world without the 'massiveness' of MMORPGs -- you might have, for example, a cap of 50 people per server, movement in two dimensions (which is a lot less data being passed back and forth than a 3D MMO), inventories that are simpler and require less data storage than an MMO with, say, loot permutations (so an object in a player's inventory is simply recorded as "Item #263," which references local data on what all the items are, rather than all the special properties and permutations a modern MMO's 'Vorpal Sword +3 of Shadows' has undergone.


Multiplayer without persistence is boring and done to death. Who wants to play another competitive 2D arena game? But we're not trying to compete with the Big Boys here. We can do a form of persistent-world on the cheap.


As for a player potentially hosting with a poor connection, this is one more reason for me to split up every single screen of my Zelda-y multiplayer game into its own layout... if a screen is choppy because the first player to arrive on it is a poor web host, well, hop to any other screen and you'll be fine.

The one downside is that if players aren't 'connected' until they're on the same screen, how will I handle chat? That'll be tricky... Unless there's some way to have the chat box as a 'separate' multiplayer connection that I permanently host and have all players of the game as permanent peers... if that's impossible, though, text is simple enough that there's gotta be some weird Java-y way of handling it.
B
6
S
1
G
1
Posts: 95
Reputation: 910

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Nicolas951, tarek2 and 13 guests