How to handle multiple layouts in Multiplayer

Get help using Construct 2

Post » Fri Feb 20, 2015 6:54 pm

@Televangelist wrote: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?



Exactly !!

And for the mmorpg part of things ...

Use PHP /mysql back end with ajax.

I used it for my first version of tankwars (even the movement) and with a good approach in php you can make certain transaction safe enough, the vast majority of mmorpgs run on php/mysql :)

For the game side of things, it really livens things up ...
ie

mysql database having a table wit player info, and rooms/wordparts.
The player table should contain a reference to in which layout it resides atm. (current location)

Player starts app and ajax request ID info, if ID exists, send info from player etc.
If does not exist, create ID etc.

Now, if you move to another layout piece, simple ajax your way to the db and update player current location.
This will make you peers optionally available if they are offline too :)

Or, imagine sending someone a message ... store in DB, and when they come online, they check the db through ajax for messages.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Feb 20, 2015 7:51 pm

I think the multiplayer plugin could improve a lot if Scirra added a syncing condition to it, for example if all players has a room instance variable you could make the peers only sync players/objects positions that has the same room value and the host would work more like a dedicated server, correct me if I'm wrong.

This doesn't sound like a huge request to me but I'm not sure how it's programmed in the backend. Would definitely help with this problem a lot though.
B
18
S
4
Posts: 22
Reputation: 994

Post » Fri Feb 20, 2015 7:58 pm

Emy wrote:I think the multiplayer plugin could improve a lot if Scirra added a syncing condition to it, for example if all players has a room instance variable you could make the peers only sync players/objects positions that has the same room value and the host would work more like a dedicated server, correct me if I'm wrong.

This doesn't sound like a huge request to me but I'm not sure how it's programmed in the backend. Would definitely help with this problem a lot though.


Even if this would be a pretty small amount of work compared to what's already been done on implementing multiplayer, the problem is convincing Ashley that we (those of us who want to build worlds for players to inhabit) exist; because people aren't out there making Multiplayer 2D Arena shooters etc. with C2 right now, the impression he has is that multiplayer isn't really what people want to do.
B
6
S
1
G
1
Posts: 95
Reputation: 910

Post » Fri Feb 20, 2015 9:43 pm

@Emy @Televangelist Yup, the primary issue is convincing Ashley. I have had no luck in my emails, but I'm still optimistic that if we can show him that we could, in fact, greatly use this potential feature, he might give in. But until then, I will most likely have to shave my project's scope since I cannot wait any longer for such important features to be implemented.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,816

Post » Fri Feb 20, 2015 10:09 pm

I think a lot of people would be willing to use the multiplayer plugin more if it wasn't so complicated to create a dedicated server with it, I think that's what most of us want to use the plugin for anyway to be honest. Using tabs or having all rooms on the same layout is not reliable at all or a waste of memory.

I hope Ashley are willing to add this in the future because I really like the multiplayer plugin.
B
18
S
4
Posts: 22
Reputation: 994

Post » Sat Feb 21, 2015 12:16 am

@Emy those are my exact thoughts on the subject. I can even imagine that many of those who voted originally for multiplayer wanted to be able to make precisely what we are asking for, not peer-to-peer tech limited to mostly tools and noncompetitive gameplay; because that is what we currently have.

One can only hope we get this feature, or if someone familiar with the engine can craft an export suitable for this kind of project, that would be just as well.

Construct 3 dreams, perhaps?
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,816

Post » Sat Nov 21, 2015 3:42 pm

Wait so if my host can handle 200 or 400 objects on a large layout and then my peer gets laggy there is no way for me to let the host continue to do so but without bogging down the peer with syncing info on far away objects.

All I wanted to do was find away to be like

if object is within 500 pixels of peer then sync object
else don't sync object

But my guess and after reading this it appears this wont work or would be buggy and would stop syncing to all peers or something.
B
6
S
1
G
1
Posts: 31
Reputation: 945

Post » Sun Nov 22, 2015 8:21 pm

We need to start an open source project for a C2 centralized web socket plugin...
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Previous

Return to How do I....?

Who is online

Users browsing this forum: ksiads, tomhaiger and 6 guests