[Plugin] Photon Cloud

From the Asset Store
Clouds
$2.99 USD
30 Photoreal clouds from subtle to stormy. Perfect for multiple game genres.
  • Can I create an rts game in real time, controlling units, without lag? because with the original plugins of construct I was very bad.

  • Can I create an rts game in real time, controlling units, without lag? because with the original plugins of construct I was very bad.

    Have you read and understood the entirety of the informations in the multiplayer plugin's manual article and the accompanying tutorials ?

    Lag will always be present because you are dealing with networking and distant servers.

    The solution you are asking for does not exists, there is lag/latency even in big AAA productions nowadays.

    Using the tools provided correctly and understanding how to design around the limitations is the best way to go.

  • >

    Can I create an rts game in real time, controlling units, without lag? because with the original plugins of construct I was very bad.

    There is significantly less lag with Photon than using Construct's native multiplayer support. If memory serves, under high quality networking conditions Exit Games' says average lag is 6ms - which is less than a single frame. Based on experience, this is more or less accurate, and if it worked for me with a fast-paced multiplayer action game, it'll work just fine for an RTS.

    This reason Photon performs so much better is likely partially due to it supporting regional servers right out of the box so players, by default, only connect with those in their region, partially due to not being dependent on Scirra's multiplayer server (unless you set up your own), which requires some server-side knowledge and doesn't avoid the issue of distance unless you set up your own multiple regional servers, and just more optimized networking code in Photon. Photon also uses Websockets, which do not have the same platform limitations as Scirra's multiplayer solution using WebRTC (for example, Photon will work on XB1, while the built-in solution will not... though Construct performance is so bad you'd probably want to go with a 3rd-party native runtime like Chowdren anyway, or develop your game in Unity).

    Photon's actions and events are also easier to understand - and I'd argue far more useful for game developers overall, as their implementation is game-specific and not quite so bare bones as Scirra's - especially if you've never done any online multiplayer work in the past. The cost is also fairly minimal compared to using Scirra's solution with your own servers, which would really be the only way to get even close to the performance Photon can provide.

    Hope that helps!

  • Hi!

    I'm wondering how the "set properties listed in lobby" can be used to retrieve custom room properties from the lobby?

    As far as I understand, you have to set it to be accessible in the lobby in order to retrieve it from there.

    I tried doing it like this without it working:

    -Photon: is connected to a lobby

    Photon -> set name of local actor to "name"

    Photon -> join room "Room" in lobby (create if not existing)

    Photon -> Set custom property "theProperty" of my room to "testing"

    Photon -> Set properties listed in lobby to "theProperty"

    Text -> set text to photon.RoomProperty(photon.MyRoomName, "theProperty")

    The text as a result then says 0.

    ****EDIT*****

    I saw in this forum post: forum.photonengine.com/discussion/10574/set-via-room-setcustomproperties-not-available-for-roominfo-class

    that you have to set the properties before creating the room. But how is that possible in construct 2? The plugin doesn't have a field to pass room properties when creating a room.

    If I do this:

    -Photon: is connected to a lobby

    Photon -> set name of local actor to "name"

    Photon -> Set properties listed in lobby to "theProperty"

    Photon -> join room "Room" in lobby (create if not existing)

    (also tried create room action)

    Photon -> Set custom property "theProperty" of my room to "testing"

    Text -> set text to photon.RoomProperty(photon.MyRoomName, "theProperty")

    It returns 0 still.

  • Seems like the last bit I tried in the previous post does work, but only if you retrieve it with PropertyOfMyRoom, and not with RoomProperty.

    I can only retrieve the room property after one has joined the room, but not before, even with the "set properties listed in the lobby" before creating the room. Why's that?

  • Seems like the last bit I tried in the previous post does work, but only if you retrieve it with PropertyOfMyRoom, and not with RoomProperty.

    I can only retrieve the room property after one has joined the room, but not before, even with the "set properties listed in the lobby" before creating the room. Why's that?

    Properties listed in lobby is a parameter of room creation. So they should be set before room creation.

    Lobby provides the list of currently existing rooms for players joined to the lobby (not to a room). It also exposes room properties which were marked as "listed in lobby" during room creation. To get property value, you need to pass room name and property name to RoomProperty.

    Normally, client in a lobby should handle "On room list update" event which triggered by any room creation, closing and and "listed in lobby" properties values change.

    Currently plugin does not provide info on which exact rooms have changed (though Photon js api does). So you most likely need to rescan entire room list in lobby and read properties. Like demo-test does in addRoomToList function:

    - iterate from 0 to Photon.RoomCount - 1

    - get Photon.RoomProperty(Photon.RoomNameAt(loopindex), "level")

    If you call these methods while joined to a room, most likely you will get rooms state at the moment of joining to a room which does not make sense.

  • Hello guys,

    anyone could help me sync entities like enemys, objects, etc.

    This is what is needed : ( for the exemple i will take enemy i think basically it's the same for all other objects )

    - On room created --> init enemy with their own position.

    - On another actor join room --> update player "view" with current room state number of actual enemy / their position / life / etc ...

    - On enemy killed --> Destroy enemy and then respawn after x seconds to it's own spawn point and update it to all current player ...

    I know it's not a basic thing i was asking for ^^' ...

    So far i've made a pseudo sort of thing for update enemy position ... Something like :

    Every x.xx second --> Photon raise event x with *familyEnemy.X&|&*familyEnemy.Y payload to others, target "", group 0 (DoNotCache, forward: No)

    Photon on event x --> *familyEnemy set position to (*X pos = (int(tokenat(Photon.EventData,0,"|"))) , (*Y pos = (int(tokenat(Photon.EventData,1,"|"))).

    But that seems to doesn't work really well, when there is more than one enemy they was bugged as hell and all try to get the same position ... They also don't keep the enemy skin for each of them in the group *familyEnemy.

    I think it's because i don't take each Enemy separetly.

    If something was not clear don't hesitate to ask ^^.

    Thanks guys =D

  • Hi oOScuByOo

    You need to assign unique identifier to each enemy during creation and send it in position event. When event received, use this id to apply position to correct enemy.

    Also make sure that you run enemy logic on single client only to avoid concurrent updates.

  • Hey ThePhotons, is there a planned release of a Photon Voice API for JavaScript anytime soon? It seemed it is only available for Unity. Do you know why it didn't extend to Web or Cordova?

    Thanks for the time.

  • Hi ,

    Photon Voice API is pure C# solution. It can be used w/o Unity but only on C# platforms. We do not have plans for porting it to another platforms including javascript. There is a lot VoIP solutions for web including WebRTC. So I guess JS Photon Voice API would not be very demanded.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi!

    I don't know if this question was asked, but I haven't found any answers.

    Basic C2 multiplayer have very useful feature - object position sync. As far as I know photon doesn't provide similar feature. My own solutions - sending coordinates every second works bad and needs a lot of traffic.

    Could you help me to find proper solution to object position sync problem without learning true server-client communication manuals?

  • ThePhotons where is Construct 3 version of this plugin?

    Edit: I already find it inside zip file

    Thanks!

  • Hi,

    Before I dig into solving my issue I guess some of you already have a solution you can give me :)

    In the example provided with the fishes, their "type" (color) is based on random() when they are created. All fishes are instances of the same object, the type is a variable which determines which animation it will use. so they get different colors.

    But if I will make sure that every fish is different, lets say I have a room with four players, and I have four different fish types.

    Which is the easiest way of choose the type based on which fishes that are already in the room.

    I know some of you already have this set up, so I don't want to invent the wheel again :)

  • Hi fens,

    i think sending positions periodically and interpolating or extrapolating them is the best you can do w/o putting much effort in development.

  • Hi fredriksthlm,

    The task is easy if players never leave the room or always rejoin with old player id. In this case it's enough to assign animation according to index number in players list ordered by id.

    For changeable player list, you can maintain 'animation id' to 'player id' map in room properties. Joined player should scan this map and find 1st empty slot or slot with player id which is not connected (not in player list).

    To avoid concurrency issue when 2 new players trying to occupy the same slot, use expected value check feature (CAS, doc.photonengine.com/en-us/pun/current/gameplay/synchronization-and-state ): property update will fail if you do not provide correct previous value (happens when other player updated it few ms before).

    Don't forget to initialize all slots with 0 during room creation to allow CAS work for first properties updates.

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