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

Closed
heinezen opened this issue Sep 8, 2020 · 3 comments · Fixed by #1328
Closed
Labels
area: assets Involved with assets (images, sounds, ...) good first issue Suitable for newcomers hacktoberfest For newcomers from Hacktoberfest event improvement Enhancement of an existing component lang: python Done in Python code
Projects

Comments

@heinezen
Copy link
Member

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

@heinezen heinezen added improvement Enhancement of an existing component lang: python Done in Python code area: assets Involved with assets (images, sounds, ...) good first issue Suitable for newcomers labels Sep 8, 2020
@heinezen heinezen added this to conversion in convert Sep 8, 2020
@molyvius
Copy link

Here for hacktoberfest!
Can I have a shot at it?

@heinezen
Copy link
Member Author

@Yoiro Are you still working on this?

@karl01101101 There is someone already working on this (but has not made a PR yet). We also have other special hacktoberfest tasks that you can work on if you want:

All of them should be very easy and beginner friendly :)

@Yoiro
Copy link

Yoiro commented Oct 17, 2020

Hey, I'm still struggling with the build system, and to be honest I didn't manage to give it another look since then. So anyone willing to pick it can pick it, it's fine for me!

@heinezen heinezen added the hacktoberfest For newcomers from Hacktoberfest event label Oct 19, 2020
convert automation moved this from conversion to done Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets Involved with assets (images, sounds, ...) good first issue Suitable for newcomers hacktoberfest For newcomers from Hacktoberfest event improvement Enhancement of an existing component lang: python Done in Python code
Projects
No open projects
convert
  
done
Development

Successfully merging a pull request may close this issue.

3 participants