- Home /
Android Performance REALLY Laggy
apologize in advance for asking this question for I know it must have been asked before, but my problems don't seem to be resolved in the other posts.*
I am really close to finishing my game, so I 'build and run' it into my Google Nexus 7 tablet, for Android. The main menu, credits, and other miscellaneous things worked fine, except for the game itself.
The game is horrendously slow, to where it makes my tablet lag along with it! I optimized all the textures for the Terrain to compress for fast quality, made the project quality simple, made everything else compressed for fast quality for Android, and it seems as if my game has gotten a little better.
Especially when I touch the Dual TouchPads on the screen, it takes a LONG time to finally respond to my touch because the game is lagging so much. It makes my head hurt with ALL the problems I have had with this game so far, but that's how you learn when you are new with something.
Any help, links to tutorials, tips, and/or suggestions on what I should do to help improve my game's performance for Android would be really appreciated! :D
How about telling a bit about your situation beyond "it's laggy"? How many drawcalls do you have in the scene? What texture sizes are you using? Vert / triangle count? Do you use any third-party packages like NGUI, ezGUI, 2Dtoolkit, ... What shaders do you use? $$anonymous$$aybe some with heavy fragment programs? Does your game involve physics? If so how many objects are colliding?
There's not much we can tell you since we know nothing about your project.
Feel free to **edit your question**
Answer by Graham-Dunnett · May 15, 2013 at 10:28 AM
Use the built in profiler:
http://docs.unity3d.com/Documentation/Manual/iphone-InternalProfiler.html
This will tell you more than you ever wanted to know about the performance of your game. (If you have the Pro Android Editor, then there is an even more fantastic profiler that will tell you more than you and all your family and everyone you know ever wanted to know.)
The critical thing to work out is whether your game is slow because you are doing too much work on the CPU or the GPU is too busy rendering your scene, in which case you're "GPU bound". If you are CPU bound, then optimise your scripts. If you are GPU bound then reduce draw calls, optimise shaders or simplify the geometry.
Thanks for the tip!
I am using the profiler and I am pretty shocked at ALL the huge spikes I have right now... Here's an image: WW
So... I compressed all my textures for android, which made it a little faster... $$anonymous$$y game's environment is a forest, with the original HUGE size of the terrain when you create it, with thousands of trees in it (all with capsule colliders), I have owls and crickets sounds looping in the background, I have background ambient music playing (each 10 $$anonymous$$utes long since the script is activating the song), I have an enemy chasing after me, I turned off wind, have fog on, have moonshine skybox on...
Any help on what I should edit/optimize to increase my performance and how?
$$anonymous$$aybe upload a larger version of your profiler capture, so we have a chance to see the numbers and give you some advice.
Also, I have found out that when I am in an area in my game with no trees surrounding me ($$anonymous$$y map is a big forrest, with trees everywhere and occasional spots without trees) and the game runs a LOT more smoother...
Is it possible that with all the capsule colliders on thousands of trees could be the source of my game lagging behind?
I deleted a lot of background trees and it didn't do anything... $$anonymous$$aybe ins$$anonymous$$d of a small trail with no grass to follow, I should just have a wide trail in between the trees so I have enough space for the player,which might make the game lag a bit less.
Also, if the image is still too small, I upload some more with everything part zoomed in!
Answer by TotalFreeze · May 15, 2013 at 10:38 AM
You can also try this site. It has great tips on increasing speed and performance: www.paladinstudios.com/2012/07/30/4-ways-to-increase-performance-of-your-unity-game/
Your answer
Follow this Question
Related Questions
FPS lags on Android Device with tk2d 1 Answer
Low FPS in very simple Android game 1 Answer
Unity to android (game very laggy) 1 Answer