how do i implements lag compensation in construct(with photon)

2 favourites
  • 10 posts
From the Asset Store
language.translate
$11.25 USD
25% off
Implement multi-language translation inside your game effortlessly with the language.translate plugin!
  • hi guys, does anyone know how to implement movement lag compensation?

  • like lag interpolation

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hel yeah i do, which one do you wanna know ?

  • I was thinking of the lag interpolation, that is to mask the packets of lost data with a lerp between the old position and the new one,I tried to implement it in my game, but I think I’m making holes in the water, if this can be helpfull here is the capx: mega.nz/file/KxVW2aJI

    anyway, i was thinking to change engine for this problem

  • if you were wondering why I haven't answered you yet, it's because construct is taking ages to approve my message, anyway I have decided to change engine so no problems

  • dang.

    godspeed

    edit: I'm banned and can'T post anymore, contact me through my profile, or I guess we could chat through me editing this post ?

    basically you use time and like, check the difference in time between two positions and the buttons the players were pressing and you can calculate where they are going to be in the future, or save inputs and the time they occured so you can move time backwards to see if you punched them when you sent a "punch you" request to see if it actually hit them, like there's tons of things you can do !!!

  • hey eleanorjmorel, i know, i said i would leave construct, but i couldn't get this problem out of my head, do you really know how to do lag interpolation on contruct?

  • bump I also would like to know

  • I was thinking of the lag interpolation, that is to mask the packets of lost data with a lerp between the old position and the new one,I tried to implement it in my game, but I think I’m making holes in the water

    I'd do this at a very low value (like 0.05) but also send "simulate control" events to the other clients. That way, even if the movement is a bit off, it will compensate for that.

    "Left Arrow is down" then send Event 1 with "Left"

    "Right Arrow is down" then send Event 1 with "Right"

    "Up Arrow is pressed" then send Event 1 with "Up"

    On Event 1

    >Photon.EventData = "Left" then Simulate Control "Left"

    >Photon.EventData = "Right" then Simulate Control "Right"

    >Photon.EventData = "Up" then Simulate Control "Jump"

    Every tick lerp Player.Position to Player.NewPosition

  • wow man you saved me, I've been looking for a solution for days and days😲 thanks.(it works well btw)

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