Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Nomenokes · Nov 05, 2018 at 11:47 PM · networkingsynchronizationstrategy

Multiplayer strategy game advice

Hello folks,

I'm making a 2-5 player real-time strategy game and am looking for general advice on networking. I do not understand it very well and have had to rewrite so much code that I should probably get advice before continuing to dig myself deeper.


  • I would like some information on specific players stored independently of who is connected or who leaves in the middle of the game. For example, diplomatic relations. Right now, I have a helper object store all of that data and do a Command and subsequent ClientRpc whenever that data is changed by a local player. Is this a good idea or is there some other way?

  • Each player controls an army. There is some randomness in targeting and such. What calculations should the server handle and what should the clients handle, and what should be synced to/from who? Examples: moving, targeting, shooting. Again, I would like an army to continue to exist if their player disconnects.

  • If movement is handled by clients and synced, as to my understanding would be best, how should I sync movement commands given by players? If P1 tells their army to go South, and P2 is still calculating them to be moving North, that seems not ideal. Would SyncVar be a good solution?


Any input would be appreciated! Input that doesn't say "go read the documentation" would be appreciated more.

Thanks,

Nomenokes

Comment
Add comment · Show 1
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 toddisarockstar · Nov 06, 2018 at 02:14 AM 1
Share

if you intend to have several players each handling dozens of items, You are really going to need to come up with a creative way to sync your items and positions. So you don't overload your users bandwidth. proficiency in what you are sending is a Big challenge in the type of game you are talking about. Simply syncing all your items every frame is just going to give you a jittery laggy game if it even works at all. Generally speaking you send as little as needed. if your armies are "click to move" then you shouldn't need to update positions every frame. consider sending where the click was and who is moving there ins$$anonymous$$d. if you really need accuracy consider syncing items that are away from other players less often. can you get away with rounding off positions ? floats are much larger to send than ints. If your items general move in strait lines, consider just sending only the direction they are moving when it changes. of course an occasional position needs to be sent at the end of a "path" to keep everything in sync. most of this depends on your game and how big you wanna get. as far as you concerns about a perfect sync, no game is perfect.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by austinsun102 · Nov 06, 2018 at 12:11 AM

This video should help you: https://m.youtube.com/watch?v=-m28axeuRNs&t=578s∈dex=4&list=PLPV2KyIb3jR5PhGqsO7G4PsbEC_Al-kPZ

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 Nomenokes · Nov 06, 2018 at 04:31 AM 0
Share

Helpful, but not quite what I was looking for. That is about a simple FPS where each player only controls themselves, whereas I would like each player to control other objects.

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

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

Related Questions

Unity NetworkTransformChild - Syncing the Child of a Child 0 Answers

Network and GUI, moving objects from server not updating on client, but updating on host 0 Answers

Multiplayer - Parent's children not syncing 0 Answers

Who can setScope on networkView 0 Answers

HLAPI Networking Non-Player Scene Objects Missing 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