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