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
1
Question by epicVoodoo · Jun 30, 2015 at 12:42 PM · networkingnetworkframeratenetworkviewlow fps

Decreasing FPS (Network)

Hi there!

I've noticed that my fps becomes much lower as a new players connect. So i've decided to to try Deactevate player (and creatures) gameObjects wich are Far from MY networkView. But i can't figure out how to reach this. So throw me an idea, please!

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

Answer by fuego_see_money · Jun 30, 2015 at 05:58 PM

Is the camera fairly static? 2D game? 3D game? For 2D games what I have done in the past is check and see if other players are visible in my viewport, and if they arent, ignore them. However this brings issues when a player runs quickly into your viewport, so what you should really do is check a little bit outside of the visible range of the camera, as well.

Lets say this is your viewport:

   P5
      __________
     |          |
     | P1       |     P4
     |     P2   |P3
     |__________|


Obviously you should track player 2. Some would argue to only track player 2...but player 3 is so close to you to the point that by the time his position is updated to your computer, he could have shot you already, and it would look like no one shot you on your screen. So you should really track players 3 and 2, and ignore 4 and 5 until they get closer. Your algorithm should do this, essentially:

 P5 ________________
   |   __________   |
   |  |          |  |
   |  | P1       |  |   P4
   |  |     P2   |P3|
   |  |__________|  |
   |________________| 

where the middle box is your actual viewport, and the outer box is where you still continue to update other players.

Comment
Add comment · Show 4 · 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 epicVoodoo · Jun 30, 2015 at 08:35 PM 0
Share

Thank's for your reply! $$anonymous$$y problem is in RPC's wich players send. When i hide players wich are far away from me, i can't track their position anymore as they send their position by RPC but they dont exist for me. So i can't figure out how to know how to activate these player's again when they come closer.

avatar image fuego_see_money · Jun 30, 2015 at 10:14 PM 1
Share

Hmm...I see what you mean. I have an idea though -

Using my previous example, you should change the way you update your enemy players based on how far away they are.

  • For P2, send and receive all data needed (position, rotation, animations, etc).

  • For P3, send and receive only position updates, because since he isn't visible, rotation and animations are not needed.

  • For P4 and P5, only send position updates once a second (or something like that). That way, you can still track when they get close to your viewport, and when they get close, begin to treat them as you did P3. And when they actually enter your viewport, treat them as P2.

Hope this helps, -Will

avatar image epicVoodoo · Jul 01, 2015 at 06:48 AM 0
Share

I've understood! It's pretty simple and it is exactly what i need:) Thank you, Will!

avatar image fuego_see_money · Jul 01, 2015 at 09:37 PM 0
Share

No problem! Anytime.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to sync position only one time, using Photon Networking 1 Answer

[uNet] Need help Converting From Unity Network to uNet 0 Answers

How to send UDP updates form server to each Client? 0 Answers

State synchronization non-functional after mode change? 0 Answers

Troubles with using NetworkViews on a server 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