Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Nikunj-Kareliya · Jul 24, 2015 at 02:50 PM · 2d gamelevelsmemory managementlevel loadlevelload

How to manage multiple levels in the 2D game ?

I am working on simple 2d game which will publish for mobile devices.

Many games such as Angry birds, Candy crush, etc. Suppose there are 100 or more than levels in the game, how do I manage all levels in my game ? Such as object positions ? B'coz in each level, there is a different pattern of objects (obstacles) !

I have to optimize as much as I can.

Which technique should I implement ?

  1. Make every level in the separate scene & load the specific scene whenever needs.

  2. Keep all levels in one scene but save all object's positions to text file in each level, So when user choose level-X then design pattern (vector3 position - arrays) of level-X can be known through text file (fetching positions from text file and set it to vector3 array of object). then set those positions to objects of specific level.

I think, making each level in separate scene, is a worst case.

What is most efficient solution ?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by RJproz · Jul 25, 2015 at 06:28 AM

The second option!! 2D games doesn't require Shadows or lightmaps. So you can just save the Transforms of each object in Json or XML file. This also facilitates in adding levels online, just by using simple web service, where you can update 20-30 levels each week without updating the actual app.

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

Answer by Cynikal · Jul 25, 2015 at 06:49 AM

As RJProz stated, the 2nd option is the most efficient.

You could have your app download level files from a webserver as well. This would provide a fully dynamic level system.

Comment
Add comment · Show 2 · 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 Nexgea · Aug 10, 2015 at 05:48 AM 0
Share

I am also making a 2d game with levels. But I am already using a first system. How much its slowing down the game?

avatar image Nikunj-Kareliya · Aug 10, 2015 at 10:59 AM 0
Share

I think, it's not good practice to making levels in separate scene for simple 2d game. If possible then manage everything in single scene. Do eneble or disable gameobject containers when it's needs.

avatar image
0

Answer by Nikunj-Kareliya · Jul 26, 2015 at 02:33 PM

I am complete beginner to use a webservice or xml parser. I didnt use yet.

I did search. then I found this link : appcrafted , Is there any easy solution ?

Let me explain again problem in detail:

Suppose there are 200 levels, in the 1st level I have 50 tiles, and all tiles are placed in certain pattern, same as in 2nd level I have 100 tiles which are arranged in different pattern than 1st case, So each level has it's unique pattern of tiles.

Please, note: size & property of tiles are different in the different levels. Every type of tile has a unique feature.

Should I do like, arrange a pattern of tiles of level-X in editor then place all tiles of level-X under a parent game object, then make that parent object to prefab. So, load a appropriate prefab when it needs. It seems like easy to do.

Comment
Add comment · Show 2 · 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 RJproz · Aug 02, 2015 at 05:17 AM 0
Share

Technically, prefabs just stores references and metadata. If you are sure that you don't want to add levels via Web service, then you can go with your idea. Create prefab of each level. Just make sure that you keep all levels in Resources folder, and load them using Resources.Load and unload then when not needed.

avatar image Nikunj-Kareliya · Aug 10, 2015 at 05:18 AM 0
Share

Great, It worked. @Rjproj

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Problems with unlocking levels 1 Answer

Help With Level Load 1 Answer

How to load scenes based on specific percentage? 0 Answers

My game changes to the second level, but then refreshes that level,My game changes to the second level, but then just reloads the second level 1 Answer

Save and load levels in-game to be integrate with Steam Workshop 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