extract_game_data
Rebuild the bundled game-data YAML resources from a Terra Invicta templates directory.
tiargus.commands.extract_game_data
Maintenance tool: extract bundled game data from Terra Invicta templates.
Several report inputs are derived from Terra Invicta's static template JSON
(shipped in …/TerraInvicta_Data/StreamingAssets/Templates/) and bundled as
YAML package resources under tiargus/data/. This command parses a
templates directory and (re)writes every bundled resource:
space_body_locations.yaml—{templateName: locationLabel}fromTISpaceBodyTemplate.json.org_missions.yaml—{orgTemplateName: [missions]}fromTIOrgTemplate.json.org_research_bonuses.yaml—{orgTemplateName: {category: bonus}}fromTIOrgTemplate.json.councilor_missions.yaml— the per-source mission grants needed to derive a councilor's available missions (base/profession/trait_granted/trait_restricted), fromTIMissionTemplate.json,TICouncilorTypeTemplate.json, andTITraitTemplate.json.
Re-run this whenever the game is updated so new bodies, orgs, traits, or missions are reflected.
Example:
tiargus extract-game-data "/path/to/StreamingAssets/Templates"
add_parser(subparsers)
Register the extract-game-data subcommand on subparsers.
Source code in src/tiargus/commands/extract_game_data.py
190 191 192 193 194 195 196 197 198 199 | |
extract_councilor_missions(missions, professions, traits)
Build the per-source mission grants used to derive councilor missions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
missions
|
list[dict]
|
Parsed contents of |
required |
professions
|
list[dict]
|
Parsed contents of |
required |
traits
|
list[dict]
|
Parsed contents of |
required |
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
A dict with keys |
dict[str, object]
|
|
dict[str, object]
|
and |
Source code in src/tiargus/commands/extract_game_data.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
extract_locations(templates)
Map each space body's dataName to a human-readable region label.
Reads each entry's effectToExplore field (e.g.
"Effect_ExploreAsteroids") and converts it to a region label (e.g.
"Asteroids"). Entries without an effectToExplore field are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
templates
|
list[dict]
|
Parsed contents of |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
A dict mapping |
Source code in src/tiargus/commands/extract_game_data.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
extract_org_missions(templates)
Map each org template to the missions it grants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
templates
|
list[dict]
|
Parsed contents of |
required |
Returns:
| Type | Description |
|---|---|
dict[str, list[str]]
|
A dict mapping |
dict[str, list[str]]
|
omitting orgs that grant no missions. |
Source code in src/tiargus/commands/extract_game_data.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
extract_org_research_bonuses(templates)
Map each org template to its per-category research bonuses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
templates
|
list[dict]
|
Parsed contents of |
required |
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, float]]
|
A dict mapping |
dict[str, dict[str, float]]
|
org's |
dict[str, dict[str, float]]
|
empty or absent. |
Source code in src/tiargus/commands/extract_game_data.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |