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 /
  • Help Room /
avatar image
0
Question by siddharth3322 · Aug 04, 2019 at 11:09 AM · prefabscenescenesgame developmentdesign-patterns

Prefab or Scene Base Game Development

I have few questions related to overall game structure in Unity because during my experience time I have seen many developers code but all have different approaches for game development so I am posting this question so I can conclude which approach remains better for overall game structure.

For example, I have a 3d mobile game with 20 levels in it and levels you can put either in small or medium length section, I mean those are not too big to deal in processing.

  1. Is it remain better to create 20 different levels prefabs in a single scene and load them when each one required? or is it better to create 20 scenes for these 20 levels of gameplay?

  2. Prefab or scene which one creates overhead for the game engine?

  3. If small or medium size mobile games, if we create and manage within a single scene then will it create any performance issue?

  4. On multiple retry game (small but hard games), whether to load a game scene or load gameplay prefabs again and again? which one not create any performance issue?

    Please share your opinion and knowledge regarding above my questions and I hope other members also found useful this post in future :)

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 Vega4Life · Aug 04, 2019 at 03:48 PM

In your example there isn't much of a difference. Loading a scene doesn't have overhead. You can test this by literally loading an empty scene. The overhead is the gameObjects in the scene that are being loaded into memory.


Another way to show this is using your example. Imagine you had 20 levels, but you bundled each level into a prefab. If you had one scene, then instantiated one of those levels via a prefab, there will be a hitch or some lag (depending on how much needs to be loaded). If instead you loaded a scene with the same level prefab, it would hitch or lag the same exact amount. There's really know difference. It comes down to what you are loading.


For me, with 20 levels, just use scenes. The only time you may have a problem (and this is a problem with prefabs too) is when you get big hitches because of how big the levels are in the scenes. There are some tricks to mitigate this issue if it does arise. And its basically separating out your scene into many prefabs. For example if you have terrain, trees, characters, etc - group all those things into prefabs. Then you load them into the scene via some manager when the scene loads, but the trick is to load one prefab per frame. This stops the game from hitching or pausing. There is a little more to it then that but its the general idea - and this is probably more of a trick for additive scenes.


Nevertheless, hope this helps.

Comment
Add comment · Show 1 · 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 siddharth3322 · Aug 06, 2019 at 04:02 PM 0
Share

@Vega4Life thanks for your above opinion :)

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

160 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 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

How to check when current scene has loaded? 0 Answers

using GO with NetworkIdentity in offline scene (fight auto disabling) 0 Answers

Have 1 Big Object or Multiple Smaller Objects 2 Answers

Multiple active scenes updating but not rendering? 0 Answers

Problem with Changing Scenes? 0 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