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 MiniForge · Jan 10, 2015 at 10:11 AM · networkingmultiplayerloadingrpcloadlevel

Multiplayer Level Loading

In this example on the Unity documentation it explains that the sending of RPCs should be turned off while the server loads

 Network.isMessageQueueRunning = false;
 Network.SetSendingEnabled(0, true);

This works awesome for my server, however I am getting the following error on my clients joining the server

View ID SceneID: 9 Level Prefix: 1 not found during lookup. Strange behaviour may occur

Do I need to set Network.SetReceivingEnabled to false on clients during their loading, but not on the server?

Basically, does the server change Sending to false and client ALSO change receiving to false during client loading for it to work?

Comment
Add comment · Show 4
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 ByteSheep · Jan 10, 2015 at 12:38 PM 0
Share

The way I understand that example is that the server calls:

 networkView.RPC( "LoadLevel", RPC$$anonymous$$ode.AllBuffered, level, lastLevelPrefix + 1);

And this call is sent to all connected clients including the server itself. So all clients (and the server) execute the LoadLevel() function, which in turn disables sending and receiving messages for everyone until the

 Application.LoadLevel(level);

call has finished and sending & receiving messages is enabled again.

 Network.SetLevelPrefix(levelPrefix);

Is also called on all connected clients (including server) to make sure that all new network views will have different IDs than the ones in the previous level.

After that all local gameobjects are alerted that a new level has finished loading.

avatar image MiniForge · Jan 10, 2015 at 08:31 PM 0
Share

I understand that but I am running a join in progress game so not all players are loading the map at the same time. A person may join at 10 $$anonymous$$ in.

avatar image ByteSheep · Jan 10, 2015 at 08:46 PM 0
Share

You might want to have a look at Buffered RPC calls for that. Here's a list of the possible RPC$$anonymous$$odes when sending a Remote Procedural Call.

This topic unfortunately isn't as simple as setting is$$anonymous$$essageQueueRunning to false.. Here's a forum post on the matter that might help a little, but other than that it's essentially about making sure the players who join the game later receive all the necessary RPCs to be able to recreate the same state as the other clients (e.g. remembering which GOs were instantiated).

The error you received was caused by the fact that your scene didn't have a network view with an ID of 9 in the scene (most likely this GO was instantiated before the other player connected).

avatar image MiniForge · Jan 11, 2015 at 12:35 AM 0
Share

I already know all the buffered RPC modes. I have read through that forum post for the past week. Which is still not helping me. The only objects that have been instantiated were created with Network.instantiate which i thought were buffered RPC's. Actually, I just realized, there is one object that I haven't instantiated with Network.instantiate. I'll check that now.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MiniForge · Jan 11, 2015 at 02:06 AM

To solve the issue I needed my isMessageQueueRunning and isMessageQueue inside my level loading coroutine, not after it.

Comment
Add comment · 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

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

26 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

Animation over network using rpcs 0 Answers

How to use an RPC to send an animation over the network? 2 Answers

[Error] RPC function undefined in IRRELEVANT file? 0 Answers

Networking pattern for team-based play 1 Answer


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