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 Vifi · Apr 21, 2021 at 07:43 AM · arraysdatastructure

Data structure with 1 bilion possibilities but only around 200 actual objects

Hi, i wonder if you can help me.

I want to divide my scene into a lot of small cubes. Lets say 1000 x 1000 x 1000. But i will deal with only a couple hundreds of them... all others will be empty. In addition i don't want to iterate through that couple hundred to find the one... i have three nice intigers which i belive i can use to point that object. My first thing was just three dimensional array int[1000,1000,1000] which i would access by those three intigers nicely like object = array[2,5,7]. But this array would be really big and i don't need it entirely. List would force me to iterate to find the object. Dictionary, i think it also iterate through keys to find the object.

Do you know some way to manage it optimally?

Thanks in advance and have a nice day!

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 xxmariofer · Apr 21, 2021 at 08:40 AM

the most optimally way of doing is using an array, and there is nothing more optimal, but you are right, working with a 1 billion size array.

You are expecting to add 1 billion gameobjects to an scene? because even using DOTS seems too much.

Its imposible to give you the perfect solution or advice without knowing why yoyu need the cubes and why only a couple hundres are not empty.

You should check some tutorials on how minecraft load cubes with "chunks" https://www.youtube.com/watch?v=t4Rw2v5iQl0

Comment
Add comment · Show 2 · 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 Vifi · Apr 21, 2021 at 09:19 AM 0
Share

I am building 3d heatmap and every position has to be registered in one of those cubes. That's why i need to cover all the scene box with those and i will probably use only a couple hundred.

avatar image xxmariofer Vifi · Apr 21, 2021 at 09:31 AM 0
Share

I understand your issue, I once did something "similar" but nothing near the 1 billion objects. I started using objects, but it was imposible to handle and i changed to particles, the performance benefit was inmesive. I used a 3d camera and created a pointcloud map. there are some assets (that i have never used) that look promising and more visually appealing, check this video

https://www.youtube.com/watch?v=Z6gDH7cy7_M

in the description you will find an asset

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

117 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

Related Questions

LoadImageIntoTexture function on webplayer 0 Answers

How To Disable, Not Deactivate All GameObjects In Array 1 Answer

How to instantiate a random object from an array? 3 Answers

AudioClip Import Order Randomized? 4 Answers

Problem with 2+ of the same scripts on the same object and functions 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