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 urbanizator · May 28, 2017 at 01:43 PM · networkingdisconnecttimeout

Unity High Level Api Random Disconnect

I'm making a multiplayer game and we get randomly disconnected after a while. I think its because of the 4608B/s limit but I'm not sure.

My current usage is this:

I call a ClientRpc 15 times per second on the server, which sends it to N clients.

The parameter for the Rpc is an array of structs. The struct as the following properties:

 struct update {
     public GameObject target;
     public Vector3 position;
     public DeltaVector3 rotation;
 }

A DeltaVector3 is again a struct that looks like this:

 public struct DeltaVector3 {
     public sbyte x;
     public sbyte y;
     public sbyte z;
 }

Given this information, that ClientRpc should use per second:

 N x (SIZE_UPDATESTRUCT + HeaderOverhead) x 15 Bytes per second

To calculate the size of the update struct I'm using:

DeltaVector3 is 3 bytes. A vector3 contains 3 floats so should be about 12 bytes. I don't know how much the hash for a gameobject is, but I'll randomly guess its 4 bytes.

That means the size would be 3 + 12 + 4 = 19. The maximum ip header is apparently 60 bytes, so we'll calculate worst case. That brings this rcp to N x 79 x 15 = 1185N bytes.

Then we also need to bring the deltas from the client to the server so each client sends a command 15 times per second which has a Vector3 delta and a DeltaVector3 rotation as parameters. So that should give N x (60 + 12 + 3) x 15 = 1125N Bytes

So our total usage would be 2310N bytes, divided by N clients gives 23100 bytes. This should be well within the 4608 bytes we get each second.

I'm using a few more commands and rpcs but they rarely get called and with rather little data.

Am I making a mistake in my logic?

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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity Local network always disconnects after ~1053 seconds 0 Answers

Unity3D network disconnects on idle (VR Game) 1 Answer

is LLAPI bandwidth limited? 0 Answers

Network disconnect player 1 Answer

Errors shown when server tries to send ClientRpc to a client who just disconnects 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