arme2cosmos 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arme2cosmos-0.1.0/PKG-INFO +243 -0
- arme2cosmos-0.1.0/README.md +236 -0
- arme2cosmos-0.1.0/arme2cosmos/__init__.py +11 -0
- arme2cosmos-0.1.0/arme2cosmos/__main__.py +6 -0
- arme2cosmos-0.1.0/arme2cosmos/amd_emit.py +983 -0
- arme2cosmos-0.1.0/arme2cosmos/artmap.py +112 -0
- arme2cosmos-0.1.0/arme2cosmos/cli.py +143 -0
- arme2cosmos-0.1.0/arme2cosmos/convert.py +655 -0
- arme2cosmos-0.1.0/arme2cosmos/coverage.py +140 -0
- arme2cosmos-0.1.0/arme2cosmos/emit.py +1067 -0
- arme2cosmos-0.1.0/arme2cosmos/model.py +79 -0
- arme2cosmos-0.1.0/arme2cosmos/parser.py +78 -0
- arme2cosmos-0.1.0/arme2cosmos/report.py +108 -0
- arme2cosmos-0.1.0/arme2cosmos.egg-info/PKG-INFO +243 -0
- arme2cosmos-0.1.0/arme2cosmos.egg-info/SOURCES.txt +21 -0
- arme2cosmos-0.1.0/arme2cosmos.egg-info/dependency_links.txt +1 -0
- arme2cosmos-0.1.0/arme2cosmos.egg-info/entry_points.txt +2 -0
- arme2cosmos-0.1.0/arme2cosmos.egg-info/top_level.txt +1 -0
- arme2cosmos-0.1.0/pyproject.toml +18 -0
- arme2cosmos-0.1.0/setup.cfg +4 -0
- arme2cosmos-0.1.0/tests/test_artmap.py +75 -0
- arme2cosmos-0.1.0/tests/test_convert.py +633 -0
- arme2cosmos-0.1.0/tests/test_parser.py +98 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: arme2cosmos
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Artemis 2.8 XML mission -> Artemis Cosmos MAST migration assistant
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# arme2cosmos
|
|
9
|
+
|
|
10
|
+
A migration tool that ports legacy **Artemis 2.8** XML missions (`MISS_*.xml`) to
|
|
11
|
+
**Artemis Cosmos**. It produces a runnable Cosmos mission and leaves a clear, per-item
|
|
12
|
+
punch-list (`MIGRATION_NOTES.md`) for the handful of things a human must decide.
|
|
13
|
+
|
|
14
|
+
On the reference a28 corpus it converts **26 of 27 missions with zero leftover TODOs**;
|
|
15
|
+
all 27 compile under the real MAST compiler and **run headless in both output styles**.
|
|
16
|
+
The few remaining TODOs are genuine source issues (a name that references an object the
|
|
17
|
+
mission never created) — not tool gaps. See [`docs/coverage.md`](docs/coverage.md).
|
|
18
|
+
|
|
19
|
+
It can produce the mission in either of two styles (`--target`):
|
|
20
|
+
|
|
21
|
+
- **`mast`** (default) — an idiomatic MAST scaffold: the 2.8 event model translated
|
|
22
|
+
into MAST tasks/routes.
|
|
23
|
+
- **`amd`** — a **declarative quest-tree** mission (`story.amd` + a thin `story.mast`):
|
|
24
|
+
2.8 objectives, win/lose, and story beats become Cosmos quests with a live objectives
|
|
25
|
+
log. See [`docs/amd_target.md`](docs/amd_target.md).
|
|
26
|
+
|
|
27
|
+
- **No dependencies** — Python 3.10+ is all you need to *run the tool*. (The missions it
|
|
28
|
+
generates depend on the `a2x` layer in `sbs_utils` and the LegendaryMissions addons at
|
|
29
|
+
Cosmos *run* time — never at the tool's build time.)
|
|
30
|
+
- Every translatable command becomes a real call; everything else is a `# TODO` with the
|
|
31
|
+
original XML preserved inline.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
Run it directly from the folder:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
python -m arme2cosmos --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or install it to get the `arme2cosmos` command:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pip install .
|
|
47
|
+
arme2cosmos --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## The three commands
|
|
53
|
+
|
|
54
|
+
| Command | What it does | Writes files? |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `report` | Shows how much of a mission maps to Cosmos | No |
|
|
57
|
+
| `artmap` | Builds the ship-hull crosswalk (`hullmap.json`) | `hullmap.json` |
|
|
58
|
+
| `convert` | Scaffolds a full Cosmos mission folder | Yes (`out/<name>/`) |
|
|
59
|
+
|
|
60
|
+
### Typical workflow
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
# 1. (once) Build the hull crosswalk from the two game data files.
|
|
64
|
+
arme2cosmos artmap \
|
|
65
|
+
--vesseldata /path/to/Artemis2.8/dat/vesselData.xml \
|
|
66
|
+
--shipdata /path/to/Cosmos/data/shipDataBB.json \
|
|
67
|
+
--out hullmap.json
|
|
68
|
+
|
|
69
|
+
# 2. See how much of a mission (or a whole folder) maps.
|
|
70
|
+
arme2cosmos report /path/to/Artemis2.8/dat/missions/MISS_TheEndOfPeace
|
|
71
|
+
|
|
72
|
+
# 3. Scaffold it, using the hullmap for real ship art.
|
|
73
|
+
arme2cosmos convert /path/to/Artemis2.8/dat/missions/MISS_TheEndOfPeace \
|
|
74
|
+
--hullmap hullmap.json --out out/
|
|
75
|
+
# ...or emit a quest-tree mission with an objectives log:
|
|
76
|
+
# arme2cosmos convert <path> --target amd --hullmap hullmap.json --out out/
|
|
77
|
+
|
|
78
|
+
# 4. Open out/<name>/MIGRATION_NOTES.md and finish the TODOs by hand.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Every command accepts a single `.xml` file, a single `MISS_*` mission folder, or a parent
|
|
82
|
+
directory full of them (it recurses and skips `~` editor backups).
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## `report` — see what maps
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
arme2cosmos report <path> [--json] [--summary] [--detail]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Classifies every command/condition in a mission. For one mission it prints a per-kind
|
|
93
|
+
breakdown; for many it prints a one-line summary per mission plus a corpus total.
|
|
94
|
+
|
|
95
|
+
Each item is rated:
|
|
96
|
+
|
|
97
|
+
| Status | Meaning |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `full` | Translated mechanically, high confidence |
|
|
100
|
+
| `partial` | Translated, but leaves a `# TODO` (closest-fit) |
|
|
101
|
+
| `manual` | Needs you to wire it (a few object properties, GM keys) |
|
|
102
|
+
| `unknown` | Not recognized (shouldn't normally happen) |
|
|
103
|
+
|
|
104
|
+
Options: `--json` (machine-readable), `--summary` (skip the per-kind detail for one
|
|
105
|
+
mission), `--detail` (corpus mode: also print each mission's breakdown).
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## `artmap` — ship art crosswalk
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
arme2cosmos artmap --vesseldata <vesselData.xml> --shipdata <shipDataBB.json> [--out hullmap.json]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Artemis 2.8 and Cosmos name their ship hulls differently, so this builds a best-effort
|
|
116
|
+
map between them by matching each 2.8 vessel (race + class) to the closest Cosmos hull.
|
|
117
|
+
|
|
118
|
+
It prints how many vessels matched and writes `hullmap.json`. Hand that file to
|
|
119
|
+
`convert --hullmap` so converted ships use real Cosmos art instead of placeholders.
|
|
120
|
+
Vessels it couldn't match confidently are listed under `unmatched` in the file — those
|
|
121
|
+
will use a placeholder you can swap later.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## `convert` — scaffold a mission
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
arme2cosmos convert <path> [--out out] [--target mast|amd] [--lib-version v1.4.0] [--hullmap hullmap.json]
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Creates a ready-to-open Cosmos mission folder:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
out/<name>/
|
|
135
|
+
├── story.mast # the translated mission (thin, on --target amd)
|
|
136
|
+
├── story.amd # (--target amd) the quest tree: objectives, win/lose, story beats
|
|
137
|
+
├── scans.amd # recovered 2.8 scan_desc as declarative science scans (if any)
|
|
138
|
+
├── script.py # standard Cosmos entry-point boilerplate
|
|
139
|
+
├── story.json # the sbslib + LegendaryMissions addons the mission needs
|
|
140
|
+
├── description.yaml # mission browser entry
|
|
141
|
+
├── __lib__.json # library version marker
|
|
142
|
+
└── MIGRATION_NOTES.md # your punch-list of TODOs / things to verify
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Options:
|
|
146
|
+
- `--out` — where to write (default `out/`).
|
|
147
|
+
- `--target` — the output style, `mast` (default) or `amd` (see **Two output styles** below).
|
|
148
|
+
- `--lib-version` — the library version tag written into `story.json`
|
|
149
|
+
(default `v1.4.0`; set it to match the libraries installed with your Cosmos).
|
|
150
|
+
- `--hullmap` — a `hullmap.json` from `artmap`, for real ship art.
|
|
151
|
+
- `--event-model` — how 2.8 events are generated (**`mast` target only**; `amd` builds a
|
|
152
|
+
quest tree instead):
|
|
153
|
+
- `hybrid` (default) — flag-chained "scene" events stay one readable sequence;
|
|
154
|
+
independent events run concurrently, and the ones the engine can push
|
|
155
|
+
(respawn-on-destroy, dock, flag) become event-driven routes instead of polling.
|
|
156
|
+
Matches how 2.8 checks all events every tick, without always-on tasks where avoidable.
|
|
157
|
+
- `linear` — force every event into a single sequential chain (simplest to read /
|
|
158
|
+
hand-edit; use for missions you know are strictly sequential).
|
|
159
|
+
- `a28_compatible` — every event becomes its own continuous polling task, exactly
|
|
160
|
+
like 2.8's flat-event model. No classification, no chain, no routes: the worst-case
|
|
161
|
+
faithful fallback to reach for if a `hybrid` conversion behaves wrong.
|
|
162
|
+
|
|
163
|
+
### Two output styles (`--target`)
|
|
164
|
+
|
|
165
|
+
- **`mast`** (default) — the classic scaffold: 2.8 events translated into MAST tasks and
|
|
166
|
+
routes, controlled by `--event-model`. Best when you want to read/hand-edit the mission
|
|
167
|
+
as MAST.
|
|
168
|
+
- **`amd`** — a **declarative quest-tree** mission. Instead of hand-wiring the event
|
|
169
|
+
machinery, it emits a `story.amd` where 2.8 objectives, win/lose, and narrative become
|
|
170
|
+
Cosmos **quests** the LegendaryMissions `quest_driver` runs — so the port gets a live
|
|
171
|
+
**objectives log** for free. It builds: kill / reach / dock / scan objectives, a
|
|
172
|
+
`Win`/`Lose`/`Critical` end-game tree, timed and flag-driven **reveal chains**, "protect"
|
|
173
|
+
objectives for friendly targets, and **story-beat** quests for narrative moments. The
|
|
174
|
+
`story.mast` it emits is thin (spawn the start block, tag roles, grant the quests, carry
|
|
175
|
+
the imperative bits as `//signal` routes). See [`docs/amd_target.md`](docs/amd_target.md).
|
|
176
|
+
|
|
177
|
+
Both targets compile the full a28 corpus; both recover 2.8 `set_ship_text scan_desc`
|
|
178
|
+
(→ science scans) and `hailtext` (→ a Hail comms button).
|
|
179
|
+
|
|
180
|
+
### What it translates for you
|
|
181
|
+
|
|
182
|
+
Positions are converted automatically (2.8 and Cosmos use mirrored coordinates — you
|
|
183
|
+
don't have to think about it). Translated mechanically:
|
|
184
|
+
|
|
185
|
+
- **Spawns** — players, enemies, neutrals, stations, monsters, black holes, anomalies.
|
|
186
|
+
Named objects are remembered, so later commands that reference them by name still work.
|
|
187
|
+
- **Terrain** — nebula / asteroid / mine fields.
|
|
188
|
+
- **Messages** — comms text, big chapter titles, audio messages, and console warnings.
|
|
189
|
+
- **AI** — common enemy/monster behaviors (chase player, chase station, attack, …).
|
|
190
|
+
- **Movement** — `direct` to a point or a target; `destroy`.
|
|
191
|
+
- **Story flow** — events become a step-by-step sequence; "when" conditions become real
|
|
192
|
+
waits (distance, sphere, fleet destroyed, docked, object exists, timers).
|
|
193
|
+
- **Comms buttons** — become a comms menu (`//comms` route).
|
|
194
|
+
- **Game Master buttons** — become a Game-Master comms menu.
|
|
195
|
+
- **Ship text** — name / race / class / description; a ship's `scan_desc` is recovered as
|
|
196
|
+
a declarative **science scan** (`scans.amd`) and its `hailtext` as a **Hail** comms button.
|
|
197
|
+
- **Tags** — preserved as object data, with notes on rebuilding the tag gameplay.
|
|
198
|
+
- **Objectives (`--target amd`)** — the mission's win/lose and objective structure become a
|
|
199
|
+
Cosmos quest tree with a live objectives log (see **Two output styles** above).
|
|
200
|
+
|
|
201
|
+
### What you finish by hand
|
|
202
|
+
|
|
203
|
+
Nearly every 2.8 command and property now maps to a real call. What's left as a `# TODO`
|
|
204
|
+
(with the original XML next to it, and listed in `MIGRATION_NOTES.md`) is:
|
|
205
|
+
|
|
206
|
+
- Ship art where no confident hull match was found (a placeholder is used).
|
|
207
|
+
- A handful of 2.8-specific features with **no Cosmos equivalent** (marked as engine-stub
|
|
208
|
+
notes, non-blocking): mission music volume, per-object mine immunity, free-velocity drift.
|
|
209
|
+
- Genuine source issues — e.g. a command that references an object the mission never
|
|
210
|
+
created (a dead reference / typo in the original XML).
|
|
211
|
+
- GM key/click interactions (2.8 GM hotkeys become GM comms buttons instead).
|
|
212
|
+
|
|
213
|
+
Treat the output as a strong first draft: the structure, spawns, positions, orientation,
|
|
214
|
+
objectives, and story flow are in place; you polish the few details the notes call out.
|
|
215
|
+
|
|
216
|
+
### How the port is verified
|
|
217
|
+
|
|
218
|
+
Two layers back the conversion (both need a Cosmos checkout with `sbs_utils` +
|
|
219
|
+
LegendaryMissions):
|
|
220
|
+
|
|
221
|
+
- **Conformance** — `A2xTestRange` (a standalone test mission) has ~28 maps that assert
|
|
222
|
+
the *runtime behavior* of every emitted `a2x_*` call in the engine.
|
|
223
|
+
- **Mock run** — every converted mission is run headless in both targets; the whole
|
|
224
|
+
corpus passes. The tool's own logic is covered by stdlib unit tests
|
|
225
|
+
(`python -m unittest discover -s tests`).
|
|
226
|
+
|
|
227
|
+
See [`docs/coverage.md`](docs/coverage.md) for the full command/condition status.
|
|
228
|
+
|
|
229
|
+
For the full command-by-command coverage (what's finished vs. what needs a human
|
|
230
|
+
decision), see [`docs/coverage.md`](docs/coverage.md); property mappings are detailed in
|
|
231
|
+
[`docs/property_map.md`](docs/property_map.md).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Running the converted mission
|
|
236
|
+
|
|
237
|
+
1. Copy the `out/<name>/` folder into your Cosmos `data/missions/` directory.
|
|
238
|
+
2. Make sure the libraries listed in its `story.json` are installed with your Cosmos
|
|
239
|
+
(adjust `--lib-version` when converting if your version differs).
|
|
240
|
+
3. Start Cosmos, host a server, and pick the mission from the list — or smoke-test it
|
|
241
|
+
headless if you have the Cosmos dev tools.
|
|
242
|
+
|
|
243
|
+
"Close enough to the original" is the goal — expect to playtest and tweak.
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# arme2cosmos
|
|
2
|
+
|
|
3
|
+
A migration tool that ports legacy **Artemis 2.8** XML missions (`MISS_*.xml`) to
|
|
4
|
+
**Artemis Cosmos**. It produces a runnable Cosmos mission and leaves a clear, per-item
|
|
5
|
+
punch-list (`MIGRATION_NOTES.md`) for the handful of things a human must decide.
|
|
6
|
+
|
|
7
|
+
On the reference a28 corpus it converts **26 of 27 missions with zero leftover TODOs**;
|
|
8
|
+
all 27 compile under the real MAST compiler and **run headless in both output styles**.
|
|
9
|
+
The few remaining TODOs are genuine source issues (a name that references an object the
|
|
10
|
+
mission never created) — not tool gaps. See [`docs/coverage.md`](docs/coverage.md).
|
|
11
|
+
|
|
12
|
+
It can produce the mission in either of two styles (`--target`):
|
|
13
|
+
|
|
14
|
+
- **`mast`** (default) — an idiomatic MAST scaffold: the 2.8 event model translated
|
|
15
|
+
into MAST tasks/routes.
|
|
16
|
+
- **`amd`** — a **declarative quest-tree** mission (`story.amd` + a thin `story.mast`):
|
|
17
|
+
2.8 objectives, win/lose, and story beats become Cosmos quests with a live objectives
|
|
18
|
+
log. See [`docs/amd_target.md`](docs/amd_target.md).
|
|
19
|
+
|
|
20
|
+
- **No dependencies** — Python 3.10+ is all you need to *run the tool*. (The missions it
|
|
21
|
+
generates depend on the `a2x` layer in `sbs_utils` and the LegendaryMissions addons at
|
|
22
|
+
Cosmos *run* time — never at the tool's build time.)
|
|
23
|
+
- Every translatable command becomes a real call; everything else is a `# TODO` with the
|
|
24
|
+
original XML preserved inline.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
Run it directly from the folder:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
python -m arme2cosmos --help
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or install it to get the `arme2cosmos` command:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pip install .
|
|
40
|
+
arme2cosmos --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## The three commands
|
|
46
|
+
|
|
47
|
+
| Command | What it does | Writes files? |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `report` | Shows how much of a mission maps to Cosmos | No |
|
|
50
|
+
| `artmap` | Builds the ship-hull crosswalk (`hullmap.json`) | `hullmap.json` |
|
|
51
|
+
| `convert` | Scaffolds a full Cosmos mission folder | Yes (`out/<name>/`) |
|
|
52
|
+
|
|
53
|
+
### Typical workflow
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
# 1. (once) Build the hull crosswalk from the two game data files.
|
|
57
|
+
arme2cosmos artmap \
|
|
58
|
+
--vesseldata /path/to/Artemis2.8/dat/vesselData.xml \
|
|
59
|
+
--shipdata /path/to/Cosmos/data/shipDataBB.json \
|
|
60
|
+
--out hullmap.json
|
|
61
|
+
|
|
62
|
+
# 2. See how much of a mission (or a whole folder) maps.
|
|
63
|
+
arme2cosmos report /path/to/Artemis2.8/dat/missions/MISS_TheEndOfPeace
|
|
64
|
+
|
|
65
|
+
# 3. Scaffold it, using the hullmap for real ship art.
|
|
66
|
+
arme2cosmos convert /path/to/Artemis2.8/dat/missions/MISS_TheEndOfPeace \
|
|
67
|
+
--hullmap hullmap.json --out out/
|
|
68
|
+
# ...or emit a quest-tree mission with an objectives log:
|
|
69
|
+
# arme2cosmos convert <path> --target amd --hullmap hullmap.json --out out/
|
|
70
|
+
|
|
71
|
+
# 4. Open out/<name>/MIGRATION_NOTES.md and finish the TODOs by hand.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Every command accepts a single `.xml` file, a single `MISS_*` mission folder, or a parent
|
|
75
|
+
directory full of them (it recurses and skips `~` editor backups).
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## `report` — see what maps
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
arme2cosmos report <path> [--json] [--summary] [--detail]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Classifies every command/condition in a mission. For one mission it prints a per-kind
|
|
86
|
+
breakdown; for many it prints a one-line summary per mission plus a corpus total.
|
|
87
|
+
|
|
88
|
+
Each item is rated:
|
|
89
|
+
|
|
90
|
+
| Status | Meaning |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `full` | Translated mechanically, high confidence |
|
|
93
|
+
| `partial` | Translated, but leaves a `# TODO` (closest-fit) |
|
|
94
|
+
| `manual` | Needs you to wire it (a few object properties, GM keys) |
|
|
95
|
+
| `unknown` | Not recognized (shouldn't normally happen) |
|
|
96
|
+
|
|
97
|
+
Options: `--json` (machine-readable), `--summary` (skip the per-kind detail for one
|
|
98
|
+
mission), `--detail` (corpus mode: also print each mission's breakdown).
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## `artmap` — ship art crosswalk
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
arme2cosmos artmap --vesseldata <vesselData.xml> --shipdata <shipDataBB.json> [--out hullmap.json]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Artemis 2.8 and Cosmos name their ship hulls differently, so this builds a best-effort
|
|
109
|
+
map between them by matching each 2.8 vessel (race + class) to the closest Cosmos hull.
|
|
110
|
+
|
|
111
|
+
It prints how many vessels matched and writes `hullmap.json`. Hand that file to
|
|
112
|
+
`convert --hullmap` so converted ships use real Cosmos art instead of placeholders.
|
|
113
|
+
Vessels it couldn't match confidently are listed under `unmatched` in the file — those
|
|
114
|
+
will use a placeholder you can swap later.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## `convert` — scaffold a mission
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
arme2cosmos convert <path> [--out out] [--target mast|amd] [--lib-version v1.4.0] [--hullmap hullmap.json]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Creates a ready-to-open Cosmos mission folder:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
out/<name>/
|
|
128
|
+
├── story.mast # the translated mission (thin, on --target amd)
|
|
129
|
+
├── story.amd # (--target amd) the quest tree: objectives, win/lose, story beats
|
|
130
|
+
├── scans.amd # recovered 2.8 scan_desc as declarative science scans (if any)
|
|
131
|
+
├── script.py # standard Cosmos entry-point boilerplate
|
|
132
|
+
├── story.json # the sbslib + LegendaryMissions addons the mission needs
|
|
133
|
+
├── description.yaml # mission browser entry
|
|
134
|
+
├── __lib__.json # library version marker
|
|
135
|
+
└── MIGRATION_NOTES.md # your punch-list of TODOs / things to verify
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Options:
|
|
139
|
+
- `--out` — where to write (default `out/`).
|
|
140
|
+
- `--target` — the output style, `mast` (default) or `amd` (see **Two output styles** below).
|
|
141
|
+
- `--lib-version` — the library version tag written into `story.json`
|
|
142
|
+
(default `v1.4.0`; set it to match the libraries installed with your Cosmos).
|
|
143
|
+
- `--hullmap` — a `hullmap.json` from `artmap`, for real ship art.
|
|
144
|
+
- `--event-model` — how 2.8 events are generated (**`mast` target only**; `amd` builds a
|
|
145
|
+
quest tree instead):
|
|
146
|
+
- `hybrid` (default) — flag-chained "scene" events stay one readable sequence;
|
|
147
|
+
independent events run concurrently, and the ones the engine can push
|
|
148
|
+
(respawn-on-destroy, dock, flag) become event-driven routes instead of polling.
|
|
149
|
+
Matches how 2.8 checks all events every tick, without always-on tasks where avoidable.
|
|
150
|
+
- `linear` — force every event into a single sequential chain (simplest to read /
|
|
151
|
+
hand-edit; use for missions you know are strictly sequential).
|
|
152
|
+
- `a28_compatible` — every event becomes its own continuous polling task, exactly
|
|
153
|
+
like 2.8's flat-event model. No classification, no chain, no routes: the worst-case
|
|
154
|
+
faithful fallback to reach for if a `hybrid` conversion behaves wrong.
|
|
155
|
+
|
|
156
|
+
### Two output styles (`--target`)
|
|
157
|
+
|
|
158
|
+
- **`mast`** (default) — the classic scaffold: 2.8 events translated into MAST tasks and
|
|
159
|
+
routes, controlled by `--event-model`. Best when you want to read/hand-edit the mission
|
|
160
|
+
as MAST.
|
|
161
|
+
- **`amd`** — a **declarative quest-tree** mission. Instead of hand-wiring the event
|
|
162
|
+
machinery, it emits a `story.amd` where 2.8 objectives, win/lose, and narrative become
|
|
163
|
+
Cosmos **quests** the LegendaryMissions `quest_driver` runs — so the port gets a live
|
|
164
|
+
**objectives log** for free. It builds: kill / reach / dock / scan objectives, a
|
|
165
|
+
`Win`/`Lose`/`Critical` end-game tree, timed and flag-driven **reveal chains**, "protect"
|
|
166
|
+
objectives for friendly targets, and **story-beat** quests for narrative moments. The
|
|
167
|
+
`story.mast` it emits is thin (spawn the start block, tag roles, grant the quests, carry
|
|
168
|
+
the imperative bits as `//signal` routes). See [`docs/amd_target.md`](docs/amd_target.md).
|
|
169
|
+
|
|
170
|
+
Both targets compile the full a28 corpus; both recover 2.8 `set_ship_text scan_desc`
|
|
171
|
+
(→ science scans) and `hailtext` (→ a Hail comms button).
|
|
172
|
+
|
|
173
|
+
### What it translates for you
|
|
174
|
+
|
|
175
|
+
Positions are converted automatically (2.8 and Cosmos use mirrored coordinates — you
|
|
176
|
+
don't have to think about it). Translated mechanically:
|
|
177
|
+
|
|
178
|
+
- **Spawns** — players, enemies, neutrals, stations, monsters, black holes, anomalies.
|
|
179
|
+
Named objects are remembered, so later commands that reference them by name still work.
|
|
180
|
+
- **Terrain** — nebula / asteroid / mine fields.
|
|
181
|
+
- **Messages** — comms text, big chapter titles, audio messages, and console warnings.
|
|
182
|
+
- **AI** — common enemy/monster behaviors (chase player, chase station, attack, …).
|
|
183
|
+
- **Movement** — `direct` to a point or a target; `destroy`.
|
|
184
|
+
- **Story flow** — events become a step-by-step sequence; "when" conditions become real
|
|
185
|
+
waits (distance, sphere, fleet destroyed, docked, object exists, timers).
|
|
186
|
+
- **Comms buttons** — become a comms menu (`//comms` route).
|
|
187
|
+
- **Game Master buttons** — become a Game-Master comms menu.
|
|
188
|
+
- **Ship text** — name / race / class / description; a ship's `scan_desc` is recovered as
|
|
189
|
+
a declarative **science scan** (`scans.amd`) and its `hailtext` as a **Hail** comms button.
|
|
190
|
+
- **Tags** — preserved as object data, with notes on rebuilding the tag gameplay.
|
|
191
|
+
- **Objectives (`--target amd`)** — the mission's win/lose and objective structure become a
|
|
192
|
+
Cosmos quest tree with a live objectives log (see **Two output styles** above).
|
|
193
|
+
|
|
194
|
+
### What you finish by hand
|
|
195
|
+
|
|
196
|
+
Nearly every 2.8 command and property now maps to a real call. What's left as a `# TODO`
|
|
197
|
+
(with the original XML next to it, and listed in `MIGRATION_NOTES.md`) is:
|
|
198
|
+
|
|
199
|
+
- Ship art where no confident hull match was found (a placeholder is used).
|
|
200
|
+
- A handful of 2.8-specific features with **no Cosmos equivalent** (marked as engine-stub
|
|
201
|
+
notes, non-blocking): mission music volume, per-object mine immunity, free-velocity drift.
|
|
202
|
+
- Genuine source issues — e.g. a command that references an object the mission never
|
|
203
|
+
created (a dead reference / typo in the original XML).
|
|
204
|
+
- GM key/click interactions (2.8 GM hotkeys become GM comms buttons instead).
|
|
205
|
+
|
|
206
|
+
Treat the output as a strong first draft: the structure, spawns, positions, orientation,
|
|
207
|
+
objectives, and story flow are in place; you polish the few details the notes call out.
|
|
208
|
+
|
|
209
|
+
### How the port is verified
|
|
210
|
+
|
|
211
|
+
Two layers back the conversion (both need a Cosmos checkout with `sbs_utils` +
|
|
212
|
+
LegendaryMissions):
|
|
213
|
+
|
|
214
|
+
- **Conformance** — `A2xTestRange` (a standalone test mission) has ~28 maps that assert
|
|
215
|
+
the *runtime behavior* of every emitted `a2x_*` call in the engine.
|
|
216
|
+
- **Mock run** — every converted mission is run headless in both targets; the whole
|
|
217
|
+
corpus passes. The tool's own logic is covered by stdlib unit tests
|
|
218
|
+
(`python -m unittest discover -s tests`).
|
|
219
|
+
|
|
220
|
+
See [`docs/coverage.md`](docs/coverage.md) for the full command/condition status.
|
|
221
|
+
|
|
222
|
+
For the full command-by-command coverage (what's finished vs. what needs a human
|
|
223
|
+
decision), see [`docs/coverage.md`](docs/coverage.md); property mappings are detailed in
|
|
224
|
+
[`docs/property_map.md`](docs/property_map.md).
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Running the converted mission
|
|
229
|
+
|
|
230
|
+
1. Copy the `out/<name>/` folder into your Cosmos `data/missions/` directory.
|
|
231
|
+
2. Make sure the libraries listed in its `story.json` are installed with your Cosmos
|
|
232
|
+
(adjust `--lib-version` when converting if your version differs).
|
|
233
|
+
3. Start Cosmos, host a server, and pick the mission from the list — or smoke-test it
|
|
234
|
+
headless if you have the Cosmos dev tools.
|
|
235
|
+
|
|
236
|
+
"Close enough to the original" is the goal — expect to playtest and tweak.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""arme2cosmos -- Artemis 2.8 XML mission -> Artemis Cosmos MAST migration assistant.
|
|
2
|
+
|
|
3
|
+
Stdlib-only. The tool is a *scaffolder*: it gets a mission 80-90% of the way to MAST
|
|
4
|
+
and leaves a clear punch-list (``MIGRATION_NOTES.md``) for the human to finish.
|
|
5
|
+
|
|
6
|
+
This package currently implements the read-only ``report`` (coverage) stage. Parsing
|
|
7
|
+
and the coverage model are deliberately separated from any future emit stage so the
|
|
8
|
+
analysis is useful on its own.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|