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 S3TH 1 · May 16, 2011 at 06:24 PM · physicsrigidbodyoptimizationbreak

Best way to handle LOTS of potential rigidbodies?

So I'm building a rather large city in which I would like the buildings to be mostly destructable. The way I'm handling it at the moment is working fairly well but I'm not exactly a programmer so I wanted to see if I could be missing any methods of saving even more processing overhead.

At the moment I have a big static cube trigger in the exact dimensions of the building I need. I have a prefab of the same size tower that has been diced up into several hundred rigidbody pieces, (bound together with fixed joints) that spawns when the initial cube trigger is triggered.

When the player starts to destroy the building, pieces moving above a certain velocity spawn a one-shot particle cloud and destroy themselves which helps eliminate a fair bit of the overhead so far while remaining fairly satisfying visually.

Occlusion culling handles the initial trigger buildings pretty well.

So that's where I'm at so far. Perhaps I could limit the number of active rigidbodies allowed at any given time? Anything else? Even if you're not sure if it would work out visually I might be able to use it. I'm completely okay with "cheating" the way you would really expect everything to behave.

Thanks! -Seth

Comment
Add comment · Show 3
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 Peter G · May 16, 2011 at 11:19 PM 0
Share

Occlusion culling probably won't do much for Physics. It's a rendering thing not a Physics thing so it shouldn't stop calculations on your rigidbodies.

avatar image Peter G · May 17, 2011 at 03:07 AM 0
Share

Glad you like them. Don't forget to mark it the correct answer too though.

avatar image Linus · Jul 22, 2012 at 05:55 PM 0
Share

One thing you could look into is to use animations for the destruction of the buildings, to reduce the amount of physics calculations.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Peter G · May 16, 2011 at 11:26 PM

There isn't too much you can do if you must have all those rigid bodies. Increase the fixed time step if you can. That will reduce the frequency you have to recalculate the rigidbodies.

This would take some work to implement, but would definitely same some processing overhead. If you can, disable rigidbodies and colliders while they are falling. And manipulate the transform directly- basically just add gravity. Or at least disable the colliders.

Comment
Add comment · Show 1 · 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 S3TH 1 · May 17, 2011 at 02:20 AM 0
Share

Hey thanks for the tips! I haven't heard of increasing the fixed time step.. sounds good. I think I'll try the collider disabling as well and maybe when they collide with the ground have them spawn a couple collective "rubble piles" shrouded in dust for a moment.

Thanks for your help! :)

avatar image
0

Answer by Ericool · Apr 01, 2015 at 09:19 PM

The thing is that you can enable or disable any component at any time , that means that if you are not shooting or whatever , none is enabled , but if you are , then the approximate region of where the collision should happen objects will enable their component. In you case it will activate the building , that should enable all small cubes collider component . Also , occlusion culling is great , but also check for mipmapping , lightmapping . Try to reduce what is unused the most . Try work with simple statement , not repeating where not needed .

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

MRUA implementation optimization issues 1 Answer

Rigidbody.MovePosition performance 1 Answer

Is a collider that enables/disables considered stationary? 2 Answers

Broadphase CD in Unity - pile of rigid bodies unsolved 0 Answers

Add 2d rigidbodies to moving objects to increase performance or not? 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