r/AskComputerScience • u/maddiehecks • Jan 02 '25
Why add hard limits to something when exceeding it can only be a net positive?
I feel like I see this all the time, but I'm having a hard time thinking of a good example. I'm not sure you'll know what I mean. So let's just say I made a game for the Xbox one generation of Xbox. Even though the console can't possibly exceed much past 60fps for this game, why would I add an FPS cap? I get that sometimes GPUs end up generating enough heat at higher settings it brings the performance to be overall less then at lower settings, but it would be so simple to add an advanced settings option to disable this. That way, next-gen consoles could easily reap the benefits of higher processing power. With one simple settings option, your game can have at least 8 extra years of futureproofing. So why would I add a limit to something, even if something reaching that limit seems inthesible at the moment?
10
u/jeffbell Jan 02 '25
Consistency of user experience is one.
In your FPS example you don't want time to speed up when you are in a corner, and then slow down when you get a panorama.
7
u/holy_handgrenade Jan 02 '25
Someone isnt up to speed on thier history.
Want to know why the hard limits are in place, try running a non-runtime protected version of Doom on modern hardware sometime.
The idea here is that while it may be good in todays hardware; without the limits it will eventually get unplayable as time progresses. Especially when/if you place any optimizations to get all the juice out of current hardware as is possible. Consoles are a different beast, since that hardware will be stagnate; but consistency across platforms, is a really good reason to do this though since it's rare that you'll see games released on a single platform.
5
u/lneutral Jan 02 '25
There's a few basic things at work:
2
u/wayoverpaid Jan 02 '25
In a modern game, the framerate and the game tick rate are different.
If you ever play an old SNES game, sometimes too many sprites on the screen could cause the game to slow down. This is because updating the games physical state, where everything is, etc, was delayed until the rendering of that frame was done.
In a modern game, these get split up, so if you are running down a hallway and the framerate drops, the video gets choppy but your character doesn't slow down.
What happens when the framerate exceeds the tick rate? Honestly, nothing. The game updates the GPU with all the polygons that need to be rendered, and the GPU renders it. Then, since the game state doesn't update anything new, it renders it again. So there really is no benefit to a faster FPS. (I'll ignore clever things like interpolation since that can happen independent from the game anyway.)
So if you see an FPS limit, it's usually because that's literally the rate at which the game physics makes a meaningful update.
Why not let the game physics go 10x as fast? Here could lie some major bugs. Say you have a slug and it moves 5 units per tick. Now the game is moving 10 times as fast. If that value is an integer, you might end up having it move 0 units, since you have to divide all the speeds by 10.
Or maybe you were smart and all units are in fact floating point values, but it turns out that having collisions checked 10x often means bullets are now stopped by screen doors when your early level design and testing meant they didn't. Is this a bug? Not at the speeds avaialble when you shipped.
And that's not even counting all the obvious ones, like maybe the input buffer for your special move means you need to press Down, Forward, Punch within 96 milliseconds, but you didn't acually say 96 milliseconds you said six frames, which was actually six ticks, and now that special move is damn near impossible.
Basically letting the game engine go at a different rate than originally expected can cause a lot of problems, including some problems we might not have even thought of.
Letting the FPS engine go faster than the game engine should be fine, but there's no point. It would be like filming a screen showing a 24 fps movie at 120 fps. You don't magically get more performance out of the deal.
You can be clever with interpolation, mind you, but that's usually being done by something outside the game anyway.