Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Wolfrik_Creations · Oct 16, 2016 at 04:52 PM · optimizationgameobjectsbatchingplaymodeoptimizing

Optimize Having Thousands of GameObjects

Okay, I know this question has been answered before, but it's always something like "Just batch it," But I have thousands of trees, rocks, and plants that are harvest-able in my game.

As of now, when loading play-mode, it takes about twenty seconds, that's completely unacceptable.

I have another part of my map which is 10x bigger, and I need to fill that with trees and rocks as well, but I cannot merge these into one object, they all need to be cut down by the player.

This is not a performance issue, I have plenty of things controlling its scripts, but it's a loading issue. Entering play-mode takes twenty seconds, and I still need to fill the rest of the map as I said before.

So, if anyone could please help me with this, it would be greatly appreciated!

For now, I have a developer world that is just a plane with a couple objects that I can test stuff in, this takes about 1-3 seconds to load.

Thanks in advance!

Comment
Add comment · Show 5
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 Lilius · Oct 16, 2016 at 05:12 PM 0
Share

Do you have everything active in the beginning? If so, split your scene into small parts and activate them when needed.

avatar image Wolfrik_Creations Lilius · Oct 16, 2016 at 05:20 PM 0
Share

Yes, but the odd thing is that if I disable every tree, rock, and plant in the game, it still takes 20 seconds.

Someone told me that Unity sort of rebuilds every object in a virtual scene when you play it, so I think it would include the disabled objects. (Correct me if I'm wrong.)

avatar image Lilius Wolfrik_Creations · Oct 16, 2016 at 06:18 PM 0
Share

When I think again it probably has to load a lot even if all objects are not active but it should have some impact. Is the load time still that big when you build and run the game?

You could try to save the little parts as prefabs and instantiate them when needed. I haven't tested that with that big levels though, but I believe the big games load the scene from disc part by part as you proceed in game. $$anonymous$$aybe there is a better way than instantiate, but you anyway might want to split your scene to smaller parts by some logic.

avatar image Cherno · Oct 16, 2016 at 07:19 PM 0
Share

Do you really have to have all those GameObject present at all times? Would it be possible to load them in and out of memory, when the player is near them/looks towards their direction?

Also, do all these objects really have to be seperate? If you have 100 rocks which are individually harvestable, couldn't you have one "rock manager" object which contains the harvest-specific data for each rock (I guess something like damage and $$anonymous$$erals left), and represent the rocks via one mesh (possibly chunked if you go over the 65k vertices limit)? If the player picks at one rock, the rock's id would be used as the key to a dictionary on the rock manager which returns the rock data as the dictionary value.

avatar image Wolfrik_Creations Cherno · Oct 20, 2016 at 04:35 AM 0
Share

Sorry for the late reply, but yes, I do have to have them present at all times, and the game already uses a decent amount of memory.

How would I do the rock manager and tree manager thing? that would save my life!

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

62 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 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Batching objects with Instantiate for optimization 2 Answers

Reading input outside of Update or some other ticking system 2 Answers

grouping graphics 0 Answers

UI Image is more effecient than UI Text? 0 Answers

Large # of gameobjects run smoothly or alternative? 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