3 ms·
This is a surprisingly difficult problem. It's also what leads to a lot of cheats, dupes and hacks in online multipler games: you basically have to trust the cl
by jmyeet 4y ago
This is a surprisingly difficult problem. It's also what leads to a lot of cheats, dupes and hacks in online multipler games: you basically have to trust the client at some point.
The starting point for any such discussion is (as in this article) where all updates are done on the server. You then have to deal with packet loss and latency spikes but the real problem is subjective: it just doesn't feel good.
Imagine you're playing Fortnite and when you pressed your trigger you had to wait 50ms for it to acknowledge that your gun fired. That bullet has travel time so there may be another update if you hit someone.
So instead the client gives you immediate feedback and proceeds as if that shot actually happened. This may well include calculating if you hit the target. That target's position may be interpolated too, not the location you last got an update for. This feels way more responsive.
What if your target actually stopped moving after you shot. You get into an ordering canondrum. Now imagine if shooting that shot had recoil (which could affect both aim and position) and getting hit moved the target (eg getting hit by an explosive of some kind).
Doing all of this when latency can easily be >100ms and having it feel good is incredibly difficult.
- charcircuit 4y ago>You then have to deal with packet loss and latency spikes And fake packet loss and latency spikes introduced by cheaters. For example, when a cheater gets killed they could send a packet from the "past" saying that they killed the other person first.
- hypertele-Xii 4y agoSeems entirely trivial to notice the pattern of lag spiking exactly at the moment of the kill.
- charcircuit 4y agoYou can do it with a constant offset. This allows the client to see into the future while taking actions in the past. If you learn that in 100 ms you are going to be headshot you can take actions while in the past to save yourself.
- hypertele-Xii 4y agoAnything that is "constant" is equally trivial to detect statistically. To hide the fact that you're always lag spiking 100ms when you see an enemy, you'd have to lag spike randomly all the time, quite a lot, and then you're asking for a kick for low ping.
- no_time 4y agoAh memories. This was rampant in the late 00's. Soldering a physical switch on the ethernet cable to cut the internet at the most tactical times... https://youtube.com/watch?v=5gE-ihY_EG0 https://youtube.com/watch?v=5gE-ihY_EG0
- amelius 4y agoIsn't this more or less the same problem as cooperative editing of a document?
- actionfromafar 4y agoI think it's exactly the same.