Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize a method to gracefully handle missing files #461

Open
WildWeazel opened this issue Nov 20, 2024 · 0 comments
Open

Standardize a method to gracefully handle missing files #461

WildWeazel opened this issue Nov 20, 2024 · 0 comments
Labels
data layer data files, formats, and IO help wanted Extra attention is needed refactor Refactor something to make it better

Comments

@WildWeazel
Copy link
Member

This is more of an epic, and surely will be a recurring theme throughout the project...

Given how data-driven and customizable this game is intended to be, we can expect that files will sometimes be missing, even if they're part of our own distribution. For example I ran into an issue when switching branches where some fonts or at least their import files were missing, and this brought down half of the render loop. Whenever we read a file we should assume that it may fail, and try to deal with it. Depending on the file, this may include any combination of:

  • explicitly check the result before continuing
  • use the null conditional operator ?. to access it
  • LOG IT at a high level (this should eventually be shown in-game)
  • default to a placeholder/empty reference at the lowest level possible
  • disable the feature
  • if it's absolutely critical, abort back to the nearest safe state
@WildWeazel WildWeazel added help wanted Extra attention is needed refactor Refactor something to make it better data layer data files, formats, and IO labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data layer data files, formats, and IO help wanted Extra attention is needed refactor Refactor something to make it better
Projects
None yet
Development

No branches or pull requests

1 participant