Best way to Sync player positions?

What is the best way to Syc player positions?
Can you give me an example if you can? :smile:

Depends on what type of game you’re building.

FPS. Simple, just trying to see each player moving on screen :slight_smile: 5-32 people.

Ah, gotcha.

This is a problem which has been solved numerous times, by far the best write up I’ve found about the (best) techniques to solve this problem is from Valve software: Source Multiplayer Networking - Valve Developer Community

Read that, it will explain everything in more detail then anyone on this forum :slight_smile:

Thanks for this, but it isn’t really what I am looking for :(. I trying to figure out if I should use RPC calls to change player positions or other means. Basically, I do not know how to do it yet.

This is exactly what you’re looking for. It explains exactly what you need to do for synchronizing player positions in an FPS properly.

The small unity specific part you need to look into is NetworkViews and the OnSerializeNetworkView function. But other then that you need to do what Valve describes in the article.

You probably don’t want to use RPC’s if your using the built-in networking, because they can only be reliable. A fast-paced game like an FPS would be best served syncing movement unreliably, because its almost always changing anyway.

The example scripts NetworkRigidbody and NetworkInterpolatedTransform are a great place to start.

Hi guys , i figured i would jump on in this thread and see if i could get someone to explain this here …

So i have been reading that article, and right at the beginning , this is one of the quotes. I notice that Unity send rate is only about 9 times per second , with its default .15 setting. Does this mean its safe to assume you can turn that rate up faster signifigantly, or … was there something else i missed. I was sure in the forums i have read multiple times , cases where people say * do not increase the send rate… yet it would seem that Unitys send rate is nowwhere near as fast as the Steam article claims things are usualy sent at.

Networking newb here to most degrees, this answer could help me out a bit. Thanks guys.

The default setting is 15 times per second, and the general recommendation is to not change this value, unless you’re building a game that needs more and you know what you’re doing. Obviously if you’re building an FPS you are going to need more, so raise it.

Ahhh … thanks again FHolm , might seem a little naieve om my behalf , but i really wasnt clear on this. I have been rolling all my networking (in a FPS) with that default setting, and assumed i shouldnt change it all. Would you have a solid recommendation for say 16 player max LAN based game ?

Not really any recommendation, if you made it work with 15 updates/sec then stick to that imho. if you have problems with lag/aiming/whatever then fiddle around with the setting.