- Home /
iOS development question
I have a problem. I would not call is a small problem. But maybe it is. The thing is. I am doing a strategic game for iOS and i can see a problem i will have in the future. The thing is. In my game. i need more then 1 level. So the first thing that came in my mind was just having more levels in the same Scene. But then the problem lies with the fixed buildings. I need to get all these buildings called into a list so i can keep track of them.
It is not hard to just find the gameObjects. But there will be alot of gameobjects in the world if there are more then 1 level in the same scene. So lets say one level will have up to 20 buildings. Then i think there will be a problem for the performance if i try to find all the buildings in a 10 level Scene. Or am i wrong?
Or should i go with just 1 level per scene? Or do you guys know a good great way for me to find the gameobjects just for one level so i dont go thru the whole world to find them.
One thing that came to my mind was to maybe use OverlapSphere over the current level and just by that take all the buildings in the level. Is that a good idea?
All help/tips i can get is appreciated :)
Answer by DESTRUKTORR · Aug 25, 2013 at 05:34 PM
Having additional scenes will not cause problems with performance. Shoving everything into one scene may, depending on how much memory those assets take up, since you're trying to load up more or less all the game's assets all at once.
Depending on what your target hardware is, you may or may not have any issues with this, though. If you're targeting a newer generation iPad, and your assets are fairly limited in scope (ie. you don't have fifty billion polygons/draw-calls among all the levels), chances are you won't have an issue.
However, if you're targeting say, the iPhone 4S, or even the iPhone5, you need to keep in mind that the processors and ram are quite limited when compared to those of even the cheapest of modern laptops (most modern laptops have around 4 gigs of ram, minimum, the iPhone 4S has 512MB ram, and the iPhone 5 has 1 gig). Mobile device processing power is fairly limited, as well, as it requires a lot of power to run, and more powerful processors typically run hotter, as well. Both of these factors don't bode well with mobile devices, as there's not really any breathing room for any of the parts, and nobody wants to meld their phone to their face when talking to someone.
So, my suggestion would be to not load all your assets at once. Your primary concern for performance should be restricted to two things:
Restrict and optimize draw calls, whenever possible. Try your best to use mobile-friendly shaders ONLY, and don't have too many materials or objects being rendered in any particular frame, and try to optimize your textures as much as possible.
Don't use high-poly meshes. Should be self explanatory. More polygons = more time to render them all. This includes having a multitude of low-poly objects being rendered all at once, which would violate both this rule of thumb, as well as the previous one.
Thanks for the answer. I will go with just more scenes. Easier to program my game that way aswell.
Your answer
![](https://koobas.hobune.stream/wayback/20220613112936im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[SOLVED] Is there a quick way to update a mesh in scene? 1 Answer
Push Notification to start a scene 2 Answers
iOS Scroll Effect - SceneGUI Objects 0 Answers
strange corrupted scene 0 Answers
Scripting a "touch" on an object in iOS. 3 Answers