I recently gave a shot at adding multiplayer support to my game using unity’s networking system. Progress has been really good, and I’ve got enemies and players properly synchronized over the network.
I’ve implemented client-side interpolation of the transform of networked objects so they appear to move around smoothly. A side effect of using interpolation is that I’m now rendering these objects 100 ms in the past (i’m buffering 100 ms worth of network updates that I use for interpolation).
However, this 100 ms visual delay is a bit of an issue when I throw in some RPCs for one-time events such as “this object died” or “missile exploded” because these RPCs get executed right away when received on the client, while the object’s visual position is still lagging 100 ms behind. For instance, a missile hitting an enemy would explode first and only 100 ms later would you see the effect of the knock-back force applied to this enemy by the server.
I haven’t gone that far in implementing network support to my games before, so it’s a bit of a new area to me and I would be curious if some of you could share how you solved this particular issue, or how you approached your network implementation in your own game.
Thanks!