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 leonetosoft · Mar 20, 2017 at 05:57 AM · multiplayernetworktimecollision detectionserver-hosting

Creating an Authoritative Client and Server

Hello guys, Thank you for your time to come and read my question! I'm Brazilian, sorry for my English! I'm studying to be able to create a multiplayer war game between tanks, robots .. cars, I'm still not thinking about how the final project will be but I need to create the basic mechanics for this type of game. I currently work with web development but my very passion is specifically multiplayer games. My experience with games was the collaboration in projects of Server Emulators for Lineage2 / PB ... among others. I can say that I master programming languages ​​... logic etc.

I realized that: making servers for games with the client running is one thing, now creating the client and the server is being painful for me because I can not trust everything that the client sends.

I definitely can not: 1 - Receive the xyz position of a player and only broadcast to others. 2 - Accept that a hit on an object was successful.

To solve the problem of item 1, through studies I concluded that I need to make the server authoritarian, but I can not get a player to send a command and wait a latency to move, so I'll use the forecasting technique Of the entity movements, so I can make the move on time and then the server would send me a package to check the position and a possible reconciliation.

Do I need to make the player send the time of each event so I can also solve the correct item 2? Because I need to check if at any given moment the player who received the hit was in the place of the time it was hit ... because we have to know that each entity that the player is seeing may be 100ms in the past due to the delay of sending Of data ...

Now one thing I can not conclude is what time is it? Time.deltatime? This time should be initialized by who, server or client? What if the customer changed the date of his watch or something? How do I compare Time.deltatime to two players if they can be divergent ...

Thanks if anyone could refer me or even be kind enough to show me the light at the end of the tunnel ...

I already have functional gameserver to receive udp / tcp data and I also created a library in C # that connects to my gameserver ...

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 _Yash_ · Mar 20, 2017 at 06:15 AM 0
Share

Check this if you have not yet: https://developer.valvesoftware.com/wiki/Source_$$anonymous$$ultiplayer_Networking

I think every client should have an individual clock and don't rely on Time class of Unity you should have your own Time-management so that you can correct and modify time when needed. Yes, you have to send local time to the server which server will use to confirm the hit events.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by UDN_30011711-3d42-4608-a55a-5bf3a3109e16 · Mar 20, 2017 at 07:07 AM

Please try Photon for developing multiplayer game. You will get

https://www.photonengine.com/en-US/Photon

Here you get methods PhotonNetwork.time (Time synched with server) and PhotonNetwork.GetPing (Round trip time for photon serever ) .

OnPhotonSerializeView is there for synchronization .

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Running a script 24/7 on unity server ?? 0 Answers

Is live mode good for me? How to use external host?(Multiplayer CCU) 0 Answers

How to use an RPC to send an animation over the network? 2 Answers

Network just for 2 player 0 Answers

How to call [Command] on Client in UNet 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