• entries
63
51
• views
17,898

# Why are physics engines tied to frame rates?

3,902 views

I came across the news about Fallout 76 has a problem: you can edit a value in one of the ini files which affects the frame rate, and then the physics engine is tied to that, with the end result is players are able to move faster simply by rendering more frames. Obviously this is a problem but why do developers design the physics engines around a frame rate? You need to have a rate of change. Frame rate is a convenient source of what the rate is.

A lot of equations in physics are over time. Meaning they measure something that happens between two points in time. Take velocity: it's the distance between two points in space divided by the time it took for something to travel that distance. Acceleration is the rate at which an object changes its velocity between two points in time. The problem with physics simulations in games (and perhaps in general) is that everything being calculated is being calculated for an instant of time. You might be able to know the input parameters, like how fast an object was going, but you won't know if the velocity will change in the future even if you knew all of the factors that are affecting it because you need one more thing: how long is the object going to be subjected to these effects? Or to put it in another way it's like asking this: I have an object going 5 meters per second, it's experiencing a acceleration of -1 m/s^2, what's its velocity going to be? I don't know, because I don't know how long this object will be experiencing said acceleration.

What Bethesda is doing though is they likely have a reasonably frequent enough rate at which the physics simulation is run at. But they also cap the frame rate to that rate as well. This may also cap the input sampling rate. So why would they do this? Because rendering faster than the rate at which the physics are simulated would mean rendering extra frames that don't add any new information. This may have been a design choice, because other developers don't seem to care like what Ubisoft does with Assassin's Creed:

The cloth runs at "half frame rate" because the physics engine for this isn't ran as fast the graphics rendering is, and so you have this weird effect with the cloth seems to move at a disjointed rate.

So when you uncap the frame rate in a Bethesda game, you're effectively telling the game to run the physics engine at a faster rate, which is great!... except for the fact that if everything else about the game was designed around this one value and affects how everything else behaves. Really the solution to Bethesda's problem is to not make this value changeable in the first place. Or I guess, you know, design a physics engine that isn't dependent on frame rates.

Very late read as I never intended on getting 76, but it's funny to see that the issue is still here.

I wonder if everything, not just movement, is still tied to the fps. I remember playing wolfenstein the new order, and setting the fps to 144. And everything was tied to the fps. Movement, animation speeds, enemy speeds, if you were underwater, you drowned faster, etc.

Though, this makes me wonder, if the system was designed around an input of fps, wouldn't setting a simple equation of engine speed = choosen refresh rate/63? This would allow users to play at monitor refresh rates (though, wolfenstein played quite smoothly for me non the less). I'm sure the game engine is much more complex than just that, but even then, it certainly is "odd" imo that such an engine is designed this way (maybe other games use the same idea of fps, but have ways of formulating it to "in game real time.").

While it's easy to claim it's awful design to have things revolve around the frame rate, I would argue on the other end of the spectrum, it may not be useful to have a frame rate that can exceed how fast the game world runs. If the game world only updates at 60 Hz, there's no point in exceeding 60 FPS because the graphics is a visual representation of the current state of the game world. You would just have extra frames that are rendering the same thing. Maybe if the graphics engine were fancy enough it would render in-between frames of animation, but those wouldn't really count for anything.

Of course, you could also ask why won't developers allow the game world to run faster or slower? Because this would create an inconsistent experience when comparing lower end systems to higher end ones. Imagine being able to cheat by running the game world at a lower rate; you could effectively phase through matter.

24 minutes ago, M.Yurizaki said:

it may not be useful to have a frame rate that can exceed how fast the game world runs.

You're right about that and I agree with that point. If the game engine is only capable of producing and updating at 60 Hz, sure, we can say that there is a "reason" to cap. But if that were the case, is a cap really necessary? But I guess it really depends on how exactly does the Bethesda game engine run. I personally do not know as I doubt Bethesda has a document on how their engine works and people saying "game engine linked with fps cap" doesn't really tell me much on how the engine functions, but none the less, it makes me wonder.

42 minutes ago, M.Yurizaki said:

you﻿ could also ask why won't developers allow the game world to run faster or slower? Bec﻿ause this would create a﻿n inconsistent experience when comparing lower end systems to hig﻿her end ones﻿.﻿

