New guy to the networking board here (although I have been blessed by the knowledge of the graphics boards before). I'm making my first networked game, and it's a 3d platformer. I'll be allowing players to jump on each others' heads, shove each other around, and in general physically interact a good deal - but they're just cubes, so it's rotation, position, and momentum. That's it.
So right now, I'm having my local game send my local character data of position/rotation/momentum to the remote game, where a copy character represents my local character in that remote game. So, it's a 1:1 of me in the offsite game.
Now I've got my local character, and the offsite player decides to take his offsite character and push it into the copy character. In local play, one character pushing against another leads to the pusher pushing the pushee around. In networked play though, the copy character is told to maintain that exact position based on the data my local game keeps sending about my local character. This leads to either no pushing or very slow pushing, because everything has to first go across the network twice before any real movement is made. That's bad!
So how can I fix this? If I don't send position, the momentum could ruin where they end up if any packets are lost. If I send position back and update my local character with data from the copy character, won't that overwrite my new controls/momentum/input that I'm sending locally? And if I just average everything, it moves at half speed.
The closest idea I have so far is that I should send the data both ways, but I have to be careful with my timing. Eg. I would read in the data sent back at the beginning of my game loop, so the first thing that happens is updates from across the network are applied, then I add my own changes with input, and then I finally send out that new broadcast of data at the end of the gameplay loop. But would that really work, or just lead to more cases of the players locking up against each other?