Add Config files
parent
660d1b9021
commit
cc3da2d005
|
@ -0,0 +1,53 @@
|
||||||
|
Besides tagged ansible playbooks, each adaptive game needs a few config files to work.
|
||||||
|
The config files are mostly YAML lists and dicts.
|
||||||
|
`assistant.py` looks for config files in the `resources/` folder.
|
||||||
|
|
||||||
|
The needed files are:
|
||||||
|
- `levels.yml`
|
||||||
|
- `hints.yml`
|
||||||
|
- `level_keys.yml`
|
||||||
|
- `level_requirements.yml`
|
||||||
|
- `tools.yml`
|
||||||
|
|
||||||
|
There are sample config files present in the `resources/` folder.
|
||||||
|
(These are the files I created for the game I used in my thesis.)
|
||||||
|
## levels.yml
|
||||||
|
`levels.yml` tells the Game object what possible levels are in the game, what Ansible tags
|
||||||
|
are needed for that level, and what machines need changes done.
|
||||||
|
|
||||||
|
Each line of the file should be in the the following format:
|
||||||
|
|
||||||
|
`level_name: {branch_name: [machines_to_provision]}`
|
||||||
|
|
||||||
|
`branch_name` is not just the name of the branch, but also the Ansible tag used to provision the level.
|
||||||
|
### level_keys.yml
|
||||||
|
`level_keys.yml` is a dictionary of the level flags for the flag checker.
|
||||||
|
|
||||||
|
The keys should be in the following format:
|
||||||
|
`level_name: flag`
|
||||||
|
## level_requirements.yml
|
||||||
|
`level_requirements.yml` is the list of requirements for the level selector.
|
||||||
|
The requirements should be in the following format:
|
||||||
|
|
||||||
|
`level_name: [[branch_name, requirements]]`
|
||||||
|
|
||||||
|
where `requirements` is either `null` or `[time, tool]`
|
||||||
|
|
||||||
|
e.g. `level2: [[level2a, null], [level2b, [10, "SQL injection"]]]`
|
||||||
|
`null` requirement means that this is the "default" version of the level.
|
||||||
|
`[time, tool]` means that the player must know `tool` and have time less than `time`.
|
||||||
|
|
||||||
|
The `tools` are expected to also be listed in `tools.yml`.
|
||||||
|
## tools.yml
|
||||||
|
`tools.yml` is a list of tools that the assistant will ask the player about before they play the game.
|
||||||
|
|
||||||
|
If the player is familiar with a tool, they may be sent to a harder version of a level by the level selector.
|
||||||
|
|
||||||
|
This file may also contain tools that do not appear in the game.
|
||||||
|
|
||||||
|
## hints.yml
|
||||||
|
`hints.yml` contains all the hints the player can receive, and should have the following format:
|
||||||
|
|
||||||
|
`level_name: level+branch name: hint title: hint text`
|
||||||
|
|
||||||
|
As hints are usually long, the sample file uses indentation to make the file better readable.
|
Reference in New Issue