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 Kelhedros · Sep 20, 2010 at 07:00 PM · networking

Sync large amount of variables via Network

Hello Unity Answers,

I currently have a script that has a large amount of Static variables. It basically is a repository of data that controls almost everything. I am wondering if there is a simple and fast way to sync this scipt with 8 computers. There is 100ish variables, and most are strings.

Thanks, Kelhedros.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by IJM · Sep 21, 2010 at 01:14 AM

Why do you need that? On 60fps, with say 250 chars per string it's ~11.5MB each second. (Download and upload)

What are you trying to do?

Comment
Add comment · Show 1 · 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 Kelhedros · Sep 21, 2010 at 11:07 AM 0
Share

I can't exactly say, but it is kinda like a emulator for a certain type of machine. But the strings are used to cause other things to happen. I guess I could make another set of ints and use them as IDs or make some kind of file to store data and then set the values based on an int id. That would reduce the load on the network greatly. Or do you have a better sugestion?

Also would reliable sync only sync the changed values? Becuase I only change a few at a time.

avatar image
0

Answer by PrimeDerektive · Jan 01, 2011 at 04:41 PM

You should look at your game and make sure these variables need to be synced (for example, if they are used to make an AI move around or something, are you sure you couldn't just do all the calculations with those variables on the server, and just sync the results to the clients?

Also, if you absolutely have to sync them, is it necessary that you sync them every frame, or could you get away with only syncing them once every second, once every half second, or even once every tenth of a second? For instance, I sync the health of my authoritative AI enemies from the server to the clients with an invokerepeating rpc every 0.25 seconds, and its about 8x less bytes/second than every frame, and the difference in gameplay is negligible.

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

Answer by jc_lvngstn · Mar 25, 2011 at 05:52 PM

My thoughts: I'd have a class where I call a SetValue method, which maintains the list of variables and their values. It would track each variable, and flag when its value has changed.

Then, I would have a Sync() method that sends only the values which have changed to the clients. This might or might not be what you are looking for though. If you want more info, I'd be glad to give more details.

On a side note...it personally annoys me when someone asks how to do something, and gets "Why are you trying to do this?" Guys, at least assume it's for a good reason and give an idea of how to accomplish his original question, instead of asking the OP to justify his question and just leaving it at that.

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

No one has followed this question yet.

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Who owns NetworkViews placed in the editor? 1 Answer

Photon Network Pong Game 0 Answers

Making camera follow a prefab in network multiplayer mode 1 Answer

How to control exteranl web page elements RPC 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