Files
aoe2-flashcard-creator/README.md
2026-10-04 02:26:12 -04:00

55 lines
2.7 KiB
Markdown

Project structure:
```
create-maps-from-namelist.py -- script for creating maps
data/ -- input files from AoE itself (taken from another project)
decks/ -- python scripts to create individual decks
* actual decks are not stored here
* it should be called deck-creators, but I don't want to type that
flashcards/ -- all of the useful library code is in here
output/ -- files generated by the project
decks-output/ -- generated decks that can be read into Anki
maps/ -- mappings between names and numbers
namelists/ -- lists containing names to include for particular decks
settings.yaml -- controls where files are read from and written to
```
Once you have data in the correct format, creating the cards is trivial. The
data is provided by another project (I'll link it when I think about it; the
name of the larger group is SiegeEngineers) and pulled directly from AoE
itself. However, the names and identifiers used in the data can be tricky. Most
of the work here is to create mappings between names and id numbers for that
data.
Big picture process:
* Create a list of names that you want included in the deck
* These are not just any names -- they need to match what is used in the
data file. Use the process below to help with this.
* Generate mappings for the data file from names to numbers and numbers to
names based on your namelist
* Create a deck using these mappings
Process:
* Run flashcards/create_full_namelists.py
* `python -m flashcards.create_full_namelists`
* This generates two files in output/namelists/
* Each file corresponds to one key in the data file:
"units_buildings" and "techs"
* Make new namelists by deleting unused entries from the generated namelists
* This is the worst part
* You want to remove only the entirely useless things at first
* When finished, keep around these pruned namelists and start your deck
namelists as copies of them so you don't need to redo this step
* You can also just use the one I added, but there's no guarantee it is
up-to-date or mistake-free
* Copy one of the pruned namelists and delete more entries until you have just
the names you need for a given deck
* Run create-maps-from-namelist.py using your new deck-specific namelist
* This creates two files in output/generated-maps/
* Using one of the scripts in decks/ as a template, write a Python
script that reads your generated maps and the data file and outputs an Anki
deck
* Unless you want to add the flashcards package to your path,
you must run with `python -m decks.{file name without .py extension}`
* The deck will be stored in output/decks-output/
* Open Anki and import the deck