[Plugin] Photon Cloud

Post your completed addons to share with the community

Post » Sat Apr 15, 2017 1:37 am

Would it be possible to get server clock time with a ping to compensate the distance so that actions can be tracked in order to know who shot first, and to implement lag compensation by being able to calculate when an input was sent with precision to resolve inputs more accurately @ThePhotons
Image
B
41
S
14
G
3
Posts: 26
Reputation: 4,089

Post » Tue Apr 18, 2017 8:38 am

Hardty wrote:@ThePhotons does this plugin working on NW.js and Cocoon.io Canvas+ ?

Do you have any problems with this? It should work.
B
7
S
2
Posts: 172
Reputation: 1,027

Post » Tue Apr 18, 2017 8:46 am

Sybr33d wrote:Hello,

I tried your Multi Photon Tutorial and ended up with some issues
...

Hi,

What tutorial did you try? Can you post a link? We did not publish tutorials for Photon C2 plugin.
B
7
S
2
Posts: 172
Reputation: 1,027

Post » Tue Apr 18, 2017 8:59 am

eleanorawesome wrote:Would it be possible to get server clock time with a ping to compensate the distance so that actions can be tracked in order to know who shot first, and to implement lag compensation by being able to calculate when an input was sent with precision to resolve inputs more accurately @ThePhotons

Currently server time and ping are not available in Photon js sdk and C2 plugin. You can measure ping by sending packets with timestamps to the client itself (set TargetActors to str(Photon.MyActorNr) in "Raise event")
B
7
S
2
Posts: 172
Reputation: 1,027

Post » Thu Apr 20, 2017 7:07 pm

hi, great work, but some question :

with construct2 multiplayer plugin, if we create game like Clash Royal ( i mean a multiplayer game with 2 player and realtime ) , the first player will be Host and 2nd Player will be peer. and if Host disconnect from game for any reason, peer can't continue with game and when host come back, the game has gone !
another side, when Peer disconnect from game ( internet, mobile battery and etc. ) , it can't return to that game.

what about with Photon server and your plugin ? ( sorry for bad English)
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Apr 24, 2017 1:00 am

mostafanastary wrote:hi, great work, but some question :

with construct2 multiplayer plugin, if we create game like Clash Royal ( i mean a multiplayer game with 2 player and realtime ) , the first player will be Host and 2nd Player will be peer. and if Host disconnect from game for any reason, peer can't continue with game and when host come back, the game has gone !
another side, when Peer disconnect from game ( internet, mobile battery and etc. ) , it can't return to that game.

what about with Photon server and your plugin ? ( sorry for bad English)


I think I can answer because I am working on a similar project. Do not take my explanations as certified, it's just my personal thoughts about Photon (I did not take a look deeply in the JS code).
In my opinion, you shouldn't search further; Photon is what you need. A game like Clash Royale (or any game where there is a need for a server to host a lot of information), the scheme peer-to-peer is not applicable. What you need is a "server/client" scheme; AFAIK, that's how Photon works (your players -clients- will automatically connect to Photon servers -nameserver/masterserver- and they will act as master clients). Every information sent by one player will transit through Photon server before reaching the edge player.

Although it may sound like a "disguised" peer2peer connection, Photon's real-time also and mostly offers matchmaking, with lobby handling and all the whole thing, which is just perfect (assuming you are making a game with a matchmaking/lobby management). That wouldn't be possible with a simple P2P connection.

Besides that, it can be a real hassle to master Photon's plugin. From my experience, I think the tricky part is to clearly define what element of your game will transit via Photon servers and what element will remain local. It depends on a lot of things.
A good start to me was the following tutorial, which should help you as well: https://www.scirra.com/tutorials/9431/f ... ith-photon

Good luck :mrgreen:
B
6
S
2
Posts: 3
Reputation: 456

Post » Mon Apr 24, 2017 7:44 am

@bvandenborght Thank you for detailed clarification.
A few notes:
@mostafanastary You should choose for host not random player but master player ('MasterActorNr' expression) which assigned by Photon automatically at game start and when current master leaves. Design game logic so that new master player can continue running the game after old one has gone. E.g. you can store game state on each client but update it only on master.
what about with Photon server and your plugin

You need only choose "Self Hosted" in HostType dropdown menu in Photon setting and set server address. Everything else should work exactly as in cloud.
B
7
S
2
Posts: 172
Reputation: 1,027

Post » Mon May 01, 2017 3:32 pm

Hey guys, what's the best place to better understand the Photon plugin?

I spent days trying to figure out how to have multiple players on screen and have each player move across all screens in real time only to have another Construct user show me how it's done in a few lines.

Also, I've noticed that after a few minutes, a player would randomly stop dead and their position won't be updated further. How can this be fixed?

CapX here: http ://s000.tinyupload.com/?file_id=02802319115309673895

I'm trying to figure out how to attach a turret to the vehicle and fire a bullet, again in sync with all players not just locally. I honestly have no idea what I'm doing and would love to better understand the photon process. Thanks!
B
7
S
2
Posts: 41
Reputation: 613

Post » Tue May 02, 2017 8:43 am

Hi @RetroSpock
On your question about documentation: http://forum.photonengine.com/discussio ... t-2#latest
B
7
S
2
Posts: 172
Reputation: 1,027

Post » Tue May 02, 2017 10:19 am

Thank you @ThePhotons!
B
7
S
2
Posts: 41
Reputation: 613

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests