

If the object is in the wrong place, the multiplayer engine will gradually move it to compensate. In other words, corrections are made looking at where the object was in the past, taking in to account the latency to the host. To correct deviations, the multiplayer engine looks at the object history and compares where it was 200ms ago. In the previous example, the peer receives their position from the host with a total delay of 200ms. The peer is still receiving messages from the host saying where they are, but the messages are delayed. There are lots of small errors that can accumulate in network timing, framerate synchronisation, delta-time measurements and so on. The peer's player will however inevitably drift off the position that the host sees them. Even if they hacked their local game, it only serves to disadvantage themselves, since all they can do is show themselves as being in the wrong place compared to the host. Then the player gets controls which feel responsive, and they still can't cheat: they are only sending their inputs, and can't pretend to be somewhere else. Instead, pressing left will send a message to the host saying the input was pressed, then that player's local game starts moving them anyway, without waiting for confirmation from the host! Since the host and the peer are running the same game, they generally match up pretty closely. To resolve this, the peer's local game uses local input prediction. This would mean all the peer's controls feel very laggy, only taking effect after a significant fraction of a second.
#Robotek multiplayer cheating update#
Then it will take another 100ms for the host's update with the new player position to arrive back. If a player presses 'Left' with a latency of 100ms, the host will receive that input 100ms after it was pressed. The immediate problem with this is that it adds a delay to all the player inputs. The host receives this and starts moving that player, and sending data back telling that player where it thinks they are. To mitigate this, instead the peers only tell the host their inputs, such as which arrow keys they are currently holding down. They'd simply need to suddenly send data saying they were the other side of a wall, or that they'd attacked a player they couldn't reach, and so on. If the peers told the host where they were and what they were doing in the game, and the host trusted them, peers could cheat.
