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 Rokas666666 · Jun 07, 2020 at 12:21 AM · optimizationloadinggameobjectsmany

Loading many gameObjects

I am making a version of minesweeper in unity, with my own twist: instead of seeing the entire map, you control a character which sees little and tries to get as far out as possible. For this project, I need to generate a lot of gameObjects that are tiles. Currently, it isn't too difficult to load around 10,000 objects (approximately 2 seconds of loading time). However, my goal is to ideally have maps in the millions and I was wondering about the best way to do this. My best guess as to how I can reach such large map sizes is to generate the map real time. From what I've seen, unity just isn't able to handle such large amounts of objects. However, because all of the gameObjects are simple and can pretty much be described in unexplored, explored, marked and special, I hope there is a way to optimize loading times much more easily, as I am not well experienced with unity. From what I tested, it seems like the loading time comes pretty much just from the amount of objects, not how complicated these objects are (I'm sure that I can make slight optimization with code, but it doesn't seem anywhere close to enough).

Comment
Add comment · Show 1
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 ShadyProductions · Jun 07, 2020 at 12:22 AM 0
Share

Why don't you use, unity tilemap system? Then all you need to do is chunk the tiles, and render only the chunks around the player.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by UnderShad · Jun 07, 2020 at 12:42 AM

The Tile system you want does not need gameobjects but Unity have a inbuild tile system where you can create your own tiles. See unity official tutorial https://www.youtube.com/watch?v=fmNtibNWPhc

But if you still need that many gameobjects you can have a scripts that reuses the gameobjects as you move around the map. See polling https://www.youtube.com/watch?v=tdSmKaJvCoA

Also Creating millions of gameobjects also means that you want to travel much further from origin where float precision limitations can mess up your game. There you have to create an illusion of infinity by relocating map to origin See https://www.youtube.com/watch?v=OaYPBSM_Uu0 After some distance everything goes back to origin. Hope it helps

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 Rokas666666 · Jun 07, 2020 at 03:02 PM 0
Share

Thank you for your suggestions. I have tried to use tilemaps, but had no success with them. I do not know if they can handle several functions to be placed upon them or if they can render different sprites (after opening a tile, it needs to change to show how many $$anonymous$$es are around the tile). I might try them if other solutions fail. Using object pools seems like a decent idea, however, it appears to be for loading new objects over and over again. I want to keep a path of your journey, in case you want to go back, so I'll have to still keep some objects. This suggestion might still help though. Currently I plan on simply generating the map where you are going and keeping where you went, while destroying what you have not explored. If performance becomes an issue, I might check this out. I do not know what "much further" stands for, so I hope it is more than 1000 on the x and y axis. 1000*1000 is one million, which is my desired map size. I doubt creating the illusion of infinity will work here, because I want to go back if possible.

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

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

Related Questions

Many objects - optimization 1 Answer

Optimizing Procedural terrain 2 Answers

DDMS error code.PVRSRVAllocDeviceMem. android game, Crashed. 0 Answers

Best way to save the postition of 800+ GameObjects? 1 Answer

Optimize performance of simple survival game 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