PhotonEngine Help Needed

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Followed the Tutorial and got everything working but one small problem

    It says to

    Set Platform Enable[/code:2zhr8xt8]
    [img="http://i68.tinypic.com/35klqvl.png"]
    
    But I dont use Platforming I  use a addon called Spaceship
    
    [img="http://i66.tinypic.com/2i9i3h5.jpg"]
    
    And there no Set Spaceship Enable so what do I do is there a work around or fix or am I doing something wrong??!
  • Disable the default control of your spaceship behaviour and do this:

    --------------------------------------------------------------------------------

    On left pressed

    If ActorNr=Photon.MyActorNr --> Simulate control Left

    -------------------------------------------------------------------------------

    The line ActorNr=Photon.MyActorNr select the local client.

    Edit:

    Oh and replace the Photon.ActorNr by a Photon.MyActorNr or you will have some problems.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First of all i wouldn't recommend sending X & Y every tick through photon. It will create a lot of messages being sent/received. You can send X & Y every 0.1-0.2 seconds and lerp the position on the recieving end. Much more bandwith multiplayer friendly. Best is to only send X.Y at start and stop of movement, or any direction change. Also, you can send both X and Y and alot of other things in one event at once using arrays.

  • First of all i wouldn't recommend sending X & Y every tick through photon. It will create a lot of messages being sent/received. You can send X & Y every 0.1-0.2 seconds and lerp the position on the recieving end. Much more bandwith multiplayer friendly. Best is to only send X.Y at start and stop of movement, or any direction change. Also, you can send both X and Y and alot of other things in one event at once using arrays.

    Yes I agree with you. When I writed the tutorial I did not pay attention to that ^^'

    And I have not used the arrays to simplify the tutorial for the beginners.

  • Hey Sirvoid and tunepunk - quick question for you guys... is this a pretty common latency/lag scenario? I'm only sending X and Y every .3 seconds, and I'm sending it via a token:

    I know it's not TOO bad, but is there any way to tighten it up a bit more? OR in either of your experience, can you still have a great and competitive game session experience with that bit of lag? Or how would I work around it?

    Thanks guys - you guys seem to know a lot about Photon so I figured I'd ask. Sorry to resurrect an old thread like this.

  • Hey Sirvoid and tunepunk - quick question for you guys... is this a pretty common latency/lag scenario? I'm only sending X and Y every .3 seconds, and I'm sending it via a token:

    I know it's not TOO bad, but is there any way to tighten it up a bit more? OR in either of your experience, can you still have a great and competitive game session experience with that bit of lag? Or how would I work around it?

    Thanks guys - you guys seem to know a lot about Photon so I figured I'd ask. Sorry to resurrect an old thread like this.

    Hmmmm. For this kind of game i don't think i would send XY, except for adjusting positions.

    If movement speed is constant, you can just send for example on key press: Sending only move, and the direction. For jump, send jump, speed and direction, and when the character stops moving you send stop moving, along with the XY position of the place to stop at, so the position is synced. A little bit of lag you can't really escape, but for this kind of game i would limit messages by just sending, on key down, and key up, basically. No need to send every 0.3 seconds.

    The other clients would simulate exactly what the other player did.

    For bullet's I'm not really using real bullets with collisions. I'm using a raycast approach on fire, and only send the XY position of the origin of the bullet, and the end position of the bullet (an solid object hit), when the other client get's that informatioin, i just move a sprite between those points, and detect collisions simply by distance between bullet player < XX pixels.

    Hope that helps. If you have any other questions you can send me a PM,

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