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 heeblestruts · Jan 17, 2012 at 11:33 PM · networkinglagtrees

Trees make my network game lag?

I'm making a FPS multiplayer networked game just for fun, and I wanted to put a forest in the level. That worked fine, but now when I run it and there's lot of trees around, the network starts to lag horribly. My computer is definitely up to the task, and it plays perfectly in the editor, but when I start to use the network in the build version, the trees make it almost unplayable. Any ideas?

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 Owen-Reynolds · Jan 18, 2012 at 01:50 AM

Are you using "network spawn" to make the trees? If so, that's a lot of data being sent each frame (position/rotation/scale for each tree.)

As long as they are spawned in the same places, the trees probably don't need to be continuously synched up between clients -- each client can Instantiate them normally. To get the same locations, have the server pick spots and send to everyone using something like (from memory) NetworkView.RPC("spawnTree", x, z, RPC.All);. SpawnTree instantiates at x,z and height(x,z).

Comment
Add comment · Show 3 · 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 heeblestruts · Jan 18, 2012 at 02:34 AM 0
Share

I added the trees to a terrain using a brush, so they shouldn't be syncing to the server, right?

avatar image Owen-Reynolds · Jan 18, 2012 at 04:08 PM 0
Share

Ah. The Terrain->PlaceTrees button? If your terrain doesn't have a networkView, (and why would it) there's no way they should be able to be sending any data. Still, checking Stats/Network would tell you if it really is a network problem, or something incidental.

Only other suggestion is to jack up all the tree distance/max sliders in single-player, to check it isn't simply a problem with too many trees (if you're running both players on the same machine.)

avatar image heeblestruts · Jan 18, 2012 at 07:02 PM 0
Share

Right, so I think I figured it out. Whenever I play it full screen, the framerate drops like a rock, but if I use the same settings with the game in a window, it plays just fine. $$anonymous$$ust be something with Unity or my graphics card, so I'll try to figure it out.

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

Trees greatly reduces FPS 1 Answer

Unity Network Transform delay 1 Answer

Reduce Lag (trees) 1 Answer

Unity 5.2 Unet, extreme Lags after updating from 5.1 1 Answer

How Do I Reduce Lag in my Networked Game? 5 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