SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.63k stars 1.11k forks source link

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

Closed heinezen closed 3 years ago

heinezen commented 4 years ago

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

molyvius commented 3 years ago

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

heinezen commented 3 years ago

@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 commented 3 years ago

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!