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
3
Question by RealMTG · Mar 12, 2015 at 01:03 PM · scenescene-loadinglevel

Multiple scenes or one scene for all game levels?

Hi!

I am planning a game that will include a lot of levels that can be quite big and some quite small but I started to think about something. Would it be best suited for me to use like 30 scenes for each level of the game or use one scene and then somehow load each level into that scene? What would be the best when it comes to best performance?

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

Answer by incorrect · Mar 12, 2015 at 05:11 PM

That depends on type of game you are going to make.

If it's something arcade-like with lots of levels with some variations, making a single scene for gameplay and initializing it with different parameters can help you to be sure that there will be no particular levels where you've just forgotten to add some scripts or objects and their relations, which leads to accidental bugs. Obviously that way does not help when your levels have not much in common.

On the other hand, making each level to be a separate scene gives you two benefits:

  1. You can make each level absolutely different in comparison to other ones.

  2. Sometimes it's easier to make lots of levels manualy.

So if to compare this two methods:

  • Making levels as scenes is a straightforward way which takes long time to do and gives you lots of monotonous but easy work to do

  • Making levels as one scene and initializing it with different parameters is a more reliable way and can save you lots of time if you will find a way to generate those levels quickly, but implementing initialization system is a bit trickier in comparison to 'lots of scenes' method.

So you should consider if single-scene method will give you enough benefits, otherwise it's easier to spam those scenes for the god of scenes! :)

Comment
Add comment · Show 9 · 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 RealMTG · Mar 12, 2015 at 06:29 PM 0
Share

Thank you for this information! I will probably do the multiple scene method since the levels can be quite big and uses a lot of audio components and such.

avatar image incorrect · Mar 13, 2015 at 12:06 AM 0
Share

@Real$$anonymous$$TG, but keep in $$anonymous$$d that one day you'll have to implement some automatic initialization systems. The day when you'll give up on trying to fix or adjust tons of levels. :)

avatar image RealMTG · Mar 13, 2015 at 09:58 AM 0
Share

Three words to fix that. http://tinyurl.com/q3qp5u3

avatar image incorrect · Mar 13, 2015 at 08:06 PM 0
Share

@Real$$anonymous$$TG, prefabs only help to make levels to have something in common, but will do nothing to make difference. :)

avatar image Nikunj-Kareliya · Aug 06, 2015 at 12:59 PM 0
Share

According to me, choose 2nd method in which all levels contains in single scene, which is better in terms of performance. I am messing around since some days. In my game, all levels having blocks in certain pattern, so I made each level to prefab then added into 'Resources' folder. Then runtime I load levels whenever needs.

avatar image flckev Nikunj-Kareliya · Feb 10, 2020 at 06:02 AM 0
Share

i'm still wondering how do you load to next level if you only have 1 scene, i'm still trying to figure this out

avatar image Eluem flckev · Sep 11, 2020 at 05:37 PM 0
Share

You have to come up with a system yourself to handle loading the next level. You need to come up with some way to store a description of the level and a level initializer that has a way to interpret those level descriptions and instantiate all the objects that make up the level. Essentially, making your own scene loader.

It's just more efficient because you have more control over what's being loaded and unloaded and you can implement inter-scene object pooling. If you blow away everything in a scene and need to remake it, you can't benefit from object pooling when it comes to loading a level in.. and you might get a big frame drop caused by garbage collection at some arbitrary point after loading a new scene.

It's also less bug prone as you don't need to go through every level and make sure it has all the right scripts in place, as indicated above.

Show more comments
avatar image
0

Answer by SkillcraftHD · Oct 15, 2020 at 07:30 PM

@flckev You can just make a script and when loading different levels you can spawn he objects using Instantiate() to the positions you want. You can also spawn them with a specific rotation or scale if you want to. That would be like: GameObject a = Instantiate(ExamplePrefab, targetPosition, Quaternion.Euler(targetRotation)); a.localScale = targetScale;

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

26 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

Related Questions

LoadSceneMode.Single seems to be not working. 0 Answers

Loading Screen? 6 Answers

Allow userto load custom unity levels/scenes. 2 Answers

I made an levelcontroller in c# but it always goes back to level 2 does someone know how to fix this? 2 Answers

Classic Resident Evil-style room loading/level streaming? 4 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