Integration with Photon Cloud: Multiplayer

0 favourites
From the Asset Store
This is a simple login feature to access Metamask in construct 3. Requires a Chrome Browser and Metamask Extension.
  • This would be a great addon. The ability to communicate with Exit Games: Photon Cloud Service.

    http://ExitGames.com

    They have a Photon Javascript SDK.

    https://exitgames.com/Download/Photon

    I'm just not quite sure yet how to make the two communicate.

  • Taurian - Thanks for pointing to this! Interesting, and definitely worth figuring out how C2 might integrate with it.

  • I'm glad someone can see the benefit. I'll see if I can drum up some support on the other end(Photon) so that Scirra staff aren't alone trying to figure this out.

    But if you have any knowledge of Javascript, their JavaSDK and the Construct 2 SDK might be all that's needed.

    Easy Multiplayer = No Brainer

  • ... their JavaSDK and the Construct 2 SDK might be all that's needed ...opefully, yes. I'll try to find time in the coming week to take a look at the Photon JavaScript SDK (bearing in mind that it's still in beta and a few problems have been signalled in the Photon forum).

  • Taurian (seeing we seem to be the only two discussing this topic) :

    I have now managed to take a look at the Photon JavaScript SDK. As you indicated in the Photon forum (I'm assuming you're the Taurian over there), their documentation isn't very helpful in figuring out how it all fits together.

    However, I am managing to get my head around their realtime.html Javascript multiplayer map demo and have started exploring how it might be plugged into Construct 2. Going to be a slow process though, I think. As you discovered, the Photon people don't seem to be at all interested in doing something on their side. Pity.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was surprised with his answer, as they currently rely on the unity3d market for sales. I don't need to go into the details of why it's a great idea to make a photon-construct2 plugin. They'll come around eventually.

    CJR Gaming has been a real life saver with Photon. But it required me to learn a spot of C#.

    cjrgaming.com/photon_mmo_development

    It's the closest thing I've found to SocketIO.

    Javascript Multiplayer Map Demo

    I've never seen this before, didn't even know they had a Javascript demo. Was it in the Java SDK? If so, it's probably targeting the Photon Server(Hosted) and not their cloud (Which is still ok).

    I have quite a bit of experience with the Photon Server version so if you need some quick answers, that's definitely something I can help with.

  • ...

    Javascript Multiplayer Map Demo

    I've never seen this before, didn't even know they had a Javascript demo. Was it in the Java SDK? If so, it's probably targeting the Photon Server(Hosted) and not their cloud (Which is still ok).

    ...

    Yes, look for realtime.html in the samples dir. And yes, it does target the Photon Server(Hosted), but I'm hoping that a C2/Photon plugin that works on a self-hosted server would be an easy port to the Photon Cloud.

    Thanks for the CJR Gaming ref - I'll have a good look at that.

    And thanks very much for your offer of help with the Photon server itself.

  • Update: Continuing to work on a Photon plugin. I've put a stub plugin in a simple C2 grid/map game (well, not really a game, just a sprite moving round a 20x15 grid), then exported the code and took the C2 runtime.js and have begun to fill out the Photon function with code modified from the Photon realtime demo. Promising results so far ...

  • Keep up the good work! If its not too much, could you share with us a video of that in action?

  • Well i discover Photon reading this post ... multiplayers/achievements/leaderBoards ... all that seems really interesting and 100 users at same time for free is a good price too ;-p

  • Keep up the good work! If its not too much, could you share with us a video of that in action?

    I'll post a capx when I've got something worth sharing ...

  • Update: I now have more than just a stub plugin in a simple C2 constructed 20x15 grid.

    What I've now got is a PhotonPlayer plugin that's a modified Sprite plugin (ideally, it would be a PhotonPlayer behavior that could be added to a Sprite).

    It dynamically loads the PhotonPeer.Lite JavaScript interface to the Photon server running locally, draws the PhotonPlayer sprite on the screen (movable by arrow keys) and sets up buttons for 'connect', 'join', 'disconnect', 'leave' actions, which enable it to join a game in a game lobby. That bit works.

    To do next (the real multiplayer bit): enhance the plugin to send a PhotonPlayer's position via the server to another C2 grid in another browser and have it appear and move there (along with the local PhotonPlayer object), and vice versa.

    Questions/suggestions welcome!

  • That's awesome news. For the Socket IO plugin I send Comma Separated data. But I know the photon server uses Op Codes. We send data on a specific channel with certain parameters etc. Let me know if any of this rings a bell.

  • Taurian

    Thanks very much for your encouraging reply.

    Yes, your reference to Op Codes does ring a bell. I'll be using PhotonPeer.Lite.raiseEvent (eventCode, data ) to send the player's position to the server. I see the Photon JDK documentation says that its parameters are:

    • eventCode <Byte>   The event code (I guess this is the Op Code you refer to)
    • data <Object> A JSON object with the event data (so it uses JSON rather than CSV, as you mention the Socket IO plugin does).

    I'll certainly get back to you if I hit a snag.

  • Update: Well, I've actually now got a working experimental PhotonPlayer multiplayer plugin for Construct 2. Here's a tantalising unfaked screenshot:

    <img src="http://www.millercrawford.com/images-offsite/construct2/c2-photon.png" border="0" />

    ... and here's the C2 event sheet:

    <img src="http://www.millercrawford.com/images-offsite/construct2/c2-photon-events.png" border="0" />

    Yes, that's really all there is.

    I've got quite a bit of tidying up to do over the coming week, before the code's fit for public viewing. After that, I plan on releasing it as an experimental plugin for playing around with and giving me feedback.

    As you can see from the browsers screenshot, I have it running on localhost (WAMP server) - not yet the Photon Cloud, which was Taurian's original challenge.

    Watch this space!

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