Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SirMacJefferson · Dec 18, 2012 at 08:01 AM · networkingrpcnetworkview

Is it "bad" to use RPCs to synchronize movement?

I hear that RPCs can be slow if you're using them to synchronize player positions. People say to use NetworkViews instead.

However, my situation is a bit more complex... I'm using RPCs as "pings", which go to straight to the server. The server receives the ping, then sends an "update" to all other clients that need to know where the pinged player is. Those clients simulate where the player is by using a list of places that the player has to go, and having the player move through each position in the list one by one, kind of like following the same path the pinged player took. Each client keeps track of the last time it pinged its position, and only pings it if it's been so much time since then.

The way I've set it up makes it hard to just "start using NetworkViews", because I relied on the method of using RPCs to convert positions into 'orders'.

My question is, is it "bad" to do it this way? Will I experience a lot of lag issues if I had lots of players "pinging" their position and jumps and everything through RPCs instead of NetworkViews? If so, would it be best to use a NetworkView with Unreliable state synchronization for the best performance?

Thanks for any answers!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Dave-Carlile · Dec 18, 2012 at 02:15 PM

If you're sending them as "orders", then what you're doing should be fine. There are potential issues though, depending on what sort of game it is. Due to floating point rounding, execution order and such, it's possible that clients may simulate the movement slightly differently, which can cause all sorts of problems.

For example, when doing pathfinding, it may cause a character on one client to choose a different path from another client, and all of the ramifications that follow from that.

So, this may or may not be a problem for you. If only the target position matters then you're probably fine. If where the player is while moving to the target position matters you may have some problems.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SirMacJefferson · Dec 18, 2012 at 10:46 PM 0
Share

The game is an FPS, so I don't see many problems co$$anonymous$$g from rounding and such. The system works pretty well now, I just heard some people say that if one RPC fails to reach the target, then all others will stop until it's re-sent and received, or something to that effect.

avatar image Dave-Carlile · Dec 18, 2012 at 11:22 PM 0
Share

That is true - since RPC calls are guaranteed for both delivery and order, if once is missed they all queue up on the client while it waits for the missed one to be resent. This can cause some bad moments of lag. You should really use the NetworkView synchronization for an FPS game.

avatar image SirMacJefferson · Dec 19, 2012 at 08:54 AM 0
Share

Alright, looks like it's as I feared... Thanks for the help!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Networking Error! 0 Answers

OnSerializeNetworkView issus in my 2D game 3 Answers

Overloading RPCs 1 Answer

RPC not sending and not giving an error? 0 Answers

getting error with networkView 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges