ome6a1717's Forum Posts

  • Ashley

    It looks like if I do "set text to: Multiplayer.PeerLatency(Multiplayer.HostID)" it = ~0.6 to 3 connected in the same browser tab.

  • Ashley

    I'm just guessing at that number - what do you mulitply the Multiplayer.Latency by to get the exact number of milliseconds?

  • Ashley

    I don't think it's necessarily latency testing with 2 tabs, it's just the fact that I'm trying to set the position of the player animation sprite to the player collision box sprite and it's not 100% (so it looks like it's lagging 500 ms behind).

    We're just worried that if there is a bit of lag on the hosts end, the peer basically can't play very well. Our game in particular is more important that each player feels literally no lag in their character (it's co-op instead of adversarial). I completely understand where you're coming from, though. We're just not 100% sure on how to implement the sync correctly.

  • Ashley

    Every time the keys are released, I'm also re-syncing the position of the characters (so if the lag is bad, it'll look like the other character is jumping around, but you'll still be able to play fine). In theory, this should solve that dilema, no?

    Using sync with 2 tabs on the same machine is completely unplayable on my end. Anything pinned to a sync'd object is unbelievably behind the object it's pinned to, so if you're using a collision box sprite AND a sprite for the animations, I don't see any way to make them always line up (similar to if you pin something to an already pinned object: it will always be a bit behind)

  • The good news is that Yes, you can do a multiplayer game with C2 in real-time that works really well! The bad news is the tutorials are unfortunately the wrong way to go about it. Syncing ANYTHING seems to be a giant pain. I've had much better luck sending messages back and forth and updating positions for each player instead of sending the data to the host and resending it back.

    Something like this:

    On up Arrow down
    If Player.up_pressed = 0
    
    Set Player.up_pressed to 1
    Broadcast message "up arrow"
    
    On up arrow released
    Set Player.up_pressed to 0
    Broadcast message "up arrow off"[/code:1ji0osta]
    
    You then instead of "simulate jump" on up arrow, you check if the variable = 1, and then simulate jump.
    
    Obviously it's much more difficult from there, but with this idea both players play on their own game and the other character's position is the one being updated (instead of sending back and forth every tick).  Not to mention it's only sending messages on keystrokes instead of every tick which is MUCH less intense and should create much less lag.
  • I'm in the beginning stages of developing a co-op platformer (steam), and I have a few questions that I'm hoping some c2 veterans can help me on.

    1. Conceptually, I usually have 1 sprite (box) for the platform object and another sprite for the character. I then either pin the character to the platform box and everything works wonderfully. On the peer when connected to a host, the collision box runs fine, but the character sprite lags behind (similar to if you pinned something to an already pinned sprite). Is there a better way to do this in multiplayer? I have both the sprite and collision box syncing at the beginning of the layout, and I'm setting the position every tick.

    2. I'm only syncing 2 sprites and 1 instance variable from one of those sprites. To get my movement, I am using the "setbit" broadcast message way similar to the real-time example given by C2. There's not a whole lot going on in my game, yet the lag is ~600-1000 ms (I'm assuming you multiply peer latency by round(PeerLateencty*1,000?). The jump from the platform seems to vary in height when the peer jumps, as well, and the peer doesn't feel as smooth as the host (obviously). Has anyone else experienced this? Is it because of the wss server I'm using?

    3. The way I'm testing this game is by opening chrome, run the build, open 2 new tabs and run the build again (it opens 2 instances total of the game that one can host and the other can connect as a peer). Is this a poor representation of what I can expect, or should I be testing it a different way?

    4. I know the host has to send the peer all the information, but is there an easy way to let the peer send information to the host and then just update the position of the peer on the host machine instead (so for both the host and the peer, the other player will look a little laggy, but you'll be able to play fine on your own)

    5. The main question, and this is a big one - can C2 handle a real-time multiplayer game in its current state? (node-webkit export)

  • Everytime I try something like this:

    _______________

    / \ (the side angles being much much less than 45 degrees)

    I sometimes fall through where they meet. Is there an easier way to link of Jump-Thru obstacles so you can walk on them but then press a button to fall through them?

    *EDIT* I realize that didn't make sense... I'm basically trying to create a jaggedly curved path using straight lines ala /-----\ (only connected)

  • I bought the Steam version of Construct and am in need of transferring stuff from project to project. Due to the size of the projects, it crashes quite often, and because I bought it on steam, I cannot open 2 instances of the application.

    Ashley - Is there a way I can get a standalone version of C2?

  • eli0s - Yeah, it's a tough one. My original idea was to change the XLerp and YLerp the second you overlap the trigger, but the question remains; what do you set it to so it's smooth no matter what speed you're at? I looked at your example; it actually is pretty good, but has the opposite problem. Going INTO the trigger is fine, but pulling out is a little "jerky".

    Tokinsom - I thought about something like this, but everytime I look at equations like this, my head literally explodes.

  • eli0s - here's a rough example of what's happening.

    https://dl.dropboxusercontent.com/u/28104568/CameraExample.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • eli0s - the camera lerping is all fine and smooth. What happens is when you change targets, you get a "jerk" because the lerp value isn't changing. So I would have to change the lerp value but I'm not sure how to calculate it based on the distance.

    Maybe that helps making things clearer?

  • So I think I've figured out that using an updating lerp value (ie Camera.X and Camera.Y) might not be the best approach for this, but any other way doesn't feel smooth enough to me (also tried rex's moveto behavior). Any other suggestions?

  • If I do something like this:

    Set Position of Camera
    X - lerp(Camera.X, TargetX, XLerp*dt)
    Y - lerp(Camera.Y, TargetY, YLerp*dt)[/code:3q9voxjk]
    
    and I set TargetX and TargetY to Player.X and Player.Y, how would I retain the speed the camera is traveling if I decide to change the targetX and Y to something else so I don't get a jerk movement from the camera?
  • really great ideas here

    +1

  • Thanks lunarray; it was also the fact that I accidentally had the 2nd tier on the "start" action set to start from last recorded instead of current. Fixing that with enforce all works wonderfully now! Thanks again for such an amazing time-saving plugin.