news.volyx.in

Fixing stutters in Papers Please on Linux (blog.jhm.dev)

726 points by rdpintqogeogsaa · 1720 days ago · 190 comments on HN

Article summary

The article describes a problem with the game Papers Please on Linux, where the game experiences stutters every few seconds. The author uses various debugging tools, including strace and bcc, to investigate the issue and finds that it is caused by the game's use of SDL to check for connected input devices. The game's implementation of this check is inefficient and causes a noticeable pause in the game. The author suggests that updating SDL to a newer version could fix the issue.

Main themes

  • Linux gaming
  • SDL library
  • game development
  • debugging
  • input device handling
  • dependency management

What commenters say

  • The issue can be fixed by upgrading SDL to a newer version that has already addressed this bug.
  • Bundling dependencies, as done by the game developer, can lead to problems like this when the bundled libraries are outdated.
  • Using a background thread to poll for changes instead of doing it on the main thread could be a better approach.
  • The game's implementation of input device checking is inefficient and should be improved.
  • Some commenters argue that doing I/O operations on the main thread is acceptable, while others disagree and think it's better to use a separate thread.
  • The use of statically linked libraries can make it harder to update dependencies and fix issues like this.
  • Some commenters suggest that using a dynamic library or a more recent version of SDL could have prevented this issue.