I recently tried to play Wolfenstein New Order, I realized that unlocking the framerate makes the game break. why? (sorry for bad english)
From video gaming to card games and stuff in between, if itâs gaming you can probably discuss it here!
Please Note: Gaming memes are permitted to be posted on Meme Mondays, but will otherwise be removed in an effort to allow other discussions to take place.
See also Gamingâs sister community Tabletop Gaming.
This communityâs icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
because itâs easier.
You have one âframeâ where you just do everything: read the player input, do whatever actions, calculate collisions and physics and whatever, and draw everything when all those calculations are done.
Then you move on to the next frame and do everything again. Everything lines up all the time and always happen in the same order. Simple, quick, and consistent.
To decouple calculations and framerate, you donât know when the game will try to draw something. It might be in the middle of when youâre calculating collisions, or moving the units, or calculating physics. Or you might end up doing multiple calculations while the GPU is slow and canât draw anything.
So you have to add an extra layer in between, probably saved to some memory somewhere. Now every time the GPU draws something, it has to access that memory. Every time you calculate something, you also access that memory. Letâs hope they DONâT try to read and write on the same spot at the same time, that could cause bugs. And so much memory access, youâve basically doubled your memory bandwidth requirements.
Itâs complicated, more resource intensive, and introduces potential bugs.
And not just easier, but cheaper. On lower end platforms itâs expensive to do floating point calculations all over the place because you donât know how long itâs been since the last frame. If you can assume the frame rate, you can get a lot of performance back too.
Not a game dev but Iâve done some programming and I love games so Iâll take a stab. Thereâs a few reasons I can think of:
Wolfenstein New Order was made by Machine games and used ID Tech 5, same as Doom 2016. Nothing to do with Bethesda or their Creation Engine. Bethesda only published it.
I suppose thatâs what I get for just doing a quick google đ
That is really interesting though, my understanding is that Doom 2016 is known for running pretty well and achieving high framerates, or at least that was the sense I got from tech youtube when I watching that more. I wonder what the devs were doing in that case.
At least itâs not Destiny 2 where incoming damage is tied to frame rate such that the higher yours is the more damage you take.
wait, for real? why? đ¤¨
Damned if I know. Itâs possibly the stupidest decision Iâve ever seen in a big name game. But yeah sometimes youâll be walking around and just all of a sudden get obliterated out of nowhere and it was because you got mapped by an NPC rocket with damage tied to frame rate. Thereâs YouTube videos of people proving it works this way iirc; I know people used to post testing videos on R.
I donât know this specific case, but my guess is that damage is a set amount per frame that a collision overlap is happening. This is perfectly valid if it is biased by the delta between frames. It means things get a little wonky at low framerates, but largely work well. But if you are assuming a frame is an exact length, you save a multiplication action, but gain the problem of unlocked frame rates breaking things (and frame dipping possibly causing problems).
Because itâs easier to programm a single thread that executes a sequence of commands like [ update-gamelogic, update-graphics, etc. ] instead of at least 2 threads (for gamelogic and graphics) that you have to synchronize somehow. Synchronization can be pretty difficult!
Tying game logic to the framerate doesnât really have anything to do with single- vs multi-threading. You can properly calculate the time since the last update in a single-threaded engine.
Itâs not about that.
If the game loop doesnât run at the same speed as the render loop youâll get âtearingâ - some game objects are at the latest state, some are not. That can cause some funky bugs.
From my understanding, tearing can occur even if the game logic and render command submission happen on a single thread, since itâs a consequence of the OS compositor sending buffers to the monitor in the middle of rendering.
correct, but now youâve just identified two separate types of tearing, both happening at different times. put them together and the perceived frequency will be significantly worse than it was prior.
being able to zero one of those out and only worry about the other means you can hopefully optimize a better solution - as much as one can when you canât realistically atomically update the entire display from top to bottom.
deleted by creator
This video might give you a good idea of whatâs going on behind the scenes and why things are not trivial to get right: https://youtu.be/yGhfUcPjXuE
Letâs say you donât tie game mechanics to frame rate. How often should you update the state of the game? 50 times / second? 100 times / second? You need to pick a fixed rate if you want to keep the physics engine consistent. If you make the rate too high the game will not run on low-end machines, so you need to find the right balance.
But letâs say you make it 100 times / second. Now between those updates, nothing changes. You can render at 500 FPS, but youâll be rendering the same thing five times before anything changes, so the extra frames are useless. There are ways around this. You could perform interpolation of object positions between the previous state and the new state (but this introduces input lag). You can keep things that donât affect gameplay (e.g. eye-candy animations) running at the full FPS. But none of these things are trivially obvious. So it becomes a question of ambition, competence, and the will to put time (i.e. investorâs money) into it. Hence many projects simply prioritize other things.
A big problem with an unlocked framerate is the physics system, which you can generally solve in two ways:
So Wolfenstein New Order probably went with the first approach, made sure their physics system stays stable within a certain FPS range (30-60), and then locked the FPS beyond that.
Its mostly the game engine, usually.
In the past, games were developed with specific hardware in mind. They didnât really think of how their game would run on modern PCs 25+ years later. Some games even used that as a feature, famously, Space Invaders devs noticed that the game started speeding up as players destroyed more of the enemies because it didnât have to render them and so it made the game harder as you progressed which was more fun!
By the way, there are ways to run retro games with speed limiters, youâve just got to look into it more.
Remember all those early 90s PC titles that were tied to processor speed so they just ran at a mental pace when the next generation launched?
Reminds me of LEGO Island where turning is tied to frame rate.
Yeah the video by MattKC on that topic is a great watch.
It can simply engine design to not separate the concept of âgame ticksâ with framerate.
You can do everything in one swoop such as calculate physics, run NPC AI code, update game state, and render the frame.
This is not correct. Modern game engines support both concepts.