Optimization of AndEngine game

前端 未结 6 2000
南旧
南旧 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:50

    1. Reduce texture sizes.
    2. Reduce texture switches (aka try to use spritesheets, so that the texture needs to be changed as few as possible)
    3. Use lower quality textures (RGBA4444 or RGB565 instead of RGBA8888)..
    4. Call setIgnoreUpdate where the entity doesn't need updates.
    5. Use SpriteBatches if possible.

    FYI: The next version of AndEngine (coming mid december) sports GLES2 so you have a lot more possibilities to improve performance with custom Shaders and Entities.

    Also it will execute the startup pipeline (onLoadEngine/onLoadResources/onLoadScene/onLoadComplete) on the first frame of the GL-Thread, instead of blocking, on the UI-Thread (directly in onCreate).

    Also it allows you to easily offload the stages of the pipeline into Threads, without breaking the pipeline as a whole. There will be a very simple to implement subclass of BaseGameActivity that shows a determinate ProgressDialog while the stages of the pipeline are executed. Entities will pop in the as they are attached to the scene.

    In general this means, the actual loadingtimes are reduced, and more importantly, the felt loadingtimes are reducedsignificantly! Creating a loading-screen is trivially easy, as opposed to the pain it was before.

提交回复
热议问题