[Plugin] Photon Cloud

Post your completed addons to share with the community

Post » Wed Jun 01, 2016 11:22 pm

digitalsoapbox wrote:
Sirvoid wrote:yes but this is not the best way when someone like me have a bad connection :p


It sends less data and you're less likely to miss that data when it's sent. Even if you do, you'll receive a new event soon after which sets the correct position & movement state of other players. Photon also has a limit on how often you can send events, so unless you want to hit the limit quickly sending less data is better.


I don't want to modify the tutorial to keep it easy to understand but I add a commentary in the capx to warn than it send a lot of data ;)
My Project:
OuterLand`
My Tutorial:
Multiplayer with Photon
B
27
S
10
G
9
Posts: 70
Reputation: 6,676

Post » Thu Jun 02, 2016 1:15 am

digitalsoapbox wrote:You don't need to send the X/Y position every tick, that's super-inefficient, especially when using the Platformer object. Send when you start/stop pressing keys instead. The example tutorial is the completely wrong way to do it. Let each local machine control all of the player Platformer objects, but set up player input to only directly control the player object assigned to the local machine. When the local player object receives input, send it as Photon events so other players receives each player input event and trigger them on the local machines. Think of it as client-side prediction: the player objects just receive start/stop information and occasionally send and receive position events when specific things happen (start moving, stop moving, jumping, falling, etc.). It's a lot less data to send as well so should be less affected by connection speed.

I'd planned on cleaning this up a bit before distributing it, and I probably will at some point, but if none of what I said above makes sense then check this out. It shows what I'm trying to explain above. https://dl.dropboxusercontent.com/u/14245368/C2/Examples/Photon_Multiplayer.capx


Thanks for the help! I had tried sending it less frequently and lerping to compensate, but still had the floating issue and this is a lot better.

Out of curiosity, is there any specific reason you set the max players at 4? I'm guessing to not overfill the array, but you could expand that. Or does C2 send the full array if values are not used, and bandwidth is wasted?

Another topic, the next logical step for multiplayer games is to have a server database / user accounts. As far as I can tell this isn't do-able with photon. Theoretically you could do this with sql databases, but I'm not sure how secure that would be? What do you all think is the best option for this?
B
55
S
22
G
11
Posts: 446
Reputation: 11,565

Post » Thu Jun 02, 2016 1:33 am

ReflextionsDev wrote:
Thanks for the help! I had tried sending it less frequently and lerping to compensate, but still had the floating issue and this is a lot better.

Out of curiosity, is there any specific reason you set the max players at 4? I'm guessing to not overfill the array, but you could expand that. Or does C2 send the full array if values are not used, and bandwidth is wasted?

Another topic, the next logical step for multiplayer games is to have a server database / user accounts. As far as I can tell this isn't do-able with photon. Theoretically you could do this with sql databases, but I'm not sure how secure that would be? What do you all think is the best option for this?


The array doesn't really play into the player count, I just set it at 4 because I was testing Photon for a game with a maximum # of 4 players. You should be able to increase it to any arbitrary number without having to make any other changes to support more players. With how it works now, if Photon finds room but they're all maxed out at 4 players, it creates a new room. If you increase the player count per room, it'll allow more players to join any available rooms before creating a new one.

As for DB/user accounts, I'll just be using Steam, which solves that issue. Otherwise you'll also need to do some server-side scripting to interface with the DB/custom user accounts.
B
57
S
33
G
13
Posts: 413
Reputation: 13,175

Post » Thu Jun 02, 2016 1:37 am

digitalsoapbox wrote:The array doesn't really play into the player count, I just set it at 4 because I was testing Photon for a game with a maximum # of 4 players. You should be able to increase it to any arbitrary number without having to make any other changes to support more players. With how it works now, if Photon finds room but they're all maxed out at 4 players, it creates a new room. If you increase the player count per room, it'll allow more players to join any available rooms before creating a new one.

As for DB/user accounts, I'll just be using Steam, which solves that issue. Otherwise you'll also need to do some server-side scripting to interface with the DB/custom user accounts.


Steam would work for usernames, though I haven't really see a game use it to keep track of in game data, (levels, items, etc). If we still had clay.io that would likely work, but as far as I know we don't really have a replacement for that. The problem with steam for me is if I want cross platform games, I can't use a steam DB on iphone.
B
55
S
22
G
11
Posts: 446
Reputation: 11,565

Post » Thu Jun 02, 2016 7:10 pm

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.
B
5
S
2
Posts: 128
Reputation: 889

Post » Sat Jun 04, 2016 6:41 pm

So I think I will try using firebase with this, I'll let everyone know how it goes once I have something.
B
55
S
22
G
11
Posts: 446
Reputation: 11,565

Post » Sun Jun 05, 2016 2:28 am

I was really interested in PhotonScirra SDK Plugin but without a documentation its useless.
How should we know parameters like Photon.ActorNr. Trial Error ?
How long is this released ?

edited:
I am sorry RTFM of C2 and JS SDK Doc helps alot :)
B
5
S
2
Posts: 6
Reputation: 433

Post » Tue Jun 14, 2016 1:42 pm

How do I sync bullets to other players? Let's say I want a player to press SPACE to spawn a bullet. :-)
B
2
Posts: 1
Reputation: 152

Post » Mon Jun 20, 2016 9:26 am

Heyy

This is a really great plugin, and do think their plans are quite okay.
Also very good support !

Used it in this game

https://play.google.com/store/apps/details?id=com.pauk.quizzbornholm

https://itunes.apple.com/dk/app/id1123295294?mt=8
B
27
S
15
G
10
Posts: 337
Reputation: 7,810

Post » Wed Jun 22, 2016 9:19 am

xyncron wrote:How do I sync bullets to other players? Let's say I want a player to press SPACE to spawn a bullet. :-)

What do you want to sync exactly? if bullet visuals, send event to others about bullet starting point and velocity. If bullet hit then send position of hit for visualization and/or hit result (damage e.g.)
B
5
S
2
Posts: 128
Reputation: 889

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest