ThePhotons's Recent Forum Activity

  • arcadesindo

    Not really. The Javascript SDK is currently not in active development. If you are missing something that is implemented in other SDKs, please let us know.

  • It's applicable fot C3 in general but of course we don't have exact equivalents of the methods used in examples. The most important missing part is the server time (PhotonNetwork.Time). You need to implement the replacement for it, e.g. send ping message to the master client regularly, measure the lag and adjust the current time received in master client's reply by this lag.

  • hi 1mrpaul1

    Dou you mean that the client disconnects only when you are sending frequently? What's in your log? What if you send once per second? How large are your messages? Each message is an array of 3 floats encoded in json?

    10 messages per sec. should not be a problem for Photon client.

    The Photon plugin has "on disconnect" action in which you can connect again.

  • arcadesindo

    To keep master client active, you need to run game logic at least several times per second. But this is not possible while the page is in the background as far as I know.

    Actor properties is a convenient way of sharing per actor properties. You set some named value on one client and it's updated automatically (in "On actor properties change" condition) on all other clients. You can also use room properties to share per room values

  • arcadesindo

    Maybe you can handle loosing window focus and suspend or disconnect master client. After suspension, the client can rejoin to the room with the same ActorNr. After disconnect, it can only join as a new player.

  • arcadesindo

    Use master client as a source of time sync. When the current master leaves, the other client automatically becomes master. The client is master if Photon.MyActorNr == Photon.MasterActorNr

  • Hi XOPC,

    Use 'ActorCount' to get the number of players in the currently joined room.

    'RoomPlayerCount' returns correct value only when the client is connected to the lobby.

  • arcadesindo

    I added Ping button and 'On event 101' condition to demo-test. Sometimes round trip time is 0 probably because 'time' property is not precise enough.

    dropbox.com/s/bbl9nnzr3byrr18/demo-test.capx

  • Try Construct 3

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

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

    How large the lag is? You can't avoid network delay. You can only somehow simulate or predict object movement on other clients to make lag less noticeable.

    In any case sending coordinates on each frame is a bad idea. Instead, send coordinates and velocity each few frames and interpolate or extrapolate the position. Or better, send only next position target and let other clients simulate entire path between key points.

  • Pogi99

    When you need to measure the latency, send an event to yourself (TargetActors = "" & Photon.MasterActorNr) with the current time as a payload, then calculate the difference between current time and the time stored in incoming event in "on event" handler.

  • CROmartin

    Contruct events do not have parameters. To pass values to user code, I introduced variables which are set to event parameters right before calling user's handler. These variables are: ActorNr, EventCode, EventData, ErrorCode, ErrorMessage and a few others.

ThePhotons's avatar

ThePhotons

Member since 13 Feb, 2015

Twitter
ThePhotons has 7 followers

Connect with ThePhotons