The Wayback Machine - https://web.archive.org/web/20201124032521/https://github.com/SFTtech/openage/issues/1307
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

Generic nyan conversion processor #1307

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

Generic nyan conversion processor #1307

heinezen opened this issue Sep 2, 2020 · 0 comments

Comments

@heinezen
Copy link
Member

@heinezen heinezen commented Sep 2, 2020

Required skills: Python

Difficulty: Medium

Converting data from Genie games into our nyan API format happens in so-called conversion processors. A conversion processor basically consists of a bunch of functions that are associated with converting a specific gameplay mechanic. These currently have the following tasks:

  1. Create the necessary nyan objects
  2. Extract values for the gameplay mechanic from the Genie data
  3. Fill in the nyan object's member values using the read values

(more explanation in the docs)

Every game has its own conversion processor, but most of the functions of the default conversion processor are reused if the gameplay mechanics are the same. At the moment, the default conversion processor is the one implemented for AoC.

This code sharing system works fine, but it nevertheless could be improved. One downside of having the AoC conversion processor as default is that, if another game has made a tiny gameplay change, the whole associated function has to be reimplemented. This also includes the creation of associated objects, which are usually the same across every Genie game. The main idea behind having a generic conversion processor is to let it handle object creation (1.) and filling in member values (3.), while the conversion processors for specific games only extract values from the Genie data (2.) and pass it to the generic conversion processor.

The generic conversion processor's functions should work exactly the same as the conversion processors implemented right now, except that they should not extract any data and instead get passed a dict with values. All other conversion processors should have their functions updated to use the generic function for object creation and filling member values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.