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

Gaming

30530 readers
75 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
 

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
[–] [email protected] 14 points 1 year ago* (last edited 1 year ago) (2 children)

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!

[–] [email protected] 10 points 1 year ago (1 children)

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.

[–] [email protected] 10 points 1 year ago (1 children)

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.

[–] [email protected] 2 points 1 year ago (1 children)

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.

[–] [email protected] 10 points 1 year ago

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.