Hmm, I'm not particularly saying that a system that is incapable of producing 60+ fps would suffer a penalty because it's incapable of reaching more than 60 fps, and correct me if I misread your comment, but it sounds as if you're implying that systems that are capable of running the game at 100+ fps will have an advantage because they can produce more fps, thus forcing the engine to run faster? If that is the case, what about those systems that can only run the game at 30-45 fps? I can't say I remember seeing a lot of people saying that their game runs slow cause they couldn't reach 60 fps?

For me personally, I question if the engine is scaling based on the fps cap. We know that increasing the cap will increase the engine speed, but what about decreasing the cap to 30 fps (Probably someone tried it out, but I couldn't find any info)? Would that slow down the game to half speed? I ask this because again, I do not have extensive knowledge about the engine and how it functions exactly, but if that were the case, I wonder if for some reason Bethesda's engine was designed to act according to a given fps cap. I mean, if you cap it at 30 fps, and the game slows to halftime, and increasing the cap to 120 fps doubles the game's speeds, then that might show that the engine is scaling down/ up to reach that criteria (aka the fps cap). If that were the case, as you've stated, why make it so easy. I think the fps cap setting was saved in the prefs.ini which I want to assume stands for preference and might be where all the game settings are stored like graphics and keybinds, but really? I feel like it's better to store that "magic number" inside the game engine file, not a settings file.

Now, say the game engine is only capable of delivering and producing 60 fps and no more, I still find it odd that increasing the fps cap would cause the engine to speed up. Again, maybe my thought might be wrong, but if you were to increase the fps cap, but the game engine can only produce 60 fps, wouldn't your in-game fps still just be 60 as the game engine itself can't do any better? I guess a really lame example of what I mean is, say I had a machine on an assembly line that could put stickers on a box, and it can put about 60 stickers per minute. Say I increase the speed of the conveyor belt so that 120 boxes will pass through under the machine. In the end, even though more boxes pass through, in the end, I'm still getting 60 stickers on every box per minute.

There's probably something wrong with my logic and my knowledge on game engines in general is crap, idk. This is the only game I've seen out of my mediocre collection of games that suffer from this interesting event. I mean, take the Ubisoft example, I would assume that if you played that game with the graphic settings on unlimited/ no cap, I don't think your cape would flap at 4x speeds. And, well, if goobisoft was able to find a way to make it so the game engine renders stuff at specific speeds regardless of fps cap, I like to think that Bethesda also has the capability to enable that as well.

2 hours ago, dwang040 said:

If the game engine is only capable of producing and updating at 60 Hz, sure, we can say that there is a "reason" to cap. But if that were the case, is a cap really necessary?

No, but I wouldn't see a reason to have it uncapped either other than for bragging rights.

Quote

Hmm, I'm not particularly saying that a system that is incapable of producing 60+ fps would suffer a penalty because it's incapable of reaching more than 60 fps, and correct me if I misread your comment, but it sounds as if you're implying that systems that are capable of running the game at 100+ fps will have an advantage because they can produce more fps, thus forcing the engine to run faster? If that is the case, what about those systems that can only run the game at 30-45 fps? I can't say I remember seeing a lot of people saying that their game runs slow cause they couldn't reach 60 fps?

It's about how often the system can run the game logic. I'm under the belief that most game engines run their logic at the same rate, regardless of what processor you throw at it. The frame rate you get at the end is how much time left over the processor can spend sending render commands to the GPU. So if a game runs at 60Hz, then every 16 or so milliseconds, it'll run the logic. If it can complete this within say 500 microseconds, this gives the CPU 15.5 milliseconds to compile and send GPU commands.

But otherwise, yes, I'm implying that it may be advantageous to be able to run the logic more or less often.

Quote

For me personally, I question if the engine is scaling based on the fps cap. We know that increasing the cap will increase the engine speed, but what about decreasing the cap to 30 fps (Probably someone tried it out, but I couldn't find any info)? Would that slow down the game to half speed?

No, because again of my assumption that the game will always run the game logic at a consistent rate, regardless of FPS it can spit out. In this case, if you get 30 FPS, and the game is say 60 Hz, the game already processed two cycles by the time you receive a frame.

Just remember, graphics is a visual representation of the state of the world. As such, it's the last thing that gets done in game. I think a good video that "explains" this is here:

(I say "explains" because it's an intermediate level video, the presenter doesn't explain most of the terms he uses)

Quote

Really the solution to Bethesda's problem is to not make this value changeable in the first place. Or I guess, you know, design a physics engine that isn't dependent on frame rates.

@Mira Yurizaki Is it similar to this?