Flash and PhotonCloud

I was looking to use PhotonCloud with Unity's 'Flash in a Flash' competition, these are some of the things I ran into, maybe the thoughts will be helpful to someone else.

There a couple different routes that could be taken:
Method A. Include the Photon3Unity3D.dll and let Unity translate it to ActionScript when it gets published.
This doesn't work though. It has trouble translating the code, I think it is because overloaded functions do not translate correctly, but there are probably more problems too.

Method B. Do all the networking at the Flash level by using PhotonCoreAS3.swc and use the Unity to Flash communication bridge to send information back and forth
This seemed promising, but I ran into 2 problems.
Problem 1 - Connecting to PhotonCloud
I couldn't get the example flash app demo_01_chat to connect to PhotonCloud.
Problem 2 - Connecting to a Lobby
Like InvaderDIM states in this thread, the current ActionScript library does not take Lobbies into account, there isn't a way to join, leave, or list them.


I decided to push ahead anyway but tried out a different networking method & service for now:
http://x-stream.ly/
The API is so simple that I found it really easy to work with, it has some ideas in common with PUN. One difference is sending JSON over the network makes it super fast to develop, but has a performance cost.
The end result is seen here, but not many people are playing multiplayer right now, and it requires 4 to start a new game:
http://www.InvinciBall.com/

Fast paced network sync really seems to need UDP and unreliable packets, so perhaps even if I could get Photon working with the Unity->Flash export, performance would be a problem since Flash doesn't support UDP anyway.

Maybe the best of both worlds is to make a single player 'adver-game' using Unity->Flash to get people interested, but do the actual multi-player game within a standard unity webplayer with Photon & UDP. Just some thoughts.

Comments

  • Method A: unity has no networking as per the developer preview as such the translation will always fail.
  • Hey,

    I'm also trying to get Photon Cloud to work with As3, but whenever I try to connect to the cloud like so:

    var server:String = "app.exitgamescloud.com";
    var port:int = 4530;
    var policyPort:int = 843;
    var appId:String = "I Insert My App Id Here";

    Photon.getInstance().initializeConnection(server, port, policyPort, appId);

    I immediatly get a "connection to server closed" PhotonEvent. Is it even possible to connect to the photon cloud with AS3?
  • Oliver:
    Doug was referring to Unity3d's flash export feature, not our AS3 library.

    Currently, the Flash library is not able to communicate with the Photon Cloud. We are finalizing for this right now and will release a new SDK soon (end of January, early February).

    Doug:
    Thanks for the info. We missed the contest but are eager to support the Flash export with Photon.
  • Well, his Method B uses your AS3 library as well, doesn't it :-)
    Anyways. I'm looking forward to this but sadly hat to switch to another approach to do networking for now.

    For anyone interessted in what I chose: http://www.adobe.com/devnet/flashmedias ... roups.html Very interessting project I was not aware of before.

    Have a good new year everyone.
  • I would also like to use AS3 with the new Photon Cloud.
  • We are waiting for the new as3 sdk with photon cloud support.
  • Just made a preview available and explained why we wait with a regular release:
    viewtopic.php?f=9&t=1355
Sign In or Register to comment.