Limit fps in packaged game

So ive made a game and its launching soon on steam. Everything works its a full shipping build. Only thing is that when playing, even in the menu with nothing the gpu temp goes to 80 on a 4090 gpu… im think it must be that there is no cap on the fps and its simply going as high as it can causing the gpu usage of 99%… is that likely to be what is causing it, i wemt to a great deal of effort to optomize the game so its all i can think. How should i go about setting an fps cap of 120 so that it ships with it. I dont want an editor solution, must do it in packaged game - thanks

Hey there @ruigol! In most cases, I would recommend adding the Cvar to your DefaultEngine.ini but it seems the framerate command doesn’t seem to work in it correctly from my test.

I believe packaged games use the Game User Settings first, which would be why other methods don’t initially work. You could use the built in Getter and Setter for Frame Rate Limits and this should persist through sessions:

image

Alternatively a quick workaround while I’m working out why that is would be to run the command t.maxfps 120 at the start of the runtime instance and it should remain that way until the instance ends.

runtime instance, as in the game instance?

Is there a difference whether or not i use get game user settings?
image

This is how I have been setting it in my settings:


Would it be better for me to make a custom event or function in the game instance that sets this value then cast to it to set it here?

I have made these changes:

Custom event in game instance:

Changing frame rate in settings widget:

Default settings:

I also have this as a blueprint function, I feel like I’m quite set up for adjusting the frame rate, I suppose the question is whether I’m doing it correctly and need to do it via the game instance for it to actually work and persist through sessions?

So I did a test to check if this was getting set, it seems to be but even at a max frame rate of 30, this is what was happening to my gpu in the menu level that is more or less empty… maybe the issue is something else?

Further tests at different frame rates:

120

60

30

unlimited

From what I can see, changing the max frame rate (if its working) has nothing to do with why the GPU is melting :thinking:

Even setting everything to low quality and 30fps… my gpu is at 100% usage (98% shows from delay switching focus to snap tool)

@SupportiveEntity oh interesting, i set it to 30… closed the game and opened it again and it was set to 30 with the gpu settled down to 20-30s usage… i wonder why setting it at runtime has no effect :thinking:

yes, that seems to be the issue now, i can set the frame rate limit, but i need to restart the game for it to take effect, i could add a tooltip to indicate this but i would much prefer it to take effect at runtime

I wonder also if adding DLSS 3 might improve things?

I was unaware the game settings didn’t update when changed at runtime, I’ll have to do a bit of testing to verify. I may be misremembering, but when changing a GameSettings variable, it’s supposed to marked dirty to be updated, but that doesn’t seem the case here. We could do GPU profiling to see what’s hitting the hardest once we get the frame lock sorted. Regarding DLSS 3+, frame generation could definitely help in some cases, but it would only be a bandaid on the issue instead of finding where the GPU is being hit from the most.

Edit: After some testing it seems applying the game settings does work correctly in 5.3 on my side. I forgot to mention the settings need to be applied but Space got it!

You need to apply the settings to get it to update at runtime @ruigol

1 Like

Ah I am using 5.2 - But regardless I will try applying settings and update
Update: Yes applying settings did the trick! Delighted, thanks @SupportiveEntity & @Spacemarine658

You just helped Don’t Panic not melt GPUs :joy:

Discord: Don't Panic

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.