Photon plugin for multiplayer games in Construct 2

Post your completed addons to share with the community

Post » Tue Dec 24, 2013 5:10 am

This is my Photon Cloud plugin, a simple plugin that I made for a small multiplayer game that I will play with my friends.

"Photon Cloud is a fully managed service of Photon Servers. Exit Games is running servers in several regions, ready to use anytime. No install and no hosting operations for you.
The Photon Cloud uses a room-based approach to gaming: A limited number of players get together and update each other with in-game data like positions, etc. All of that is client-driven. Currently, the Photon Cloud does not allow any custom server logic. The client APIs offer simple but powerful options for matchmaking and data exchange for real-time gameplay."
more: Understanding Photon Cloud.

How to test it:
1. Download my photoncloud plugin and install it.
2. Get the PhotonCloudDPluginTest.capx and open it with Construct2.
3. Export the project as a HTML5 website without minifying the script (preview will give you an error).
4. Open with your browser and test it.

Yes, this demo is not a game, multiplayer games are definitely advanced things.
5. Please, get an account with ExitGames for a personal 'Aplication ID'. It is free and offers 20 concurrent users.
Change the appId value in the 'runtime.js' file in the folder of the photon plugin installed.
( with a Text Editor find the line 53: var appId = "your appId here"; )
Optionally you can replace the default masterAddress with your nearest PhotonMasterServer.
6. You are ready. Try developing a multiplayer game.

ACTIONS                 CONDITIONS                 EXPRESSIONS
                      On connected, On error       ClientError
Set name              On room list update          RoomPropsList
New Game              On join room                 MyPlayerIDinRoom
                      On player join               PlayerJoinedID, PlayerJoinedName
Quit Game               On player leave            PlayerRetiredID, PlayerRetiredName
Send message by event   On message by event        LastMessageBy, LastSenderIDby

I hope to provide useful descriptions, english is not my first language. Any correction is welcome.

Files:
Plugin photoncloudD.zip
https://www.dropbox.com/s/ko8qrwqttu9hcnw/PhotonCloudDPluginTest.capx

It seems that PhotonCloud now is called PhotonRealtime...
Deko2013-12-28 19:42:40
B
3
S
1
G
2
Posts: 8
Reputation: 866

Post » Tue Dec 24, 2013 2:41 pm

Thanks for this! Can't wait to try it out
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Tue Dec 24, 2013 4:40 pm

Will it works with Mobile Devices ? That means Android and IOS Apps.
B
11
S
2
Posts: 93
Reputation: 917

Post » Tue Dec 24, 2013 5:49 pm

[QUOTE=PlasmaGames2013] Will it works with Mobile Devices ? That means Android and IOS Apps.[/QUOTE]

http://lmgtfy.com/?q=http%3A%2F%2Fdoc.exitgames.com%2Fphoton-cloud%2F

Words are fun! So is reading the posts that have the information you're asking about already linked to.

@Deko - VERY cool! Gonna be testing some realtime performance in a game tonight!digitalsoapbox2013-12-24 17:50:29
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Post » Tue Dec 24, 2013 6:14 pm

Looks nice, the command structure is very similair to that of socket.io :)

Is it fast ?

I upgraded my game last few days, here , with socket.io and a nodejs server.

Is it as fast/faster then that ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Tue Dec 24, 2013 8:11 pm

@TwinTails, @PlasmaGames2013, @digitalsoapbox, @lennaert: You can try it out, and give feedback to us. I want to encourage to tell me if you found any correction in the descriptions.
Bear in mind that the official Photon SDK demo-particle just sends two updates per second. I dont know its limits.
B
3
S
1
G
2
Posts: 8
Reputation: 866

Post » Tue Dec 24, 2013 8:13 pm

[QUOTE=Deko] @TwinTails, @PlasmaGames2013, @digitalsoapbox, @lennaert: You can try it out, and give feedback to us. I want to encourage to tell me if you found any correction in the descriptions.
Bear in mind that the official Photon SDK demo-particle just sends two updates per second. I dont know its limits.
[/QUOTE]

2 updates per second :\ ?


with nodejs I had to kick it in the b*lls cos it was giving me relay speeds of 10ms ^_^
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sat Dec 28, 2013 7:11 pm

[QUOTE=lennaert] [QUOTE=Deko] @TwinTails, @PlasmaGames2013, @digitalsoapbox, @lennaert: You can try it out, and give feedback to us. I want to encourage to tell me if you found any correction in the descriptions.
Bear in mind that the official Photon SDK demo-particle just sends two updates per second. I dont know its limits.
[/QUOTE]

2 updates per second :\ ?


with nodejs I had to kick it in the b*lls cos it was giving me relay speeds of 10ms ^_^ [/QUOTE]

It's not fast enough for multiplayer, but 2 updates per second is more than enough for turn-based.
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Post » Sat Dec 28, 2013 7:52 pm

I used Ajax and PHP previously, and made a semi live stream multiplayer game: Tank Wars

Without plugins, from a mysql database by means of ajax, I got like 4 or 5 updates per second.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sat Dec 28, 2013 8:18 pm

I ought to clarify. Photon can do more than two updates per second. @digitalsoapbox - I am making a turn-based game so I don't know its speed limits.
@lennaert Surely Socket.io+Node.js is better but only for advanced users. Do you know statistics for photoncloud?
B
3
S
1
G
2
Posts: 8
Reputation: 866

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests