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

Store game edition and game expansion info in auxiliary file instead of hardcoding it #1314

Open
heinezen opened this issue Sep 8, 2020 · 0 comments

Comments

@heinezen
Copy link
Contributor

@heinezen heinezen commented Sep 8, 2020

Required skills: Python

Difficulty: Easy

openage currently stores information about a game edition or expansion inside an Enum, e.g. media paths, support status, etc. We should store this information in an auxiliary file instead, similar to #1312. That would make updating and correcting game information easier as we no longer have to replace chunks of code.

The recommended approach is to transfer the information from the existing implementation into a simple data definition file format. TOML is prefered because we already use that elsewhere in the converter.

Example:

# Header
# The version of this config file format
file_version = "1.0"

# Game edition info
game_edition_id = "AOC"
support_status = True

[media_paths]
datfile = [ "data/empires2.dat", ]
graphics = [ "data/graphics.drs", ]
palettes = [ "data/interfac.drs", ]

Since we cannot use Enums when we read the game versions from file, we would have to replace identity checks of the game version Enum value with an ID check. These checks happen when reading the .dat format or in the service that acquires nyan object names. They should be easy to replace.

Further Reading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
convert
  
conversion
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.