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 TheRichardGamer · Jul 27, 2015 at 12:37 PM · c#networkingmeshphoton

How do I sync a mesh over network? (Photon)

So basically, I have a minecraft clone or whatever you want to call it, and I've made it possible to connect to rooms and play with other players, but I have a big issue: The world isn't synced. And what I mean by that it isn't synced, is that whenever a new player comes into a room which already has a player or more in it, that player that just went in gets a completely different world from the rest of the players, so ultimately, players have their own different worlds. Now I can't quite figure out why this is happening because I've set a photonview on the Chunk-prefab but that doesn't help, and yes, I've attached components to the photonview. I don't know what to do to achieve the desired effect.

So, let me explain to you what effect I want to achieve: I want players to be able to be playing in the same world based on the hosts world, so if the host gets his or her world when he or she starts the server, players joining the server will have the exact same world, and I want it to continue to be synced so whenever someone destroys a block, it gets synced to everyone else. So basically I just want a synced minecraft world.

Oh, and I just want to give you some piece of information regarding the chunks and world:

The chunks are blocks from the beginning but later they get modified into a big mesh that makes it look like it's built up of blocks, and all the faces that will never be seen on the mesh until someone destroys a block, are transparent. This is to increase the performance of the game. The world-script is set up so that whenever someone pass a certain distance to an empty chunk, the chunk gets spawned in.

Also, I'm using Photon (free) for my multiplayer and I have Unity 5 installed.

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

Answer by 334499p · Jul 27, 2015 at 06:40 PM

Make sure that the world is being generated with a seed using perlin noise or just Random.seed. When connecting to the masterclient request the seed integer and generate the base world client-side. When the world is loaded you could request the blocks that have been edited which would be stored in the chunks in the masterclient. Each chunk could have a giant string stored in a script that has all of the edited block positions and ids for that chunk. When the newly connected client receives the string from each chunk they would have to splice and parse each value and adjust each block accordingly. When a player edits a block they would rpc the block's position and new id to the masterclient which would add the values to the string in that edited chunk for players who join later. A separate rpc would adjust the new blocks in realtime for all 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

22 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

Related Questions

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

Variable Sync across all clients (Photon) 0 Answers

Destroying entire parent object on one client but on the other destroying just the child. 1 Answer

Using lerp to smooth network movement causes rubber banding 1 Answer

Photon - Hide/Show Object 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