How can I improve the smoothness of a 2D scroll game with a 2D scroll?

I am working on a relatively simple 2D scrolling iPhone game. The controls are tilt-based. I am using OpenGL ES 1.1 for graphics. The game state is updated at a speed of 30 Hz ... And the picture is updated at a speed of 30 frames per second (via NSTimer). The smoothness of the picture is in order ... But not as smooth a game as iFighter. What can I do to improve the smoothness of the game?

Here are the potential issues that I briefly looked at:

  • I change the opacity to 15 β€œsmall” (20x20 pixels) textures at a time ... Obviously changing the opacity in this way can degrade the drawing performance

  • I only process 30 frames per second (via NSTimer) ... Perhaps 2D games like iFighter are displayed at a higher frame rate?

  • Perhaps the state of the game can be updated faster? Please note that acceleration values ​​are updated at a speed of 100 Hz ... Therefore, I can potentially update part of the game state at 100 Hz

  • All my PNG24 textures ... Maybe PNG8 will help (due to the smaller size, etc.)

+3
source share
2 answers

It is very difficult to debug graphics problems. Try using openGL ES tools to find where the bottlenecks are. It is very comfortable. Also, watch the WWDC video on openGL. They are really good.

, , , : " 30 ". , - ? , CADisplayLink , . .

+4

Mo 30fps...

, 30 , , . iphone, , 100 , , 10 . 10 , .

, , , , . , iphone, , .

+3

Source: https://habr.com/ru/post/1758577/


All Articles