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
1
Question by Abraham1532002 · Sep 29, 2017 at 01:56 AM · unity 5online

How an Online Server Game Works?

Hello.

my current problem is that I have some doubts about the term of an online game, if I want to get an explanation of how this works when uploading to the web and being executed by many users at the same time.

My main doubt is when a user run my game is created as a copy of my game only for him, this doubt arises because I do not want everyone to appear on the same terrain, if I want to create it separately, I have the idea of ​​storing some id that identifies the game variables of each in its own PlayerPrefs.

Another question is whether an online game uploaded to a server should be the same for each, then if user A could access user B's variables, right? I ask because I want to add an action to attack another user and therefore I need user A to enter the combat area of ​​user B and I do not know if it is necessary to have to use a network system because the same game is going to be used by all, so I do not know if I can add a simple multiplayer system and that's it.

First of all I apologize for my complete ignorance of the subject, but this is the first time that I will be something like this and I want to do well and without doubt of what I do. I look forward to your help and above all thanks.

Forgive my English.

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 AshwinTheGammer · Sep 29, 2017 at 06:49 AM

There's one authoritative version of the world held on the server. But various tricks are used to make sure the client machines are not waiting on the server before displaying action.

Each client machine sends a regular stream of packets to the server, where each packet would contain a simplified update of the player's inputs. Each tick, the client might send a mouse position, or keys pressed. This is a low bandwidth stream.

Simulation code takes these input streams, simulates motion and resolves them into character / vehicle positions. This simulation can run both on the server and on the client.

Having received the input packets, done the simulation, the server sends out packets containing an authoritative version of all the client's positions. In most cases this will precisely tally with what the client thinks.

These client positions only relate to mobile objects. All the static objects are never updated.

From a programming point of view, we need to cope with latency. In the time it takes for the message to arrive, things will have moved. To cope with latency, server code has to play tricks with time. When someone shoots a gun, we have to consider what they were pointing at back at the point of shooting, and not looking at the world state now.

In the majority of cases, the server packets will reconcile with simulations performed on the client. But when the two disagree, the server's version is considered authoritative.

In the client-server model used by Quake 3 - the server does indeed sends back positions for every character every tick. In some more modern architectures, the traffic can handle more players by updating some clients less frequently.

This talk on the networking of Halo Reach describes such a solution

Comment
Add comment · Show 2 · 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 Abraham1532002 · Sep 29, 2017 at 11:51 AM 0
Share

This means that it is the same game for each user so I can access the variables stored in a PlayerPrefs from another user. Thank you

avatar image AshwinTheGammer Abraham1532002 · Sep 29, 2017 at 12:00 PM 0
Share

Your Welcome !

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

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

Related Questions

Unity Online Not Work 2 Answers

Making and hosting a multiplayer online unity game. 1 Answer

Is it possible to either Clone or Re-Send a UnityWebRequest? 2 Answers

Using ServerChangeScene("scene") wont spawn players in new scene. 0 Answers

Unity Multiplayer Limit 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