optimization - Profiling and Optimizing a game android -
i'm making first android game going 3d arcade-ish game using opengl es. i've been working on quite long time, optimizing engine flexibility future.
anyways i'm done games features , pretty stuff, laggs on phones aren't debug phone. game has pretty high-quality graphics mobile game little lagg expected, difference in performance between running game on nexus s , running on mytouch 4g huge. game isn't playable on lower-end phones lg optimus(the game runs, choppy play comfortably). on nexus s if ever choppy movement(i've implemented frame-rate independent movement in game) on mytouch 4g lot more common, although game still playable....but annoying
i come desktop game-development background, , optimization has never been subject of interest me before. can recommend me speed game?
i've tried optimizing code as possibly could, , performance has improved significantly, there seem things i've missed or overlooking. huge game full engine , lots , lots of code.
i've tried tracking down allocations , making sure aren't deallocated or forgotten during runtime gc doesn't invoked while playing. thats can think of doing, don't know else make lagg
and doubt poly count of meshes because though high quality, added option in game lets choose quality of graphics low, medium, , high on computer game, , difference between low , high somewhere between 600-900 vertices! improvement i've noticed gives load time. there aren't special post-processing effects, lighting, shaders, realtime sss, or of that. textured faces :p
also "lagg" i'm reffering random freezes. i'm pretty sure gc, else since think i've found , controlled allocations(there lot). since game frame-rate independent, whenever unfreezes, player , enemies , 'jumps forward' keep up, , makes difficult game lot more difficult!
i'm new profiling, , optimization. how can use android debug tools(or other third-party tools) better picture of how game performs during runtime, , when/why freezes can fix them.
also, bonus question :) : there way me see how perform on other phones without having phones or knowing people have them? like, how fast go on droid x though don't have droid x nor know
have tried profiling code traceview? insert
debug.startmethodtracing("myfile");
in oncreate, then
debug.stopmethodtracing();
where want finish writing file. view results, plug device computer , run:
/path/to/android-sdk/platform-tools/adb pull /sdcard/myfile.trace /path/to/android-sdk/tools/traceview ./myfile.trace
this show classes taking more time. may able optimize slower classes, and/or move background thread.
you mentioned works fine in phones, perhaps newer phones 24mb/app limit instead of 16mb/app limit? might try memory analyzer in eclipse, check memory leaks or unnecessary large objects. install, go -> install software, , use
http://download.eclipse.org/mat/1.1/update-site/
then, while debugging in ddms view, select dump hprof file (the green glass red arrow), should open memory analyzer.
edit -
it seems need convert android-hprof file now, described here.
Comments
Post a Comment