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 Sor · Dec 23, 2013 at 05:13 PM · instantiateloadleveladditive

Game Level question, instantiate or loadlevel?

I am nearing the final stages of a game I have been working on for a while now and have a question to the veterans here who can point me to a choice of how to handle my levels...

The game will have a large amount of levels through it's lifetime, more than 100+.

I currently have everything needed to play any level in a cache system that pools objects and makes good re-use of them without any destruction....

The level data, on the other hand is the question.

I have a few choices here, but am tending to lead to a simple instantiate of the game levels. The "level" is a prefab that hold gameobjects with a script on it that has a pathing system, movement info, points, etc. (anything the enemy or other game object needs to function in the game). These gameobjects are nothing more than the script, no other components. The top level gameobject has a script that reads the children and instantiates game objects for the gameobject children from cache based on time - it's a basic handler for what needs to be spawned at what time.

So - given that - for a mobile release app, would instantiate be bad in this case or should I really use loadleveladditive()? I prefer to not use loadlevel async because of the delays, as this was how the game was written in the beginning - to be seamless to the end user.

A single instantiate for the whole level "scripting" bad? It would be destroyed when a new level would need to be brought into the foreground, and thus it would destroy the root of the level and thus the gameobjects it holds (gameobject + script - nothing more / no textures, graphics, etc - nothing that needs to be pushed to the video buffer).

Alternative is to load a scene containing the same gameobject tree.

My worry with instantiate is that when levels get to greater numbers, 100+ how bad this will be on ram on the lesser devices. I have not crunced that numbers for all those Vector3's that it may contain (plus the rest).

Thanks for opinions - and if you are reading this and decide to look this up without prior knowledge, please refrain from posting "I looked this up" replies - thanks.

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
Best Answer Wiki

Answer by fred_gds · Dec 23, 2013 at 10:58 PM

So I didn't have a game with that many levels yet. But instead of loadleveladditiv you could also use loadleveladditivasync.

Are you instantiating with Ressources.Load() ?

if so, from my experience I prefer using loadleveladditiv to Resources.load as from my point of view I had the impression that loadleveladditiv was a bit faster then loading different objects from resources.

I also think that having different levels is easier to manage then one huge level, but this is only my experience.

So on the other hand it all depends on how many objects you need to load for the differentt level and also the size of the level. If the number isn't too huge you might wanna consider object pooling and activating/desactivating objects as this is much faster.

For the number of vector3s stored I don't think that it's really noticeable because every vertex is a vector3 and I can run over 2 million triangles on an iPhone 4S and each triangle contains 3 vector3s so there shouldn't be too many performance issues on that.

I hope that that made any sense what I wrote ;)

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

19 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

Related Questions

Checking if object intersects? 1 Answer

How to convert byte[] to GameObject? 0 Answers

Instantiate at run time or previously then make active? 1 Answer

How do I fix this error code: BCE0023: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(System.Collections.Generic.List., UnityEngine.Vector3, UnityEngine.Quaternion)' was found. 2 Answers

Instantiate as a child? 3 Answers


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