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 bombardier · Apr 16, 2012 at 01:14 PM · memorymemory management

Memory management with extreme amount of data

I am creating a universe with billions of galaxies. Each galaxy has billions of stars. Each star has its own set of planets and other orbiting objects, each planet having their own characteristics (mineral and atmospheric makeup, orbits, moons, possible lifeforms, etc.)

However to even have a one dimensional array tracking just the name (in floats) of 1 billion systems:

1 billion elements * 8 bytes per float = 7.45 gigabytes of memory

So unless I am missing something pretty fundamental this is impossible. The only possibility I can think of is not having the entire universe loaded into memory, but loading the local area that the player is working on into memory from a file. I don't have much experience with this kind of structure. There would be an awful lot of reading from file, loading it into memory, making the changes, then overwriting the source data, loading entirely new section of data, wash rinse repeat. As far as the visual aspect of it, I was just planning on having the thing that the player is working on visible, so there would be very little requirements there.

Is this a bad idea? Are there any examples of games that deal with such extreme amounts of data or is it just outside the boundaries of whats possible?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by DamienSturdy · Apr 16, 2012 at 01:18 PM

I think you may be approaching this from the wrong angle. What you are looking for may be something more like Elite, where the entire system is generated randomly. It's based on a fixed Seed so the generated systems are reproducable, but then you have functions that, instead of reading an array or a file, return a random value.

It's a little more complex than what I'm saying but this is probably how you should approach it. It'll reduce your dataset massively.

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 bombardier · Apr 16, 2012 at 01:32 PM 0
Share

Thank you for the response. Im not sure that would solve my problem. There will be a lot of things going on outside of the player's view. For example, intelligent life in a distant galaxy that player may not contact until very late in the game. Over the course of the game the computer player has been developing as a species. Wouldn't this require that all of this was created at the beginning, and not the result of a random value generated? The computer would have to know there is an AI at this location that will be acting?

It probably doesn't sound like this comment is making much sense, I will take a look at Elite. I hadn't considered using a seed and I like the idea of being able to reproduce games.

avatar image zz74b · Apr 16, 2012 at 01:51 PM 0
Share

It sounds very much like you are wanting to script various aspects of the gameplay. Which would mean that you can't use a randomly generated universe either.

I would suggest that maybe you need to rethink your requirement to have 'billions' of star/galaxies etc. Even with just 1000 stars, how long would your player have to be playing to visit them all? Realistically how long do you think a player will play before they get bored?

I'd maybe focus on having a few cleverly scripted, interesting places to visit that mean that you can look forward to some meaningful progression.

It sounds a little like you are creating a maze, with no end, that you expect to keep people interested?

avatar image DamienSturdy · Apr 17, 2012 at 11:34 AM 1
Share

[Whoops, this post got a bit muddled up- sorry!]

avatar image
1

Answer by DamienSturdy · Apr 17, 2012 at 11:34 AM

You can still random generate if you are scripting. You'd need to be very careful with your random gen code, but you'd have a stable system afterwards. This said, you would need to script your game around the generated system. Developing species is more of a story thing- don't expect to create an AI that genuinely develops itself whilst the player gets through the story.

OR, Create your "Fixed" parts of the system, and Randomly generate the rest- the parts where no story happens.

FOr positioning AI that "moves" with time- You should perhals invoke the random generator in such a way that at X universal time, the AI is at random place, but at Y Universal time (which should be significantly after X), the AI is at - for all times in between, use a bit of tweening to get a position between these two points. This way the AI will appear to move between points as time progresses, without you needing to worry about their actual position.

Good luck.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Memory Allocation Continues to Grow? iOS. 4.6.3 0 Answers

Keeping assetbundles in memory vs always loading from cache 1 Answer

Unity3d crash when I don't use debug log 1 Answer

How many instances of a Object are handled in Unity 1 Answer

Asset bundles using double memory! 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