Has anyone published a working multiplayer game?

Discussion and feedback on Construct 2

Post » Thu May 28, 2015 9:49 am

@tunepunk

Can you pass on the link to this photon plugin.

How is this plugin different from the regular multiplayer?.
Does it make one of the peers as the host if the original host leaves, or it just leaves the room unclosed, which means it'll only work in games where the multiplayer logic is running on the peers also, and not only the host.
B
16
S
4
Posts: 140
Reputation: 1,458

Post » Thu May 28, 2015 10:26 am

@troublesum - based on those log messages it doesn't look like you're using the official Multiplayer plugin. Are you involving your own code or library there? I never saw that issue with the official Multiplayer plugin.
Scirra Founder
B
397
S
236
G
88
Posts: 24,395
Reputation: 194,460

Post » Thu May 28, 2015 10:39 am

Pandy wrote:@tunepunk

Can you pass on the link to this photon plugin.

How is this plugin different from the regular multiplayer?.
Does it make one of the peers as the host if the original host leaves, or it just leaves the room unclosed, which means it'll only work in games where the multiplayer logic is running on the peers also, and not only the host.


It's quite different from the regular multiplayer as this one uses some sort of "cloud server". There are no hosts or peers per say. Every event sent from your client will pass through the Photon Cloud server, and are sent to the other clients. You don't have to set any host or anything like that. All the actions you do you just transmit them through the photon server, and anyone in the same room will see the updates and you will see theirs as you recieve their events while connected to the room. Even if you are the first one to join the room, you're not really the host, as you can exit any time, and rejoin the room with a new ID. Rooms will stay open as long as there are players inside.

I didn't check all the details yet, and only been messing with it for a week or so. I just downloaded the examples and learned from that, but it's pretty straight forward, and far easier to comprehend and use than the regular Multiplayer plugin. Basically works like this.

1. Connect
2. Join a room (If there is any open with available slots, otherwise there will be one created)
3. Player1 press move button. (player1 moves 6 pixels in that direction)
4. Send event to Photon server. (Event usually contain your ID and anything you want other users to get, like: Player1 move 6 pixels in that direction)
5. Photon sends the event containing the information to all other users in the room.
6. Recievers catch the event, and applies the on their end changes that are sent through the event. (Ex: Player1 move 6 pixels in this or that direction)

That's basically how it works. Without dedicated servers, and no hosts. It's GENIOUS!!!

https://www.scirra.com/forum/plugin-photon-cloud_t125222
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Thu May 28, 2015 11:02 am

@tunepunk,

Going to check it out - thxs. It looks promising.
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,718

Post » Thu May 28, 2015 11:43 am

DUTOIT wrote:@tunepunk,

Going to check it out - thxs. It looks promising.


For me it was a no-brainer. My main concern with Peer to Peer or Hosted games, was what if host disconnects or decides not to play/ragequit, there is no game anymore. Those kind of things completely ruins multiplayer gameplay in my view. Hosted games with player created rooms are a thing of the past. :P
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Thu May 28, 2015 11:57 am

tunepunk wrote:
DUTOIT wrote:@tunepunk,

Going to check it out - thxs. It looks promising.


For me it was a no-brainer. My main concern with Peer to Peer or Hosted games, was what if host disconnects or decides not to play/ragequit, there is no game anymore. Those kind of things completely ruins multiplayer gameplay in my view. Hosted games with player created rooms are a thing of the past. :P


Our games focus on privacy. Family and friends and invite only. The fact that if host disconnects is a bonus. The price structure is very good to, concidering. I see the plugin has some issues though. But the website has enough docs and code to figure it all out - I hope, will have to schedule some time.

Player created rooms are very popular. Who wants to play with strangers that make the gaming experience not enjoyable? Private rooms rock, unless you want to use the strangers as target practice ;)

Both have merit however, depends on end project.
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,718

Post » Thu May 28, 2015 12:55 pm

I didn't say private player created rooms are a thing of the past. Just that the whole technology of the host-peer setup is kind of dated in my point of view. And not really desirable in some cases, depending on what type of game you're creating. Maybe there are some benefit in terms of ping times, and maybe better in LAN gameplay or whatnot. I guess photon cloud as a technology can have the same features as host-peer games. First one to join room - Set Player.Host=True ... and close the room if he leaves. Private rooms would also be doable i guess... but anyway. You're rigth depends on the project. But messing around with Photon cloud for a week i can see it's quite versatile.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Thu May 28, 2015 4:28 pm

@Ashley - Yah I wrote my own WebRTC client for a completely different web application (I will probably extend it to a C2 plugin for myself in the near future) and this was something I came across during its development. It was rare but often enough I decided to code around it.

What I found was that in rare cases after the host has created the offer it can start sending ICE candidates almost immediately. I would have assumed the peer would have enough time between receiving the offer and generating the answer before receiving the ICE candidates but this wasn't always case. From what I can tell the offer is always received before the ICE candidates since the websocket connection to the signal server is ordered but if sometimes they are received close enough together and they don't give the peer enough time to set a remote description and generate an answer this race condition occurs. Because the peer process of setting the remote description and generating an answer is asynchronous javascript isnt held up and can receive and add an ICE candidate during this time at which point you will get that error as it attempted to add the ICE candidate before completing the answer process. So its an actual race condition that occurs as a result of the trickle ICE implementation in the WebRTC protocol.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Fri May 29, 2015 10:11 am

Well there's nothing we can do about bugs in the WebRTC protocol itself, you'd need to take that up with browser vendors. However I'd suspect it relates to your own WebRTC client code, since I've never heard of any such issues with C2 multiplayer games connecting to each other. Also it may simply not be important, since I think ICE works by sending multiple candidates over time, and if it successfully connects and another candidate comes in, it may simply ignore that (possibly logging an error in the process).
Scirra Founder
B
397
S
236
G
88
Posts: 24,395
Reputation: 194,460

Post » Fri May 29, 2015 11:21 am

@Pandy,

Here is a working multiplayer game by @ lennaert
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,718

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests