Edit: i found that the problem was the ground-state not correctly setting when re-simulating from a server sent state.
As i dont know how to delete this thread, i have another question:
what do i do when the packet containing the jump-action gets lost (snapping back could mean walking off a cliff)?
Hi,
i recently tried to create a client side predicted multiplayer sample (with unity/Lidgren, simulated 200ms latency).
So far it works ok.
But at some points (kind of randomly) it seems to miss a 'jump'-action, gets corrected, thus glitching the token over half the jump.
i currently do it like so:
client and server start counting up their tick-counter when started.
30times a second client gets its input, sends it to the server (including the tick), applies it on itself and puts it in a list.
on the server i shift the tick according to the incoming number ( if difference > big amount: localtick = incoming tick, else tick++/--)
and move the server entity with the attached input
every 0.1 second i send the state back to the client with the servers (adjusted) tick
the client then resimulates from that tick with the inputs from its past-inputs-list.
from debug.logs i often see (on the server's side):
-intended tick: 259, current: 260
-intended tick 260, current: 259 (<-because i adjusted it before)
i guess that's where the problem lies. (the jump action is only 1 tick long). Though i'm not sure, and also not, how to handle this.
(I still consider myself a newbie)
here's a video which i hope shows what i mean (towards the end):