Dynamic target FPS

Is it a good practice to change target FPS depending on what happens in the game? For example when player is panning the camera I would set it to 60fps, if it’s static then back to 30fps etc. Making android tactical rpg with top down view.

No, in fact this is the opposite of what you should do. If load is too high, you should adjust fidelity, not framerate.

2 Likes

No. Input is typically tied to the main update loop. So a lower frame rate will mean higher input latency.

2 Likes

I mean I want to reduce the 30fps jitter when it matters meaning mostly when panning camera. Static gameplay at 30fps looks fine.

Unrelated to the question I asked.

The difference is going to be perceivable by users. Are you fine with that? It looks like you’re looking for a specific answer.

1 Like

As mentioned, users will notice this. The entire reason you go for reducing fidelity instead of reducing framerate is because framerate changes are noticeable and jarring. But you’ve clearly already made up your mind so why are you asking in the first place?

1 Like

Have you never played a game with a high input latency on Android? Google’s API docs have large sections dedicated to the subject and how it negatively impacts the user to have an low frame rate in an application because again input latency is tied to frame rate. Just search for “android jank”.

And the negative reviews that will come from users that hate you for making the app behave poorly?

1 Like

The options I have right now as following:

  1. Have 30fps cap at all times
  2. Increase the fps to 60 if player is moving camera which should be around 20% of gameplay. The reason is that 30fps looks bad when panning camera on top down view
  3. Have 60fps at all times and have the phones melt after playing for 10 minutes for little difference in smoothness for stationary gameplay

What do you suggest would be best approach?

Optimize your damn game so option 3 doesn’t happen. If your issue is that phones are overheating in a largely idle gameplay state, you have made your game wrong.

1 Like

Optimize the application to run well, and offer the option to the user if they wish to restrict performance, but don’t choose for the user. That’s the way it should be implemented on every platform not just mobile. You can optionally choose to default to the setting on the phone (ie if they’ve got it in a power saving mode default to 30 FPS).

Some people dislike the slightest bit of heat from their phones, or are stupid and use an excessively thick phone case which greatly restricts the cooling capacity of the phone, but others like myself understand technology gets warm when it’s under load and won’t be concerned.

If it’s “melting” it means the device is defective since modern devices are supposed to thermally throttle if they pass a temperature threshold. It’s not your job to enforce it for the user. That’s the job of the device.

1 Like

You can check out OnDemandRendering too:

Have you tested your idea of dynamically adapting when cam moves?
If it works, that does sound smart to me. Question is whether framerate will increase fast enough to not stutter.

No. It’s very problematic for a whole slew of reasons but the biggest is if you’re struggling to hit a decent frame rate while idling what do you think will happen when you suddenly move the camera forcing the engine to start loading in new data while simultaneously trying to push for a higher refresh rate?

Where this would make more sense would be to reduce frame rate while rotating the camera. You can see a similar effect in The Legend of Zelda: Tears of the Kingdom. It’s using AMD’s FSR and when the camera moves the quality setting is temporarily adjusted to make it have less of a load to make up for the change in what renders.

But even then you still shouldn’t do it because at the very least you’re going to make some people motion sick. If you must reduce the heat output of the device in some fashion it’s best to do it in other ways not by adjusting the frame rate.

Another major problem with mobile devices is that they forcefully enable Vsync, and that might not sound like a problem until you understand that Vsync works in large steps rather than granularly like various adaptive refresh rate technologies. Which outside of very expensive models most devices don’t have.

These steps are full, half, third, and quarter. So for a 60Hz display the steps are 60, 30, 20, and 15. That means if you can’t hit the full 60Hz the next available step will be selected and it’ll only be 30Hz, and if you can’t hit 30Hz the next available step will be selected and it’ll be 20Hz.

Basically if the game is performing such that it can’t maintain the necessary 60Hz Vsync will force it down to 30Hz meaning you can’t actually use this technique if your game isn’t already well optimized and at that point why would you use it?

It is a great idea to do what you’re trying to do on mobile targets; you can reduce battery drain and thermal build-up this way. But you want to use what @Stardog linked to instead of just messing with targetFps manually. Here’s a bigger write-up on the topic from one of Unity’s blog posts.

With this approach, you can reduce rendering frequency without introduce any input lag. It’s definitely smart to use this depending on the context within your game.

2 Likes

I would recommend experimenting with dynamic resolution.

With dynamic resolution, you could hit your target framerate the entire time, and you would automatically adjust the resolution as needed to maintain the framerate.

3 Likes

i think it depends on the full context… maybe you want to do this because you understand it, but we don’t, we don’t know exactly what you want… but i think i understand your case and maybe, dynamic resolution is not exactly a good idea.
Could you explain the full context, maybe some images or a video?

Sure, you can see example of my implementation of it here:

https://www.youtube.com/watch?v=xiWRDb9d5q8

At the beginning I am locked at 30fps and you can see that when moving camera the game looks bad with lots of stuttering etc. but after I change the fps to adaptive (in settings) the game still runs on 30fps most of the time except when I move the camera when it changes to 60fps. It works and looks good and I don’t see any issues with the change of fps.

I will try the render interval approach too! Thank you.

Yeah, just as i thought, dynamic resolution would look really bad on that context, that is why i asked for a video :slight_smile: but i think that fps adaptive aproach is also bad… That panning will not be just 20% of the game, i would say more like 50% The best way to test it is with people in front of you… Just put some enemies and give your phone to some friends to try it and see how they play… You will see they use that panning feature more that you thought (make sure to say it has a panning feature). Also, you have to take into consideration that you are testing a “development build” and maybe that is what is causing the stuttering…