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 nventimiglia · Dec 15, 2012 at 10:10 PM · networkingnetworkviewnetwork instantiate

Error from Serializing Non Network Instance

In my network level I am getting these two errors on client machines :

  1. View ID AllocatedID: 0 not found during lookup. Strange behaviour may occur

  2. Received state update for view id'AllocatedID: 0' but the NetworkView doesn't exist

After some searching I found view id 0. My level has a setup area where the player can instantiate pre-play player instances for viewing / configuration. view id 0 is on this pre-play instance. I am not using Network.Instantiate for this area at all... which really begs the question.

I have tried several hacks to get this to work. I have disabled the network view and set its serialization to Off. Neither work. Any theories or suggestions would be great.


EDIT 1:
I noticed I can resend the errors if I activate the pre-play instances. Its like Unity is sending the serialization data once on activation regardless if its a network instance.

Comment
Add comment · Show 2
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 Bunny83 · Dec 17, 2012 at 11:09 PM 0
Share

Btw, why you have deleted this question?

Since this question belongs to the same topic, here are some more points:

  • There is actually no network serialization, just synchronization which means values or states are transferred from the master(the owner) and updated on the slaves(all others).

  • Regarding your sequence, usually the server should tell the clients which level they should load. You usually use an RPC (or buffered RPC) to invoke the level load on the client.

  • Basically keep in $$anonymous$$d that objects which are linked with a NetworkView can't be manipulated / destroyed that easily since wou have to take care of the clones that exist on all other computers.

avatar image nventimiglia · Dec 17, 2012 at 11:27 PM 0
Share

I was mistaken. I had read about some old known issues and mistook my error for their error.

On a second look at my code I realized an error I was making. The instance had a script which deleted all RPCs for its network view. This call was removing the network instantiate rpc. I no longer use buffered calls.

Sorry about the confusion.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Dec 17, 2012 at 11:00 PM

There is nothing like a "network instance". Every player / peer has it's own set of objects. They are completely seperate. The only thing that actually makes a connection between two objects on different machines is the NetworkView. If two NetworkViews (on different machines) have the same NetworkViewID (which are unique across the network), they are "connected". The objects don't actually have to be the same. One could be a tree the other a car. That wouldn't make much sense, but it's possible without any problems.

There are actually only two basic ways how two NetworkView can be connected:

  • The NetworkView is placed in a scene and both, the server and the client, load the same scene. The NetworkViewIDs on scene objects are special. They are marked as SceneViewID. The difference to NetworkViewIDs created / allocated at runtime is that those are predefined and therefore both sides will use the same.

  • Using Network.Instantiate. Network.Instantiate will allocate a new ViewID for each NetworkView on the prefab you instantiate and it transfers those IDs automatically to all other players by sending an internal buffered RPC call which will instantiate the object on the client machines and assign the ViewIDs.

In both cases both peers have something in common. Either the scene, which has to be the exact same scene otherwise the networkViewIDs don't match up, or the prefab which also is the same on both sides.

If you want to avoid Network.Instantiate (which can cause a lot of trouble when it comes to removing objects due to the buffered RPC call) the usual way is to have one communication object in the first scene which establish a basic link between all peers so they can communicate.

You can use this link to send RPCs to other players and invoke the instantiation of certain objects. You have to allocate the ViewIDs manually with Network.AllocateViewID and pass those as parameters of an RPC call to the other players.

When you don't use buffered RPCs you have to "remember" each object yourself on the server machine and if a new client connects, send him the required RPCs to create all objects which are currently there.

Unity tried to make the whole Networking very easy, however because of that they sacrificed flexibility. Network.Instantiate does everything for you, but since you can't remove single buffered RPC calls it makes deleting objects way more complicated. If all buffered RPCs remain, a new client would have to execute ALL THOSE when he joins the game. Just imagine a game where you instantiate / destroy several objects per minute. When the game runs for one or two hours there are thousands of bufferd RPCs stored.

There are ways to implement a cleanup system using network groups, but it can get very complicated as well. Most people go for the manual approach and maintain their own list of objects and perform the instantiating manually on new clients.

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

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

AllocatedID error 1 Answer

Is server the sender of RPC? 0 Answers

A question regarding networking... 2 Answers

【PUN2】I want to disable the instantiation of an object in PhotonView at a specified time. 1 Answer

NetworkServer.Spawn Deleting Objects 2 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