YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
15 stars 7 forks source link

In-Game: [Android] Video draw performance is poor on a wide variety of device specs #6395

Open JujuAdams opened 4 weeks ago

JujuAdams commented 4 weeks ago

Description

Video draw performance is consistently poor across Android devices. This is preventing us from having a consistent user experience across platforms leading to a worse product experience for our players. These performance problems affect high spec Android devices as well as low spec Android devices leading us to believe that there may be some sort of performance locking / vsync issue that is preventing the game from rendering at its fullest potential.

Steps To Reproduce

  1. Run attached project on Android in debug mode on a Samsung S21 Ultra or equivalently high spec device
  2. Watch the intro cinematic
  3. Observe that the in-game FPS counter shows 30FPS and the native GM debugger shows 50FPS.
  4. The game will proceed to the main menu (you can skip the intro cinematic by pressing the (X) in the bottom-right corner)
  5. Observe that the FPS counter (top-left) shows ~30FPS. Observe that the FPS counter in the GM debugger shows ~35FPS. Observe that tweening animations on UI elements are significantly slowed
  6. Run the GM native profiler. Note that video draw takes ~18ms per frame, far in excess of any other code
  7. Tap on Quick Play. Note that UI animations when leaving the main menu are significantly slowed
  8. Upon reaching the Quick Play page, note that performance improves due to the main menu video being paused in the background. The in-game FPS counter shows 60FPS and the GM debugger shows ~300FPS
  9. Close the game. Set the SHOW_MAIN_MENU_VIDEO macro to false and re-run the test on Android. Note that the FPS value quoted by the GM debugger on the main menu is ~350FPS.
  10. Repeat this test on other devices, especially iOS, and note that only Android exhibits significant performance issues and that these performance issues affect high spec and low spec devices alike

Which version of GameMaker are you reporting this issue for?

IDE v2024.600.0.571 Runtime v2024.600.0.605

Which operating system(s) are you seeing the problem on?

Windows 10.0.19045.0

Which platform(s) are you seeing the problem on?

Android

82d85792-86b6-41fa-a45f-7ed05d6772a3

rwkay commented 4 weeks ago

I suspect the culprit here is the getBitmap function on the TextureView used to receive the bitmap from the video... see https://stackoverflow.com/questions/36252437/get-bitmap-from-textureview-efficiently