Search Unity

Question Lag compensation for non-hitscan weapons?

Discussion in 'NetCode for ECS' started by vectorized-runner, Jul 3, 2021.

  1. vectorized-runner

    vectorized-runner

    Joined:
    Jan 22, 2018
    Posts:
    398
    I'm picturing this on my mind using the FPS sample video. Let's say we're at tick 85 on the client, and last received snapshot is for tick 84. With RTT of 6 ticks we want to predict until tick 93 for the player, and the enemies will get interpolated to tick 85, then we will sample input for tick 93 and send it to the server. When the server is receives the tick the enemies will be 93-85 = 8 ticks further away from the aimed position, so non-hit scan weapons could miss it.

    Is my understanding of prediction correct here and what's a good way to address this?

    Edit: Also could we interpolate the enemies until tick 93 in this case. What's the pros/cons of this?

    Another question, when running the prediction loop do we always simulate with the last received snapshot input?
     
    Last edited: Jul 3, 2021