• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Android 12 - How do I tell Android that my app is a 60Hz app?

Flo

Member
Hello,

In my Android display options, I've one that can adapt the refresh rate/fps to 90Hz for, I quote "some content". It is enabled as anyone would for smoother experience overall.

But when I start my game, refresh rate is 90. And since I capped my framerate to 60fps in GMS, it ends up halving my framerate to 45ish fps.
If I disable this option in Android display settings, I can reach 60fps as intended.

How do I tell Android that my app is a 60Hz app and not a 90Hz one?
Thanks!
 

Attachments

Last edited:

Flo

Member
I found this on the Android documentation:
Usage for games or other non-video apps
Although video is the primary use case for the setFrameRate() API, it can be used for other apps. For example, a game that intends to not run higher than 60Hz (to reduce power usage and achieve longer play sessions) can call Surface.setFrameRate(60, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT). In this way, a device that runs at 90Hz by default will instead run at 60Hz while the game is active, which will avoid the judder that would otherwise occur if the game ran at 60Hz while the display ran at 90Hz.
So I'm basically looking for a way to do this within GMS.
 

O.Stogden

Member
You would likely need an extension in order to contact the Android API.

90hz/120hz Android's aren't the most common yet, the majority still run at 60hz.

90hz is particularly difficult as it's not a multiple of 60, so any 60FPS games will instead run at 45FPS, whereas on a 120hz display, they'd simply be able to run at 60FPS without stuttering. Probably a poor decision by Google to use 90 and not 120... I imagine 90 will be skipped over mostly in the mainstream mobile market.

EDIT: If you're marketing this to the general public, I wouldn't worry about it too much, the 90hz mostly seems like a gimmicky thing for the Pixel 6. Samsung devices did indeed skip 90hz entirely, and went from 60hz to 120hz in 2020 on all their high-end smartphones. The Google Pixel 6 Pro is also 120hz rather than 90hz. So people wouldn't get stutter on those devices, the game would just run at 60FPS.
 
Last edited:

Flo

Member
Well you're right about the 90Hz joke. My 2018 Samsung Note 8 is 120 or 60Hz and my game runs indeed at 60fps as intended when the screen is at 120Hz.
But this is a good way to learn so I'll look into creating an extension (and I've another issue with the Go Back gestures being triggered on the screen's left and right edges that I'll probably need to tackle with an extension as well).
I was pretty sure there was no native function within GMS but I could have been wrong.
 

Mert

Member
You would likely need an extension in order to contact the Android API.

90hz/120hz Android's aren't the most common yet, the majority still run at 60hz.

90hz is particularly difficult as it's not a multiple of 60, so any 60FPS games will instead run at 45FPS, whereas on a 120hz display, they'd simply be able to run at 60FPS without stuttering. Probably a poor decision by Google to use 90 and not 120... I imagine 90 will be skipped over mostly in the mainstream mobile market.

EDIT: If you're marketing this to the general public, I wouldn't worry about it too much, the 90hz mostly seems like a gimmicky thing for the Pixel 6. Samsung devices did indeed skip 90hz entirely, and went from 60hz to 120hz in 2020 on all their high-end smartphones. The Google Pixel 6 Pro is also 120hz rather than 90hz. So people wouldn't get stutter on those devices, the game would just run at 60FPS.
Yes. Although it's kinda easy to get/set frame rates (https://developer.android.com/guide/topics/media/frame-rate), I think its better to leave it to Yoyogames since there may other things that are dependent on Hz rate
 
Top