Photon plugin for multiplayer games in Construct 2

0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • 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.

    <img src="http://img27.imageshack.us/img27/8377/ctgt.png" border="0">

    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.

    <font face="Courier New, Courier, mono"><font size="2">

    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

    </font></font>

    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...

  • Thanks for this! Can't wait to try it out <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Will it works with Mobile Devices ? That means Android and IOS Apps.

  • Will it works with Mobile Devices ? That means Android and IOS Apps.

    lmgtfy.com

    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!

  • 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 ?

  • 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 don?t know its limits.

  • 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 don?t know its limits.

    2 updates per second :\ ?

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

  • > 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 don?t know its limits.

    >

    2 updates per second :\ ?

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

    It's not fast enough for multiplayer, but 2 updates per second is more than enough for turn-based.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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?

  • 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?

    yeah I upgraded my race game at my first dable with socket.io in the last two weeks Tank Racer

    Features things as player vs player racing, and a battle arena with deathmatch and team deathmatch.

    The data communication is really fast.

    I have a dedicated vps hosting behind it where I build my own nodejs server from source and a super simple application to handle all my games if I so desire :)

    And no, I have no experience with photoncloud. I am curious about it though :) Your command structure seems worked out, and decent.

    would be great if you took a glance at construct 2's current socket.io plugin and perhaps enhance.

    Certain details of your command structure are missing in the socket.oi one I believe ;)

  • Why i cant minifying the script?

    i love this plugin

    but i want minifying the script

  • fongka2 You can try the new built-in Multiplayer of Construct 2, it seems very similar to this plugin and might support minify

  • Can you make that plugin changed "appid" through actions?

    It would be very useful. I really miss this feature for my project.

  • Interesting. Is this plugin still maintained?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)