[Plugin] Photon Cloud

Post your completed addons to share with the community

Post » Thu Aug 04, 2016 6:23 pm

cliffordwh wrote:@ThePhotons I will post it once i can get the performance beter. Sending across 50 objects X & Y for the non host to sync is difficult without lag. I might have to add some interpolation to get that smoothed out.

What would you advise for something like that? Send over X, Y for 30 Plus objects every 1 0r 2 secs?

Strange thing is using the construct MP plugin i dont have that problem but it doesnt support IOS . :(


It's better to send state changes than X/Y coordinates where possible. You mentioned you're using the pathfinding plugin, so doing something like syncing starting x/y, speed, angle, then sending another event when the object reaches the next pathfinding node with those same values, should send a lot less data and get things synced up faster.
B
62
S
36
G
19
Posts: 494
Reputation: 16,914

Post » Thu Aug 04, 2016 9:06 pm

cliffordwh wrote:&ThePhotons Do you not have a Marco Polo Tutorial for Construct 2? Like you guys have for Unity?

Im struggling to sync objects created by the master. ( Host ) Any advice?

Im using pathfinding and getting them to sync is a NIGHTMARE! Thanks in advance.


@cliffordwh
How are you tracking which peer is the master/Host? I see that in the Photon docs but I don't see an even/action for it in the C2 plugin. Maybe I missed it? Or did you just create a room property?
B
62
S
36
G
19
Posts: 494
Reputation: 16,914

Post » Fri Aug 05, 2016 3:07 pm

Message: fens can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hi!
I've been faced the problem - black screen of death.
It's all okay when I run app using Construct2, but when I export html5 version and then upload it on google drive, it's impossible to see app because black screen only appears.
Problem disappears if I delete photon plugin.

HTML5 version here's:
https://goo.gl/SFy30x

CapX file here's:
https://goo.gl/z5YUt0

What app should do?
Just send number to all peers and show received number.
B
5
Posts: 19
Reputation: 265

Post » Fri Aug 05, 2016 5:30 pm

@ThePhotons is there a way to check who the master peer is at any time? I noticed the Unity Photon docs have PhotonNetwork.isMasterClient but I don't see an equivalent for C2.
B
62
S
36
G
19
Posts: 494
Reputation: 16,914

Post » Mon Aug 08, 2016 5:17 am

@digitalsoapbox , you can send a message that only goes to the master , I just send a function call that only the master gets and make Host=1; incase the host leaves, OnLeave just send that master call and will transfer host to a different client ~~ Send types ( All , others , masterclient)
B
11
S
2
Posts: 29
Reputation: 715

Post » Mon Aug 08, 2016 11:08 am

Hi all,

This is Vadim again.

2dgamedev wrote:@ThePhotons

Im having an issue .. if I join a room , then toggle IsOpen or isVisible , then leave the room and try to create a new room... I get this error and the room creation fails. but if i dont touch IsOpen or isVisible , i can join and leave and create as many rooms as I want

Image

any ideas?

I used single client (slightly modified demo-test) and simple action sequence: create room -> set isVisible to false -> leave room -> create room. That worked fine for me. Can you please provide more details on how to reproduced it?

Badmiracle wrote:
ThePhotons wrote:
gberenst wrote:Hi guys i´m trying to use this plugin but having troubles with it. Could you guys help me? I am makina a multiplayer quiz with Photon. When a player logs in he goes to a main room where he could find other spare players in order to invite. When he invites another player and the other accepts, both are taken to a new room, just for them. This works fine in multiplayer plugin, but when trying to make it in photon (I first leave room and then, when i am in lobby again), the room is created but some seconds later i get an error 1003/ Server closed connection.

Thank you for your help

This is due to a bug in leaving room logic in Photon js SDK. Fixed. Please download updated Scirra SDK version 4.0.0.1.
Thanks for report.


I still seem to be getting the exact same bug with version 4.0.0.4. Did the fix possibly revert in the last patch?

The fix is still there. It may be another bug. I could not reproduce it by quickly leaving the room and joining back. Can you please send simple app reproducing the issue? What's in your browser console when this happens?


fens wrote:Hi!
I've been faced the problem - black screen of death.
It's all okay when I run app using Construct2, but when I export html5 version and then upload it on google drive, it's impossible to see app because black screen only appears.
Problem disappears if I delete photon plugin.

HTML5 version here's:
https://goo.gl/SFy30x

CapX file here's:
https://goo.gl/z5YUt0

What app should do?
Just send number to all peers and show received number.


When I run HTML5 versuin, I get errors in browser console:
Photon-Javascript_SDK.min.js:3 Mixed Content: The page at 'https://64d21b694948dcf0b8ea14978f9568fb0b1c9f82.googledrive.com/secure/AH5…k-X02ZN_wybPaNvb7ay9kOtN07ZticHA2_QdoM=/host/0B55PnHLHjkIGM2VOQmJoaENJYmM/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://ns.exitgames.com:9093/'. This request has been blocked; this endpoint must be available over WSS.a.connect @ Photon-Javascript_SDK.min.js:3
Photon-Javascript_SDK.min.js:3 Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.


Try to switch Photon client to wss.

digitalsoapbox wrote:@ThePhotons is there a way to check who the master peer is at any time? I noticed the Unity Photon docs have PhotonNetwork.isMasterClient but I don't see an equivalent for C2.

This is not implemented in Photon javascript client. To be done. For now you can consider the player with lowest actorid as master. This is not very reliable but should work in most cases.

2dgamedev wrote:@digitalsoapbox , you can send a message that only goes to the master , I just send a function call that only the master gets and make Host=1; incase the host leaves, OnLeave just send that master call and will transfer host to a different client ~~ Send types ( All , others , masterclient)

Interesting idea. Should work too.
B
6
S
2
Posts: 144
Reputation: 946

Post » Mon Aug 08, 2016 11:19 am

@ThePhotons Yeah, I've noticed it's a bit unreliable to just set it to the player with the lowest actorID. I've run into issues with it properly reassigning the master (to a room property) when a player shuts the game down without leaving the room. I'll try @2dgamedev suggestion, that sounds like it might be more reliable.

@ThePhotons is there any kind of timetable for adding the check for the master client to the javascript client?
B
62
S
36
G
19
Posts: 494
Reputation: 16,914

Post » Wed Aug 10, 2016 3:59 am

The fix is still there. It may be another bug. I could not reproduce it by quickly leaving the room and joining back. Can you please send simple app reproducing the issue? What's in your browser console when this happens?


@ThePhotons

Sure, please put in your own AppID - https://we.tl/PGjJangeCB

When you run it, just Left Click and then wait at least 15 seconds (it works for a small amount of time before disconnecting, make sure the console is open).

First thing that will happen is the console will output "Error: 1003 Game server closed connection." and a few seconds later an ERR_CONNECTION_RESET.

Here is what my console reads:

Code: Select all
Game: PhotonPeer[_dispatchPeerStatus] - No handler for  connecting registered.
Photon-Javascript_SDK.min.js:21 Client: State: JoinedLobby -> ConnectingToGameserver
Photon-Javascript_SDK.min.js:21 Master: Disconnected
Photon-Javascript_SDK.min.js:21 Game: Connected
Photon-Javascript_SDK.min.js:21 Game: Authenticate...
Photon-Javascript_SDK.min.js:21 Game: Authenticated
Photon-Javascript_SDK.min.js:21 Game: Connected
Photon-Javascript_SDK.min.js:21 Client: State: ConnectingToGameserver -> ConnectedToGameserver
Photon-Javascript_SDK.min.js:21 Game: myActor:  [object Object](TypeError: Converting circular structure to JSON)
Photon-Javascript_SDK.min.js:21 Client: State: ConnectedToGameserver -> Joined
Photon-Javascript_SDK.min.js:21 Game: Server closed connection
Photon-Javascript_SDK.min.js:21 Client: State: Joined -> Error
Photon-Javascript_SDK.min.js:21 Client: Error: 1003 Game server closed connectiona.log @ Photon-Javascript_SDK.min.js:21a.error @ Photon-Javascript_SDK.min.js:20d._onErrorInternal @ Photon-Javascript_SDK.min.js:116(anonymous function) @ Photon-Javascript_SDK.min.js:108a._dispatch @ Photon-Javascript_SDK.min.js:16a._dispatchPeerStatus @ Photon-Javascript_SDK.min.js:17a._onDisconnect @ Photon-Javascript_SDK.min.js:15_socket.onclose @ Photon-Javascript_SDK.min.js:4
preview_prelude.js:81
GET http://192.168.1.38:50000/_reloadpoll_?_=1470801229708 net::ERR_CONNECTION_RESET


The last line starting with GET continues repeating.
B
55
S
18
G
7
Posts: 71
Reputation: 6,948

Post » Thu Aug 11, 2016 5:18 am

@ThePhotons I'm running into the same issue as @Badmiracle, with the exact same use case. If I leave the room visible/open, all is fine. If I change open state, I get what Photon is reporting as Error -2, with the message "Invalid type for property isOpen. Expected type System.Boolean but is System.Double."
B
62
S
36
G
19
Posts: 494
Reputation: 16,914

Post » Thu Aug 11, 2016 8:16 am

Badmiracle wrote:
The fix is still there. It may be another bug. I could not reproduce it by quickly leaving the room and joining back. Can you please send simple app reproducing the issue? What's in your browser console when this happens?


@ThePhotons

Sure, please put in your own AppID - https://we.tl/PGjJangeCB
...

Thanks for detailed report and repro app.

This is another known issue. If client reconnects to game server within 10 sec. after leaving a room, game server disconnects client by timeout thinking that this is still old client connected.
Most likely this is because browser reuses connection when new websocket created. We are working on this.
B
6
S
2
Posts: 144
Reputation: 946

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests