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 devluz · Feb 04, 2015 at 11:53 PM · networkingmasterserverframe rate

MasterServer.RegisterHost causing a bad frame rate?

I am using unity networking for a network game. I am searching for a few hours for a reason for bad FPS and couldn't find anything until I changed something that looks completely unrelated. I run my server with the following lines using the default unity master server:

 Network.InitializeServer(8, mPort, true);
 MasterServer.RegisterHost(mGameName, mServerName, "");

10 seconds after calling this my FPS go down to a level that makes playing impossible. Removing the RegisterHost command fixes the problem. To test it I used an empty scene so there is not much that could cause this. Still if I use RegisterHost the FPS go down. What could be the reason for that? Maybe a bug in unity? Or maybe someone evil on the public master server tries to cause troubles? Has anyone a private master server and can test this?

I use a scene only containing this script on a gameobject + camera:

 using UnityEngine;
 using System.Collections;

 public class FrameRateTest : MonoBehaviour 
 {
     float mTimeSum = 0;


     float mAvgFrameTime = 0;
     float mFps = 0;

     // Use this for initialization
     void Start () {

         Network.InitializeServer(8, 54443, true);
         MasterServer.RegisterHost("testgame1234", "testserver1234", "");
     }
 
     // Update is called once per frame
     void Update ()
     {
         mTimeSum += Time.deltaTime;

         if (Time.frameCount % 60 == 0)
         {


             mAvgFrameTime = (mTimeSum / 60);
             mFps = 1.0f / mAvgFrameTime;

             mTimeSum = 0;
         }
     }


     private void OnGUI()
     {
         GUILayout.BeginVertical();
     
         GUILayout.Space(100);

         GUILayout.Label(mAvgFrameTime + " avg frame time");
         GUILayout.Label(mFps + "fps");

         GUILayout.EndVertical();
     }
 }
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
0
Best Answer

Answer by devluz · Feb 05, 2015 at 03:33 AM

This seems to be a known bug for years and no one seems to be interested in fixing it. This is a huge disappointment.

Here is the bug report: http://issuetracker.unity3d.com/issues/masterserver-dot-registerhost-causes-slowdown-after-10-seconds

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

19 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

Related Questions

are you sure the server can be connected to? 1 Answer

MasterServer with Unet ? 1 Answer

Connecting to server through IP. ? tutorial thats not local trash? 0 Answers

Unity 3D Networking questions (About master servers) 1 Answer

Network question, which server to use for MMO 2 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