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
1
Question by Waz · Oct 21, 2010 at 03:56 AM · networkrpc

RPC ordering - is it really preserved?

If two clients send an RPC message Foo to the same object, the documentation seems to suggest that these both go to the server, then are sent (in the same order) to all clients, including those who sent the messages. Is this what the documentation means?

I don't seem to get that result. To me, it seems that RPCMode.All actually sends the message to self out-of-order. i.e. it effectively tells the server to pass on the message to everyone else, but short-circuits the send to itself, thereby causing different clients to receive the RPCs in different orders (always themselves first if they sent it).

I've currently worked around this by first sending a proxy message only to the server and then having the server send the real message to everyone - I of course then get the expected behaviour, but I'd rather not have to double-up all my RPC calls.

Unity3, BTW.

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
0
Best Answer

Answer by Atnas1010 · Oct 28, 2010 at 11:05 PM

As I understand the documentation:

RPC calls are always guaranteed to be executed in the same order as they are sent.

It means that the RPC calls are always recieved in the same order on every client, if the RPC calls are sent out by one person.

As you observed, Unity is smart enough to "short-circuit" RPC's to self, and send it directly to the other clients. If it did it the way you expect it to, it would create a lot of "unnecessary" traffic.

Might I ask why you need the behavior you described in the first paragraph?

Comment
Add comment · Show 2 · 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 Waz · Oct 29, 2010 at 12:46 PM 0
Share

Each client gets to say "I hit X for N damage". Clients need to receive those in the same order so that the killing blow is attributed to the right player. Yes, I can use timestamps and buffers etc. as another alternative solution. The particulars of my game are such that it doesn't matter much who killed (but it DOES matter that all clients agree who killed). Certainly the docs could be clearer, not leaving "if sent out by one person" to our imaginations.

avatar image Atnas1010 · Oct 29, 2010 at 02:15 PM 0
Share

Couldn't you when you receive the RPC calls, look at the time they were sent, and from that decide who gets the killing blow? I haven't tested this, but I think it would work. It might have a short moment of confusion where the client says that he killed it, until he receives a message saying someone else did.

But it might be best solution making that part of the networking authoritative (as you are doing now)

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

No one has followed this question yet.

Related Questions

Can I use RPC calls in an Update function ? 1 Answer

Deleteing Objects created by Clients 0 Answers

Network - Killing Player, Then Respawn - Issue with RPC 1 Answer

List clients connected? 2 Answers

RPC a lot of lags (Photon) 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