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 callen · Apr 28, 2014 at 04:28 AM · networkingtimelatency

How to measure network packet delay?

So my previous networking was done in XNA on Xbox Live, and their networking API included some built-in measures of latency (NetworkGamer.RoundTripTime for example). I'm assuming they can do this by using the Xbox Live servers... somehow.

I'm using Photon Networking now and I'm wondering how to get this, or any other reasonable approximation of latency from one player to another. I'm guessing there's no simple API call, so I'm prepared to do it myself - I just would like to figure out a good way how.

My google searches for "game networking latency measurement" and similar haven't led me to any concrete algorithm or anything. I remember once learning about NTP and I suppose I could do this to sync everyone's game clocks, then I could trivially measure latency by adding a timestamp to each packet.

Is this a good way to go about it, or is there something simpler, or is my solution missing something important?

Thank you for any help

Comment
Add comment · Show 2
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 Benproductions1 · Apr 28, 2014 at 05:07 AM 0
Share

Send a network message, asking for a reply, and keep the time you sent it at. On the reply, subtract the time you kept from the current time and you have your latancy.

avatar image callen · Apr 30, 2014 at 08:43 PM 0
Share

That's pretty much what NTP does, but also accounting for remote host's processing time. I do want to avoid having to AC$$anonymous$$ every msg received, and also want to track changes in the latency over time. But I guess after initially syncing the clocks with a few rounds of this at the start of the game, I can assume everyone's internal clock runs at the 'correct' speed and I can infer the latency from just a timestamp on each packet. I still don't know if it's the best mix of precision and bandwidth conservation though...

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Networking noob; how do I sync / time input with RPCs? 1 Answer

RPC or Synchronization ? 1 Answer

Client not rendering spawned objects when they are moving fast. 0 Answers

What to send when networking? 1 Answer

How do you get Network Emulation to work? 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