Optimization of AndEngine game

前端 未结 6 1962
南旧
南旧 2021-02-01 09:06

I am using java + AndEngine in my game.

During the game i have some freezes, i looked for the information and found some steps how to optimize game performance:

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 09:55

    The importance of profiling your code first before making preemptive optimizations cannot be overstated. It makes little sense to optimize all the sprites etc. if you are GPU bound (this is unlikely but as you are using GLES2.0 and the programmable pipeline, and as we don't know how you have written the GLSL code, it's possible).

    There are a few tools you can use for profiling, as there are different things to profile for.

    For memory profiling, you can use the DDMS and traceview to check memory allocation and how often over a specific time period the GC is being called. This SO question has details:

    How can I profile my Android app?

    Regarding the oft run code, you can always time it yourself and write the results out to the log file. Its a little labor intensive, but you probably already know where your own code is potentially slow.

提交回复
热议问题