Multiplayer movement

I was trying to make an NPC that moves around equally in all clients. I though I could do this in an update function, calling an RPC updating its position but I want my game to support at least 100 users so my question is if there is a better way of doing this or if calling an RPC every frame wouldn’t change the max amount of users / lag more (which i am positive it wil).

I have a similar question.

I suspect that RPCs are “heavy” in terms of performance, since there are some delivery guarantees on them (lossless, ordered), but I have yet to find confirmation of this anywhere.

I see a lot of multiplayer games using RPCs as their messaging layer for player movement requests. This seems wrong to me on the basis that this is similar to using TCP as your networking layer (lossless, ordered updates) and that is not performant, nor will it perform well anywhere except for on LAN (because latency will hose you).

Interpolation and extrapolation is the keywords for smooth movement - and no dont send updates each frame.

1 Like

Sure, but how do you send the updates?

Do you use the Unity NetworkView or do you send your own packets?

I am not using Unity Networking, but would use Unity - Scripting API: Network.OnSerializeNetworkView(BitStream,NetworkMessageInfo)
i guess

The way to do this is to have a cyclic buffer which keeps over-writing itself, that you fill with the position/rotations you get from the server, and then you interpolate between the T-2 and T-1 latest snapshots (assuming T is the latest, so two snapshots behind).

http://www.boltengine.com solves all of this for you automatically, without the need to write any code.

OnSerializeNetworkView seams to do the job. Thanks every body.