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 GrKl · Oct 28, 2014 at 02:09 PM · networkingmultiplayernetworkview

Multiplayer - networking without network view?

Hi all!

I am creating a procedural game (procedural/infinite terrain). No problem so far in single player. The terrain is chunk based, only a few chunks around the player are displayed of course, when getting far away from a chunk, it is getting destroyed and a new one is created.

The problems I have are limitation with network views. At least to my knowledge.

All child object of a terrain chunk (trees, rocks, enemies,...) and the chunk itself are destroyed when the chunk is far away from player. But: if another player is still on that chunk, he will send networkViews update to all players. But as others do not have those object any-more in their game, errors pop-up as those networkViewsIDs were removed from their game instance.

Thus I wonder how I could manage networking this type of game.

  • Should I completely stop using network views? But then how to communicate objects/players/enemies updates?

  • Should I use only one master network view for all network updates? Using rather complex RPCs from that network view to update all object/player/enemy manually. In that case I could maybe filter incoming RPCs to check if the update received concerns an object present on 'my' game instance. Or even find a way to send from the server updates only to players that will need it.

I know that this question might be rather complex, and of course I am not asking for a code to do it, just a reflection on how you guys would try to solve this case.

Hoping my English was good enough and that I was clear! Thank you all for your help

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

Answer by Anxo · Oct 28, 2014 at 03:37 PM

Sounds more like a logic problem than an issue with the network view component. Are you sending RPC calls to destroy the objects? If so you need to make sure RPC mode is set to server to avoid sending a message to all the players. RPCMode.Server. But why would one player ever want to destroy terrain in another players instance? Maybe when the player does something like mining where you destroy the terrain but just walking away from it should not destroy it for other players right? Keep as much local as you can. Now should you as far as the error is concerned, just check if the object you are trying to access is null before you access it.

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 GrKl · Oct 28, 2014 at 04:00 PM 0
Share

Thanks for your answer.

Yes, I do send RPC to destroy objects when needed (like when an object is 'killed')

Players do not destroy terrain (chunks) on other players instances. We agree on that :)

$$anonymous$$y problem is for example when player A cuts down a tree. I need players that have the tree loaded on their game receive update on that tree 'health'. But how can I send that information only to the players having that tree? Some players are too far away and don't even see that tree, so do not need to constantly receive its updates. Currently, the network view on that tree synchronizes the health status of that tree. But players not having that tree loaded receive an error as their instance of the game do not have that tree's network view loaded.

Sorry, I feel that I am still not verry clear...

Basicly, all networkViewIDs are not present all the time for all players. Isn't that a problem in Unity? From what I understand all networkViews need to be loaded all the time for all players. Is that correct?

avatar image Anxo · Oct 28, 2014 at 04:12 PM 0
Share

oh haha, well I would not put a network view on the tree that is not universal for all. The idea of the network view is that this is a component that all need to see. You could try having an object that manages trees which gets updated. So if a player gets to a location where a tree was cut down, the "Tree$$anonymous$$ananger" has that information , the tree manager is always updated, and exists on every instance, so even if people leave that spot and go back to it, the tree manager can tell another players $$anonymous$$m manager that this particular tree was already cut down when he gets there and generates it.

avatar image GrKl · Oct 29, 2014 at 08:43 AM 0
Share

Thanks, I see what you mean, ill try to do that, with just one 'master' network view to send RPCs to update trees.

But then, how would I work with GO needed to be updated 'constantly'? Tree was a simple example, but same thing applies to all my GOs. For my enemies, controlled by the server, should I then send an RPC on every Update (function) while they are moving/attacking? Isn't that a too heavy on network bandwidth?

How do they do those things in games like $$anonymous$$ecraft, cubeworld, or any other huge procedurally created games? Or at least, how would I do that in Unity?

Thanks again!

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

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

Related Questions

Unity networking tutorial? 6 Answers

What is the best way to properly implement shooting over a network? 1 Answer

Sending and receiving variables trough network? 2 Answers

Synchronize network view for transform children 1 Answer

Network View trouble. 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