Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Vosh · Jul 25, 2015 at 03:43 PM · c#networkingoptimizationphotonpun

How to network a large map with 4000+ movable objects using Photon Unity Networking?

I was wondering if anyone here knows how I could go about networking a fairly large map with several thousand movable objects using Photon Unity Networking. The standard approach to networking a movable GameObject with Photon is to add a Photon View component to it, enabling you to send RPCs to move it. Unfortunately, I can't add a Photon View component to each GameObject because, as far as I know, Photon limits you to a maximum of 1000 ViewIDs.

(Even if I could have more ViewIDs, simply adding a Photon View to thousands of movable objects doesn't sound very efficient.)

Each object moves when it is hit by a ray, and so I've experimented with dynamically adding a Photon View component to each object when it is hit by a ray so I can send an RPC to move it, then destroy the Photon View component once it has moved. This, however, doesn't seam to work.

The map isn't very large, and it is possible for a player to see all of the movable objects at once, so I can't disable things that are far from the player, for example. I presume that something like a multiplayer Minecraft clone would run into a similar problem, because it would need to somehow network thousands of dynamic blocks.

Perhaps someone with more experience in this area can shed some light on my situation. Any help would be much appreciated. Thanks for your time.

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 tobiass · Jul 27, 2015 at 07:53 AM

The concrete solution depends a bit on what exactly you need for your game.

Like you said, the simple approach with a script on each block isn't very effective. They all run all the time to check if they got moved and each sends it's info independent from the others.

Instead, you should turn this around: monitor what you hit. Come up with a way to identify each block and handle all the states of them in one script.

It sounds like you basically trigger a move and then are done with that block?

You can have a "map" for all blocks and when something is hit, you send that block's ID, so any client can move it.

If players can join while the game is running already, you need to send them the current state (in best case, send only to the new player).

A minecraft-like game is using chunks of blocks to sync. A group of X tiles belong to one dtataset with coordinates. Per chunk, you would send a set of bytes to know which tile has which material.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Player Won't Instantiate with Photon Unity Network [PUN] 0 Answers

Photon Network instantiate problem when Master changes 0 Answers

Sync string array Photon 0 Answers

Photon: I call PhotonNetwork.LeaveRoom() but my character doesn't leave 1 Answer

Photon Networking Spawn player 2 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