Best way to create a real-time graphics adjustment system.

EDIT -> 「 TLDR: I’m aware of dynamic resolution but I’m looking to create a system that is similar to it (dynamic resolution) but adjusts other settings in real-time such as lighting and effects quality instead. 」

Hi, I was wondering if it is possible to create a system that adjusts the graphics in real-time in order to obtain a solid 60 FPS. I can think of a way to create this feature such as:

  1. Every tick, get the current frame-rate.
  2. If frame rate is equal to or greater than 60FPS turn UP lighting & effects quality.
  3. If frame rate is lower than 60 FPS, turn DOWN lighting & effects quality.

although I imagine that this incredibly hacky method is not the best way to go about implementing such a feature. Does anyone have any ideas on this kind of thing? or link me to a thread
that discusses such a feature?

Thanks.

This is more of an engine side feature than a game side feature. I think UE4 already tries to adjust quality levels based on performance. If you let your user specify quality settings, then would you disregard their settings if their framerate drops?

for packaged games I don’t think it tries to adjust automatically. personally i’d let the user adjust the settings but i’m biased and personally can’t see past 24 ish fps. frame jitter supposedly hurts user experience more than low frame rates in some cases, but anyway letting it suggest settings for the user based on how they run the game, maybe even let them tick an option to have it adjusted automatically isn’t a bad idea, but yeah as far as i know there’s no single best way to do this, you can get and change the variables in blueprint or c++, there might also be an ini file somewhere that holds this data which you can tweak for the next program startup. you’ve got the general idea of what needs to be done i think.

I haven’t found this to be true. ^

No, the idea would be that by default the graphics quality is set to “automatic”. The user has free will to override this setting to something specific. In that case, no automatic adjustment would be applied.

That’s basically the point of dynamic resolution. You drop the size of your back buffers to help GPU speed until things start to settle. It’s a bit more complex than “If I had a bad frame, drop the resolution” as you don’t want to necessarily drop things just due to a one time hitch, but rather access a rolling average of times.

TLDR: I’m aware of dynamic resolution but I’m looking to create a system that is similar to it (dynamic resolution) but adjusts other settings in real-time such as lighting and effects quality instead.

Sure! I’m not qualified enough to talk in depth about this kind of stuff but I don’t think dynamic resolution alone solves this kind of problem. Cascaded Shadow Map resolution can have a sustained performance detriment if your hardware isn’t powerful enough. This would lower performance enough to cause a drop in dynamic resolution resulting in a blurry image. Having a blurry image for a large amount of time obviously isn’t desirable.

My proposal (if the feature doesn’t exist already) is to create a feature similar to how “dynamic resolution” works but for other system settings instead such as shadow quality and particle effects density. Work your way down the list of settings that have the largest performance cost with the least visual impact and tweak them one-by-one in real time on a per frame basis.

I’m asking here, if this feature doesn’t already exist in some capacity (either as a plugin or engine level feature)… how would one go about implementing a rudimentary version of such a feature.

So far all I’ve got is something along the lines of this: (as well as add some sort of buffer system as you mentioned)

  1. Every tick, get the current frame-rate.
  2. If frame rate is equal to or greater than 60FPS turn UP lighting & effects quality.
  3. If frame rate is lower than 60 FPS, turn DOWN lighting & effects quality.

I wrote a system like this for mobile where the performance targets are very specific but also have a big range. I got 100% poor feedback. People don’t want their graphics settings changing while they play - dynamic resolution is probably the least intrusive option. If it runs slow, they feel that’s their choice. If it looks ugly, they feel that is also their choice. Even players who don’t know what graphics settings are were reporting the system as a bug. By far the worst situation was if the game ran slow for any reason and after a while dropped down visually. Some people thought their phone was breaking. Some people thought** I’d** broken their phone.

Instead of doing it through heuristics I’d instead run a performance overview on my game and intentionally disable or enable certain settings at certain points in the game level. So if you’re hitting a wide open area with lots of enemies for a brief amount of time adjust settings down and hide the transition with some clever level design, then put them back up afterwards. This means you don’t have to have two of the same asset with different implementations just for speed.

You could write a runtime tool to do the performance test that then creates a list of trigger volumes to import covering areas where the frame rate dropped allowing you to easily specify settings there. Maybe tag the volume with a bit of info about whether it was low or high performance.

@Antidamage That’s very interesting thanks! Perhaps they were complaining because of your implementation specifically rather than the idea itself? I can’t really comment on your implementation since I’ve never seen it but I’m not going to dismiss a system like this out right because of your poor feedback. Perhaps you got poor feedback because your implementation changed settings that had huge visual impacts in a short amount of time. For example two of the settings that I would plan to change would be Particle Density and Shadow Resolution. Changing shadow resolution from 2048 down to 512 during intense game-play isn’t going to be too obvious that it would cause alarm, however it does have a large performance boost.

Like I’ve mentioned earlier, the goal would be to create a list of settings that have a large performance impact but a minimal visual impact. Then change those settings first to see if game performance increases. If not, then adjust settings that DO have a large visual impact (but only as a last resort). I feel that executing a feature like this successfully is all about balance and tolerances.

Particle density and shadow resolution are both already managed by the engine scalability settings. It just sounds like you’re trying to reinvent the wheel. What makes you think this hasn’t all been done before by people with more experience and a better handle on the engine? Epic’s policy is: if everyone clicks a button, remove the button and make it the default behaviour. The same is true for game settings and it’s why UE exposes some of the simplest and most effective quality settings groups of any engine.

To be specific I’d also wonder how many particles you’re over-using if reducing their number gives you an expectation of a performance improvement. As above, if it’s that bad, why isn’t the default amount you’re using the safe amount that is consistent across most platforms? Is your gameplay dependent on a particular particle density? A better analogy might be grass density: the amount of grass used in games as a concealment gameplay mechanic tends to be on the heavier side, and reducing the amount of grass required to make performance feel good is often associated with an unfair advantage - see PUBG. Sometimes the solution is just to have the same amount across the board, capped by the lowest performance target.

In almost all cases you already know what to do based on platform or device capabilities. If you need some kind of heuristic then you’re missing some steps in your development, like play-testing across different devices.

@Antidamage

Are you referring to a system that automatically adjusts shadow resolution and particle density during game-play? If so, I haven’t found such a feature and I’d be appreciative if you could link me to the UE4 documentation of said feature.

I’m not trying to re-invent the wheel, I’ve googled the description of such a feature and found no promising results. No pre-made plugins and no similar functionality built into UE by default.

Are you implying that this feature HAS been done before inside of UE4 and is publicly available in the form of a plugin or open source project? If yes, please link me! I’d much rather be spending my time on more fun things like game-play programming.

In your second paragraph you essentially say (paraphrasing) "well if particle density has such are large impact on performance then you suck at being a game dev :stuck_out_tongue: ". I was using particle density as an example and you completely avoided the topic.

and then you go on to say:

That is why I didn’t use foliage as an example, because you’d poke holes in it and say “this is why you shouldn’t want to do that…”. Once again you are avoiding the topic.

You are not contributing to the discussion in any meaningful way. If the feature already exists please link me (and I’ll apologise for wasting everyone’s time). If it doesn’t exist, please help me. If you aren’t willing to help, then don’t comment. I’m not trying to be rude but you aren’t helping.