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

  • weew@lemmy.ca
    link
    fedilink
    English
    arrow-up
    103
    ·
    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
      link
      fedilink
      English
      arrow-up
      16
      ·
      edit-2
      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.