logoalt Hacker News

bakiesyesterday at 6:12 PM3 repliesview on HN

Why wouldn't you just send the positions to both clients in the same tick? Seems trivial to solve.


Replies

Sayrusyesterday at 6:18 PM

Peeker's advantage is not directly related to fog of war. The peeker is moving so before the movement is even sent to the server, the client's camera began moving. As such, the peeker will have at least a tick, usually more before that new position is available to the opponent.

"Fixing" this would make movement sluggish: any movement would need to be validated by the server. Meaning delay between pressing keys and actual movement.

show 1 reply
dvtyesterday at 6:15 PM

"Same tick" is a misnomer for a few reasons. First of all, games use UDP, which is basically a "fire and forget" protocol (which means packets get dropped routinely). Second of all, realtime games use some interpolation/prediction to make up for latency (and aforementioned dropped packets).

So it's sort of a "relativistic" temporal system, not a linear "oh now you're at t=1, now you're at t=2" kind of timeline. And there's all kinds of complicated ways you create concensus between multiple clients, between server and clients, etc. (A lot of this remains an active research area.)

show 1 reply
ThatPlayeryesterday at 8:36 PM

That would have to include your own position on your own client. Adding a delay of the RTT of the worst latency in the server to your inputs

Some games still do this. RTS games notably, but hide it with mouse and sound effects. If anyone remembers the Starcraft 1 option of "extra high latency", it would work by increasing the delay.