69
submitted 1 year ago by vpsxhtus@lemm.ee to c/gaming@beehaw.org

I recently tried to play Wolfenstein New Order, I realized that unlocking the framerate makes the game break. why? (sorry for bad english)

you are viewing a single comment's thread
view the rest of the comments
[-] weew@lemmy.ca 88 points 1 year ago

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.

[-] teawrecks@sopuli.xyz 13 points 1 year ago* (last edited 1 year ago)

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.

this post was submitted on 16 Jul 2023
69 points (100.0% liked)

Gaming

30613 readers
259 users here now

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.

founded 2 years ago
MODERATORS