Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Edwardfmo · Jun 26, 2019 at 06:08 AM · editorsaveloadarchitecturesave-to-file

How to handle big world models in Unity

Hello Everyone,

I'm developing a game that has an extensive world model in the background:

 - Solar System #1
     - Planet #1
         - Building #1
         - Building #2
         - ...
     - Planet #2
     - ...
 - Solar System #2
     - ...
 - ...

A planet has different building types, has graphical representation (transform, mesh, etc).
Buildings are different, so I can not display them easily in the Editor as a polymorphic list.


My requirements are the following:

  • Being able to edit a Solar System in the Editor, save it into some loadable asset

  • Being able to have all Solar Systems in the memory as every now and then I need to make calculations on them to advance time, change population, etc.

  • Only 1 Solar System is displayed at a time.

  • Being able to save all systems into a savegame, restore it properly, even if the number of Planets or Buildings have changed.

  • Ability to handle ~100 Systems, up to ~10 Planets each, with ~10 Buildings on each of them.


My question is what kind of architecture should I use? I considered the following:

  1. Planets are Gameobjects, Buildings are MonoBehaviours on them. Solar Systems are GameObjects with the planets saved as Prefabs. Easy to edit in Editor, save to prefab, but I do not want to load ~1000 planets with transforms, meshes etc unnecessarily. Also game save/load is tricky.

  2. Planets are GameObjects, Buildings are Monobehaviours on them. Solar Systems are GameObjects with the planets, but they are saved into a text/binary file by an editor script, and can also be loaded from it. During Runtime I can load a Solar System as a lightweight model to handle the calculations on the unseen objects or as a displayed system. For save/load I can do the same: use the text/binary file as before. My problem with this solution is it feels like I'm not using Unity as it is intended.

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

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

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

Related Questions

JsonUtility : When I'm saving/loading to/from .Json, do I need a C# object for every child object of my .json file? 1 Answer

Is there any way to hide script fields outside of prefab that uses it? 2 Answers

exporting a 3d object i drew though the iOS platform 0 Answers

how to save and load component values from unity editor? 1 Answer

How to load data from this serializable class? 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