hoi4-agent-tools 4.16.0 → 4.18.0
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.
- package/CHANGELOG.md +41 -0
- package/README.md +1 -0
- package/dist/hoi4_agent_tools/core/analysis-checkpoints.js +11 -4
- package/dist/hoi4_agent_tools/core/engine-client.js +30 -1
- package/dist/hoi4_agent_tools/core/engine.js +56 -27
- package/dist/hoi4_agent_tools/core/managed-outputs.js +54 -3
- package/dist/hoi4_agent_tools/core/operation-result.js +37 -6
- package/dist/hoi4_agent_tools/core/scanner.js +148 -7
- package/dist/hoi4_agent_tools/core/server-state.js +50 -2
- package/dist/hoi4_agent_tools/core/source/localisation.js +7 -1
- package/dist/hoi4_agent_tools/event/compare.js +47 -13
- package/dist/hoi4_agent_tools/event/operations.js +111 -20
- package/dist/hoi4_agent_tools/focus/importer.js +2 -5
- package/dist/hoi4_agent_tools/focus/lint.js +2 -5
- package/dist/hoi4_agent_tools/focus/model.js +19 -0
- package/dist/hoi4_agent_tools/focus/tool-operations.js +16 -1
- package/dist/hoi4_agent_tools/focus/tool-support.js +14 -0
- package/dist/hoi4_agent_tools/map/appearance-validation.js +6 -1
- package/dist/hoi4_agent_tools/map/border-quality-input.js +57 -8
- package/dist/hoi4_agent_tools/map/border-quality.js +15 -6
- package/dist/hoi4_agent_tools/map/engine-raster.js +160 -0
- package/dist/hoi4_agent_tools/map/limits.js +13 -0
- package/dist/hoi4_agent_tools/map/model.js +9 -8
- package/dist/hoi4_agent_tools/map/natural-lands.js +902 -0
- package/dist/hoi4_agent_tools/map/operations.js +266 -23
- package/dist/hoi4_agent_tools/map/partition-provinces.js +6 -2
- package/dist/hoi4_agent_tools/map/partition-tuning.js +37 -0
- package/dist/hoi4_agent_tools/map/service.js +25 -12
- package/dist/hoi4_agent_tools/map/territory-operations.js +180 -3
- package/dist/hoi4_agent_tools/map/territory-quality.js +72 -5
- package/dist/hoi4_agent_tools/map/territory.js +63 -2
- package/dist/hoi4_agent_tools/map/tool-operations.js +79 -3
- package/dist/hoi4_agent_tools/map/validation.js +23 -3
- package/dist/hoi4_agent_tools/map/water.js +13 -10
- package/dist/hoi4_agent_tools/map/world-outputs.js +41 -26
- package/dist/hoi4_agent_tools/map/world.js +51 -1
- package/dist/hoi4_agent_tools/mcp/tools/map.js +52 -0
- package/dist/hoi4_agent_tools/mcp/tools/reference.js +3 -3
- package/dist/hoi4_agent_tools/mcp/tools/technology.js +25 -1
- package/dist/hoi4_agent_tools/reference/closure.js +65 -0
- package/dist/hoi4_agent_tools/reference/command-phrases.json +7899 -1127
- package/dist/hoi4_agent_tools/reference/mod-index.js +14 -5
- package/dist/hoi4_agent_tools/reference/operations.js +38 -21
- package/dist/hoi4_agent_tools/reference/ranking.js +77 -2
- package/dist/hoi4_agent_tools/reference/script-validation.js +4 -2
- package/dist/hoi4_agent_tools/reference/service.js +45 -2
- package/dist/hoi4_agent_tools/reference/source-lookup.js +43 -121
- package/dist/hoi4_agent_tools/runtime.js +27 -11
- package/dist/hoi4_agent_tools/schemas/lenient-arguments.js +7 -1
- package/dist/hoi4_agent_tools/schemas/map-requests.js +29 -1
- package/dist/hoi4_agent_tools/schemas/map.js +103 -2
- package/dist/hoi4_agent_tools/schemas/mod-tools.js +49 -0
- package/dist/hoi4_agent_tools/schemas/reference.js +1 -1
- package/dist/hoi4_agent_tools/schemas/script-validation.js +57 -3
- package/dist/hoi4_agent_tools/technology/operations.js +5 -0
- package/dist/hoi4_agent_tools/technology/queries.js +54 -0
- package/dist/hoi4_agent_tools/version.js +1 -1
- package/docs/configuration.md +1 -1
- package/docs/map.md +67 -23
- package/docs/research/reference-benchmark.md +64 -0
- package/docs/tools.md +20 -20
- package/docs/troubleshooting.md +4 -0
- package/engine/bin/darwin-arm64/hoi4-engine +0 -0
- package/engine/bin/linux-arm64/hoi4-engine +0 -0
- package/engine/bin/linux-x64/hoi4-engine +0 -0
- package/engine/bin/manifest.json +8 -8
- package/engine/bin/win32-x64/hoi4-engine.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +5 -3
- package/schemas/configuration.schema.json +1 -1
- package/schemas/continuous-focus-palette.schema.json +1 -1
- package/schemas/custom-weighted-pool.schema.json +1 -1
- package/schemas/decision-inspect-input.schema.json +1 -1
- package/schemas/error-log-input.schema.json +1 -1
- package/schemas/event-feature-manifest.schema.json +1 -1
- package/schemas/focus-plan.schema.json +1 -1
- package/schemas/focus-planning-sidecar.schema.json +1 -1
- package/schemas/geography-model.schema.json +1 -1
- package/schemas/gui-animation-source.schema.json +1 -1
- package/schemas/gui-helper.schema.json +1 -1
- package/schemas/gui-scenario.schema.json +1 -1
- package/schemas/helper-expansion-request.schema.json +1 -1
- package/schemas/helper-expansion-summary.schema.json +1 -1
- package/schemas/impact-inspect-input.schema.json +1 -1
- package/schemas/map-operation.schema.json +1087 -815
- package/schemas/mechanic-test-input.schema.json +1 -1
- package/schemas/mod-index-input.schema.json +1 -1
- package/schemas/operation-result.schema.json +1 -1
- package/schemas/package-check-input.schema.json +1 -1
- package/schemas/package-manifest.schema.json +1 -1
- package/schemas/probability-analysis-result.schema.json +1 -1
- package/schemas/probability-compare-input.schema.json +1 -1
- package/schemas/probability-evaluate-input.schema.json +1 -1
- package/schemas/probability-inspect-input.schema.json +1 -1
- package/schemas/probability-render-input.schema.json +1 -1
- package/schemas/probability-scenario-set.schema.json +1 -1
- package/schemas/probability-sequence-input.schema.json +1 -1
- package/schemas/probability-simulate-input.schema.json +1 -1
- package/schemas/probability-sweep-input.schema.json +1 -1
- package/schemas/reference-context-input.schema.json +1 -1
- package/schemas/reference-read-input.schema.json +1 -1
- package/schemas/reference-search-input.schema.json +2 -2
- package/schemas/reference-sheets.schema.json +1 -1
- package/schemas/scenario-suite.schema.json +1 -1
- package/schemas/scenario-test-input.schema.json +1 -1
- package/schemas/script-validate-input.schema.json +7 -1
- package/schemas/shared-scenario.schema.json +1 -1
- package/schemas/source-lookup-input.schema.json +1 -1
- package/server.json +2 -2
package/docs/map.md
CHANGED
|
@@ -178,18 +178,19 @@ Set `lookupOnly: true` for coordinate, query, and selected-ID lookups without fu
|
|
|
178
178
|
|
|
179
179
|
`hoi4.map_inspect` accepts these fields:
|
|
180
180
|
|
|
181
|
-
| Field | Default and limits | Meaning
|
|
182
|
-
| -------------------- | -------------------------------- |
|
|
183
|
-
| `provinceIds` | `[]`, at most 32 | Province records to return, with exact geometry row runs.
|
|
184
|
-
| `stateIds` | `[]`, at most 1,000 | State records to return.
|
|
185
|
-
| `regionIds` | `[]`, at most 1,000 | Strategic-region records to return.
|
|
186
|
-
| `query` | optional, at most 256 characters | Name, localisation key, or ID search.
|
|
187
|
-
| `queryLimit` | 100, range 1 to 1,000 | Maximum `query` matches.
|
|
188
|
-
| `coordinates` | `[]`, at most 100 | `{ "kind": "pixel", "x", "y" }` with top-left bitmap pixels, or `{ "kind": "map", "x", "z" }` with HOI4 map coordinates.
|
|
189
|
-
| `lookupOnly` | `false` | Return only the requested lookups, as described above.
|
|
190
|
-
| `includeOverview` | `true` | Render the full-map PNG and navigator; set `false` to skip the overview render.
|
|
191
|
-
| `allocationRequests` | `[]`, at most 100 | Preview the next free identifiers: `{ "kind": "state", "requestedId"? }` or `{ "kind": "province", "requestedId"?, "requestedColor"? }`, where `requestedColor` is `{ "r", "g", "b" }`. Not accepted with `lookupOnly`.
|
|
192
|
-
| `quality` | `false` | Also measure border naturalness (see [Border naturalness](#border-naturalness)). Full inspection only; not accepted with `lookupOnly` or a rendered view.
|
|
181
|
+
| Field | Default and limits | Meaning |
|
|
182
|
+
| -------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
183
|
+
| `provinceIds` | `[]`, at most 32 | Province records to return, with exact geometry row runs. |
|
|
184
|
+
| `stateIds` | `[]`, at most 1,000 | State records to return. |
|
|
185
|
+
| `regionIds` | `[]`, at most 1,000 | Strategic-region records to return. |
|
|
186
|
+
| `query` | optional, at most 256 characters | Name, localisation key, or ID search. |
|
|
187
|
+
| `queryLimit` | 100, range 1 to 1,000 | Maximum `query` matches. |
|
|
188
|
+
| `coordinates` | `[]`, at most 100 | `{ "kind": "pixel", "x", "y" }` with top-left bitmap pixels, or `{ "kind": "map", "x", "z" }` with HOI4 map coordinates. |
|
|
189
|
+
| `lookupOnly` | `false` | Return only the requested lookups, as described above. |
|
|
190
|
+
| `includeOverview` | `true` | Render the full-map PNG and navigator; set `false` to skip the overview render. |
|
|
191
|
+
| `allocationRequests` | `[]`, at most 100 | Preview the next free identifiers: `{ "kind": "state", "requestedId"? }` or `{ "kind": "province", "requestedId"?, "requestedColor"? }`, where `requestedColor` is `{ "r", "g", "b" }`. Not accepted with `lookupOnly`. |
|
|
192
|
+
| `quality` | `false` | Also measure border naturalness (see [Border naturalness](#border-naturalness)). Full inspection only; not accepted with `lookupOnly` or a rendered view. |
|
|
193
|
+
| `qualityScope` | none | With `quality`: measure only the borders of the states `owners` own or of `stateIds` (either adds provinces), cut to a pixel `box` `{ x, y, width, height }`. A border counts when either side is inside, so a country is measured against its neighbours; `data.quality.scopePixels` gives the size. A scope that selects nothing is reported as `MAP_BORDER_QUALITY_UNAVAILABLE` (`MAP_BORDER_QUALITY_SCOPE_EMPTY`). |
|
|
193
194
|
|
|
194
195
|
Give `hoi4.map_inspect` a `layer`, `overlays`, `scale`, `tile` or `area` to render that view instead of validating; the result is the same complete catalog and navigator drawn with the chosen base layer and overlays, and lookups (`query`, `coordinates`, IDs) belong in a separate call. Base layers include province, state, strategic region, terrain, continent, owner, controller, cores, claims, and coast. Overlays include coastlines, ports, victory points, resources, state and province buildings, supply nodes, railways, adjacencies, building, unit, and weather positions, and `border-quality` (see [Border naturalness](#border-naturalness)).
|
|
195
196
|
|
|
@@ -235,6 +236,45 @@ A 13.1 million pixel map takes about 1.5 seconds and 100 MB of additional memory
|
|
|
235
236
|
|
|
236
237
|
The `border-quality` overlay is added to any base layer (state is the natural choice): state borders are green where they follow a feature and orange where they do not, and the worst artificial run of each layer is drawn two pixels wide (province white, state red, region yellow, country magenta). It works with `tile` and `area`, and scans the river and terrain bitmaps for that render only.
|
|
237
238
|
|
|
239
|
+
## Natural lands
|
|
240
|
+
|
|
241
|
+
`hoi4.map_inspect` with `lands: true` cuts the land provinces into natural lands: the pieces the ground suggests, such as river valleys, ranges, forests and coastal basins. It is a full inspection, offline and deterministic, and reads `provinces.bmp`, the definitions (the terrain column of `definition.csv` classes each province) and, when present and the size of the province map, `heightmap.bmp` and `rivers.bmp`. A bitmap that is absent or of another size is skipped and listed in `data.lands.skippedInputs`.
|
|
242
|
+
|
|
243
|
+
A line runs between two neighbouring land provinces when their border:
|
|
244
|
+
|
|
245
|
+
- follows a **major river**: at least `riverShare` (0.4) of its pixel edges touch a `rivers.bmp` pixel with a width index from `riverMajorIndex` (6) to 11 on either side;
|
|
246
|
+
- is a **crest**: the mean heightmap value along its pixels, minus the mean of the higher province, is at least `crestExcess` (3.5);
|
|
247
|
+
- separates two **terrain classes**: forest (`forest`, `jungle`), upland (`hills`, `mountain`), marsh, desert, and open ground (every other category, so plains, urban and farmland are one class). `terrainClasses` classes a mod's own categories, for example `{ "elder_wood": "forest" }`;
|
|
248
|
+
- is **impassable**: the two provinces are joined by an `impassable` row of `adjacencies.csv`, or exactly one of them belongs to a state with `impassable = yes` (a border inside impassable land is not a line). Code that calls the service with a barrier plane (`walls`) also gets an impassable line where the border lies on value 255, the synthesis wall, on the river share of its edges; a scanned map has no such plane, and the walls `create_world` writes are impassable states.
|
|
249
|
+
|
|
250
|
+
Impassable lines are hard. The two sides of one are never in the same land: when a piece reaches round the end of an impassable row, it is split between the two sides, each province going to the side it is fewer steps from. No merge, of basins or of small lands, crosses an impassable border, so a land that has only impassable neighbours stays below the minimum.
|
|
251
|
+
|
|
252
|
+
Provinces of one class that no line separates form a piece. Every piece that is not upland is cut into drainage basins: each province drains to its lowest neighbour in the piece (by mean height), and provinces on a coast or a lake shore are sinks, as is a province with no lower neighbour. Basins smaller than `minBasinProvinces` (default `minProvinces`) merge over their lowest pass, the lowest mean border height they share with another basin of the piece. With `maxBasinProvinces`, a larger basin is split at branch points of its drainage tree: the largest tributary that fits is cut off, then the rest, as long as both parts keep `minBasinProvinces`. Upland pieces are ranges and are not drained; a crest between two upland provinces does not cut a range unless `splitRangesAtCrests` is true. Last, lands smaller than `minProvinces` (6) merge into the neighbour across their weakest line, smallest first. The strength of a line is the length-weighted mean of its borders (impassable 2, river and crest 1, terrain 0.5, divide 0.2); ties go to the longer line, then to the land with the smaller id.
|
|
253
|
+
|
|
254
|
+
| Field of a land | Meaning |
|
|
255
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
256
|
+
| `id` | `L` and the smallest province id of the land, stable for the same map and options. |
|
|
257
|
+
| `kind` | The majority class: `range` (upland), `forest`, `marsh`, `desert`, or open ground as `basin` (with a heightmap) or `plains` (without one). |
|
|
258
|
+
| `provinces` | Province ids, ascending. |
|
|
259
|
+
| `terrain` | Share of provinces per terrain category. |
|
|
260
|
+
| `coast`, `lakeShore` | Whether the land touches the sea, and a lake. |
|
|
261
|
+
| `meanHeight` | Pixel mean of the heightmap, null without one. |
|
|
262
|
+
| `lines` | Per neighbouring land: the shared `length` in pixel edges and how much of it is `river`, `crest`, `terrain`, `impassable` or `divide` (none of these). A border can count as river and terrain at once. |
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"workspaceId": "my-mod",
|
|
267
|
+
"lands": true,
|
|
268
|
+
"landOptions": { "minProvinces": 6, "minBasinProvinces": 10, "maxBasinProvinces": 40 }
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
`data.lands` holds the count, the count per kind, the inputs used, the number of lands still below `minProvinces` (islands with no land neighbour) and the first 50 lands (`id`, `kind`, province count, `coast`). The artifact `map-natural-lands.<revision>.json` holds every land with its provinces, terrain shares and lines, and the options used. `MAP_NATURAL_LANDS_UNAVAILABLE` (warning) means the map has no province raster. The schema refuses `landOptions` without `lands`, `lands` with `lookupOnly` or a rendered view, and options out of range (`maxBasinProvinces` must be at least twice `minBasinProvinces`).
|
|
273
|
+
|
|
274
|
+
`assign_territory` takes the same lands: `landIds` in `forced`, `blocked`, `cores`, `claims` and `unowned`, and `{ "land": "L120" }` as a seed (the province of the land nearest its centre). The operation's `landOptions` cut the lands, so pass the options of the inspection that listed the ids; an id those options do not produce is refused with `MAP_NATURAL_LAND_UNKNOWN`.
|
|
275
|
+
|
|
276
|
+
Not covered yet: the ranges of a geography model are not read (ranges come from hills and mountain provinces only), an upland province is not moved to the side it drains to, and closed basins (rings) and their spill heights are not reported.
|
|
277
|
+
|
|
238
278
|
## Catalog consistency
|
|
239
279
|
|
|
240
280
|
Validation reads the active `common/terrain/*.txt` categories and `map/continent.txt` (or the continent file `default.map` names) along with the map files.
|
|
@@ -323,6 +363,8 @@ Pass `provinceId`, `definition`, or the full distribution object when an exact o
|
|
|
323
363
|
|
|
324
364
|
## Change IDs
|
|
325
365
|
|
|
366
|
+
The game needs every state id from 1 to the highest; a missing one crashes it at setup ("Missing State ID"). So a write never leaves a hole of its own: when `merge_states`, `assign_territory` or another operation removes a state below the highest id, the highest states move into the holes in the same write, with their script references, building positions and `STATE_<id>` localisation, and the result lists the moves in `MAP_STATE_IDS_COMPACTED`. A state id the request names (`stateId`, or the `toId` of `renumber_map_entity`) is never moved, so a named id that would leave holes below it is refused with `MAP_STATE_ID_GAP`: name the next free id instead. Holes the mod already had are reported as a `MAP_STATE_ID_GAP` warning with the ids, and every write still runs, so you can close each with `renumber_map_entity`, the highest state into the hole. Building positions in `map/buildings.txt` that named a removed state move to the state that holds their province (`MAP_BUILDING_POSITIONS_REASSIGNED`).
|
|
367
|
+
|
|
326
368
|
Use `renumber_map_entity` for `province`, `state`, or `strategic-region` IDs:
|
|
327
369
|
|
|
328
370
|
```json
|
|
@@ -398,16 +440,17 @@ Nothing is lost or duplicated: for any split, merge or move, the sums of manpowe
|
|
|
398
440
|
}
|
|
399
441
|
```
|
|
400
442
|
|
|
401
|
-
| Field of a country | Meaning
|
|
402
|
-
| ----------------------- |
|
|
403
|
-
| `tag`, `weight` | Three capital letters or digits, and the relative target size (default 1).
|
|
404
|
-
| `seeds` | `{ state }`, `{ province }
|
|
405
|
-
| `forced`, `blocked` | `{ stateIds, provinceIds, regionIds }`: land the country always or never owns. `regionIds` are strategic regions.
|
|
406
|
-
| `regions` | Strategic regions the country prefers to grow in (a step into another country's preferred region costs more).
|
|
407
|
-
| `overlord`, `mergeInto` | A subject is grown inside its overlord's territory. `mergeInto` relabels the finished territory to another listed country and keeps its tag as a core.
|
|
408
|
-
| `cores`, `claims` | Extra states the country holds a core on or claims.
|
|
443
|
+
| Field of a country | Meaning |
|
|
444
|
+
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
445
|
+
| `tag`, `weight` | Three capital letters or digits, and the relative target size (default 1). A tag no `common/country_tags` file declares is assigned with a warning (`MAP_TERRITORY_TAG_UNDEFINED`), or refused with top-level `strictTags: true`. |
|
|
446
|
+
| `seeds` | `{ state }`, `{ province }`, a pixel `{ x, y }` of the province map or a natural land `{ land }`; the first is the capital. A seed in the sea is refused. |
|
|
447
|
+
| `forced`, `blocked` | `{ stateIds, provinceIds, regionIds, landIds }`: land the country always or never owns. `regionIds` are strategic regions, `landIds` [natural lands](#natural-lands). |
|
|
448
|
+
| `regions` | Strategic regions the country prefers to grow in (a step into another country's preferred region costs more). |
|
|
449
|
+
| `overlord`, `mergeInto` | A subject is grown inside its overlord's territory. `mergeInto` relabels the finished territory to another listed country and keeps its tag as a core. |
|
|
450
|
+
| `cores`, `claims` | Extra states the country holds a core on or claims. |
|
|
451
|
+
| `fixed` | The country owns exactly its seeds and `forced` land and never grows, for a realm whose land is settled. Smoothing and corridors leave it alone. |
|
|
409
452
|
|
|
410
|
-
Top-level fields: `unit` (`state`, the default, assigns whole states; `province` assigns provinces and regroups the states a border cuts), `scope` (`stateIds`, `regionIds`, `owners`: only these states take part), `unowned` (land nobody owns), `barriers` (`natural` or `none`, which grows on distance alone), `rules.connectedMainland` (default true) and `rules.islandPolicy` (`one-owner`, `nearest` or `unowned` for landmasses without a seed), `smoothing` (`passes` 0 to 20, `maxShareChange`), `shareTolerance` (default 0.15), `seed` (the same seed gives the same borders), `ownership` (`controller`: `owner` or `keep`; `cores`: `keep`, `owner` or `add-owner`; `claims`: `keep` or `clear`; `unowned`: `clear` or `keep`), `stateSize` (province unit: fragments below `min` provinces join a neighbour of the same owner and strategic region), `remapReferences` (`refuse` or `override`, as for `merge_states`), `borderQuality` and `
|
|
453
|
+
Top-level fields: `unit` (`state`, the default, assigns whole states; `province` assigns provinces and regroups the states a border cuts), `scope` (`stateIds`, `regionIds`, `owners`: only these states take part), `unowned` (land nobody owns), `barriers` (`natural` or `none`, which grows on distance alone), `rules.connectedMainland` (default true) and `rules.islandPolicy` (`one-owner`, `nearest` or `unowned` for landmasses without a seed), `smoothing` (`passes` 0 to 20, `maxShareChange`), `shareTolerance` (default 0.15), `seed` (the same seed gives the same borders), `ownership` (`controller`: `owner` or `keep`; `cores`: `keep`, `owner` or `add-owner`; `claims`: `keep` or `clear`; `unowned`: `clear` or `keep`), `stateSize` (province unit: fragments below `min` provinces join a neighbour of the same owner and strategic region), `remapReferences` (`refuse` or `override`, as for `merge_states`), `borderQuality`, `borderTargets`, `borderQualityScope` and `landOptions` (the thresholds of the [natural lands](#natural-lands) that `landIds` and `{ land }` seeds name). `groups` (`{ provinceId: group }`) draws culture or people lines: a growth step across one costs `1 + groupPenalty` times more (default 2), like a ridge, so borders move to the lines but balancing can still cross them; with `groupHard: true` growth never crosses a line, so a people's pocket is never entered from outside. A state takes the group of most of its provinces. Besides `map-territory-report.json`, the result has `map-territory-assignment.json`: the provinces of each owner and of each new or changed state, compact enough to read after a preview. A seed in water is refused with the nearest land province in the message and `details.nearestLandProvince`.
|
|
411
454
|
|
|
412
455
|
How it works: a multi-source shortest-path growth from the seeds over the province or state graph, where a step costs the distance between centres times `1 + 6 * barrier` (the barrier is the strength of the rivers, slopes, lake shores and terrain changes along the shared border, measured by the metric of [Border naturalness](#border-naturalness)); country multipliers are corrected until sizes are within the tolerance of their targets; a country cut apart on its capital's landmass is joined by a corridor; and a local search moves boundary atoms when that shortens the artificial border without disconnecting the donor or leaving the size tolerance. Targets follow the weights, corrected for what the land allows (a country alone on an island owns the island).
|
|
413
456
|
|
|
@@ -417,7 +460,7 @@ The province unit writes the new borders exactly: each state is split by owner,
|
|
|
417
460
|
|
|
418
461
|
`update_states` takes `updates: [{ stateId, changes }]` with the changes of `update_state`. The index is built once; a state may appear once, and an unknown state refuses the whole list.
|
|
419
462
|
|
|
420
|
-
`borderQuality` is `report` by default: the result adds `MAP_BORDER_QUALITY_MEASURED` with the enrichment, natural share and straightness of the proposed country and state borders, and the artifact `map-territory-report.json` holds every number. `enforce` blocks the write when a layer misses the targets (enrichment 1.6; straightness 0.12 for countries and 0.25 for states; override with `borderTargets`) with `MAP_TERRITORY_BORDER_ARTIFICIAL`; `off` skips it. `data.territory` returns, per operation, the sizes against targets (worst eight countries), the border score, the same seeds grown on distance alone (`distanceOnly`), and the counts of states changed, created and removed. Previews work as for any rewrite and write nothing.
|
|
463
|
+
`borderQuality` is `report` by default: the result adds `MAP_BORDER_QUALITY_MEASURED` with the enrichment, natural share and straightness of the proposed country and state borders, and the artifact `map-territory-report.json` holds every number. `enforce` blocks the write when a layer misses the targets (enrichment 1.6; straightness 0.12 for countries and 0.25 for states; override with `borderTargets`) with `MAP_TERRITORY_BORDER_ARTIFICIAL`; `off` skips it. `borderQualityScope` (`owners`, `stateIds`, `box`, as `qualityScope` of `hoi4.map_inspect`) measures and judges only the borders of the region being redrawn; the measured note then says `inside the scope`, and an empty scope is `MAP_BORDER_QUALITY_UNAVAILABLE`, a blocker in `enforce`. `data.territory` returns, per operation, the sizes against targets (worst eight countries), the border score, the same seeds grown on distance alone (`distanceOnly`), and the counts of states changed, created and removed. Previews work as for any rewrite and write nothing.
|
|
421
464
|
|
|
422
465
|
Unowned land: states in `unowned`, and landmasses without a seed under `islandPolicy: "unowned"`, are not grown into. With `ownership.unowned: "clear"` (the default) their owner is removed, and their controller too when `controller` is `owner`; `"keep"` leaves them as they were. States outside `scope` are never edited. Provinces that belong to no state cannot be owned and are left out.
|
|
423
466
|
|
|
@@ -527,7 +570,7 @@ Continents are the largest landmasses, numbered `world_continent_1` and up and n
|
|
|
527
570
|
|
|
528
571
|
Each write records its generated files in `.hoi4-agent-world.json`. A later `create_world` deletes the recorded files it no longer writes (retires them) in the same transaction and refuses with `MANAGED_OUTPUT_EDITED` when a recorded file was edited since. `MAP_WORLD_OUTPUTS_RECONCILED` and `data.outputs` give the counts of written, retired and released files with up to 200 paths each; `map-world-outputs.json` lists them all.
|
|
529
572
|
|
|
530
|
-
Every map rewrite keeps that record current with its own edits. When `update_states`, `move_state_provinces` or any other operation writes a recorded file, in a later call or later in the `create_world` call, the same transaction records the file's new hash (`MAP_WORLD_OUTPUTS_REFRESHED`),
|
|
573
|
+
Every map rewrite keeps that record current with its own edits. When `update_states`, `move_state_provinces` or any other operation writes a recorded file, in a later call or later in the `create_world` call, the same transaction records the file's new hash (`MAP_WORLD_OUTPUTS_REFRESHED`), a recorded file it deletes leaves the record, and a file it creates where the world keeps its outputs (state files, strategic regions, map files, world localisation; not country files) joins the record. A recorded file that was edited by hand before the call keeps its old hash, and the note is then a warning that names it, so the next `create_world` still refuses it. To take the current bytes of every recorded file as the world's own, for example in a mod whose record a version before 4.16.0 left stale, run `{ "kind": "record_world_outputs" }`. It changes only `.hoi4-agent-world.json`, drops recorded state and strategic-region files that are gone, keeps other recorded files it did not read (`unscannedPaths`) with their recorded hash, and reports the counts in `MAP_WORLD_OUTPUTS_RECORDED`. It reads the bitmaps, colour maps and world scripts as `create_world` does. It also adds the mod's files at those paths that the record lacks, such as state files created before this fix, and lists them in `addedPaths`; `"adoptUnrecorded": false` re-hashes the listed entries only. Afterwards the next `create_world` overwrites those files without refusing them. Without a record it is refused with `MAP_WORLD_OUTPUTS_MISSING`. Edits made through other tools (localisation, GUI, focus) are not recorded.
|
|
531
574
|
|
|
532
575
|
Every applied map rewrite also returns `data.changedSummary` with the number of changed files (`total`, `created`, `removed`, `modified`) and the same counts for the 40 folders with the most changes (two levels deep, `.` for the mod root, `omittedFolders` for the rest), so the size of a write is visible even when the inline `changedFiles` list is cut.
|
|
533
576
|
|
|
@@ -583,6 +626,7 @@ By default provinces grow evenly from spread seeds and states and regions grow b
|
|
|
583
626
|
|
|
584
627
|
- Province borders are pulled onto rivers, steep slopes and ridges, wall ranges and lake shores (a watershed whose step cost rises on them). A province that still straddles a river or wall is cut along it.
|
|
585
628
|
- Province size follows the land: small in fertile valleys, on coasts and beside rivers, large on mountains and wasteland (`landArea.fertile`, `hills`, `mountain`, `waste`, in pixels), and per geography region through its `density.provinceAreaPx`. Without bands they follow `landProvincePixels` (0.35, 1, 2.2 and 3.4 times, scaled so the mean stays `landProvincePixels`). Sea provinces are small near a coast and large on the open sea (`seaArea.coastal` and `open`, from `seaProvincePixels`), and a channel no wider than `narrowStraitPx` (24) gets two sea provinces across it. A lake province covers about `lakeArea` pixels (default 6,000, at most an eighth of the map), so a lake no larger than that stays one province.
|
|
629
|
+
- `areaByRow` scales the land province area by position: `[row, factor]` points, row 0 at the top edge and 1 at the bottom, in increasing row order, with factors from 0.25 to 8, linear between the points and held beyond the ends. The factor multiplies the area after the plan is scaled to `landProvincePixels`, so rows with factor 1 keep their sizes. States keep their province counts, so they grow by the same factor. `[[0, 3], [0.3, 1.6], [0.45, 1], [1, 1]]` gives provinces about three times larger at the top edge and the usual size from the middle south. On a 512 by 256 test world the northern band (rows 0 to 0.3) had a mean of 246 pixels against 116 in the south, and 138 states instead of 171. `MAP_PARTITION_AREA_BY_ROW` reports, for each band between two points, the land provinces whose centre lies there, their mean area and its ratio to the band with the smallest factor; out-of-order rows or factors outside the range are refused with `MAP_PARTITION_AREA_BY_ROW_INVALID`. The area cap of an eighth of the map still applies.
|
|
586
630
|
- States and strategic regions are clusters over the province graph that avoid joining across rivers and ranges, prefer like ground, never mix geography regions or named seas, and respect `provincesPerState` (`[smallest, largest]`, or a region's own `density.provincesPerState`) and `regionSize`.
|
|
587
631
|
- `barrierStrength` (0 to 60, default 20) sets how hard borders are pulled onto natural lines; `minProvincePixels` (default 40) is the smallest planned province.
|
|
588
632
|
|
|
@@ -217,6 +217,70 @@ Run the fresh set with:
|
|
|
217
217
|
npx tsx scripts/evaluate-reference-discovery.ts MOD_ROOT GAME_ROOT --fresh
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
+
## Plain-word questions, connector words and player vocabulary (issue 64)
|
|
221
|
+
|
|
222
|
+
Measured on 2026-11-13 on HOI4 1.19.4.1 with the kit's `hoi4_wiki` pack (66 pages).
|
|
223
|
+
A fresh author wrote 48 questions the way a new modder asks them, from the documentation alone, without seeing the ranking code or any result, and checked each answer line by hand.
|
|
224
|
+
The cases are in `scripts/reference-common-cases.ts`: 23 for tuning (`--common-dev`: 20 answerable questions and exact names, 3 negatives) and 24 kept untouched until the change was final (`--common-blind`: 22 answerable, 2 negatives).
|
|
225
|
+
The author's own list missed one acceptable answer for "temporary bonus" (the `add_timed_idea` example on the idea page), which was added to the tuning half only.
|
|
226
|
+
|
|
227
|
+
Three changes were kept, each because it helped without losing an answer on any earlier set:
|
|
228
|
+
|
|
229
|
+
- **Connector words.** `has_war_with`, `is_owned_by` and `num_of_factories` carry a relation in a little word that the content-word model drops. A question that says that word and names every other word of the command name earns a bonus, so "at war with" prefers `has_war_with` over `has_annex_war_goal`.
|
|
230
|
+
- **Exact names.** A console command, a define or a variable with the same name as a trigger or an effect no longer ties it at the top score. The trigger or effect stays first unless the question asks for the other kind.
|
|
231
|
+
- **Player vocabulary.** A small table maps words players use to words scripts use: sea to coastal, temporary to timed, vassal to puppet, spirit to idea, owner to owned, fighting to war, and about twenty more. They add terms at 0.7 of the weight of a word the question itself uses.
|
|
232
|
+
|
|
233
|
+
| Set (HOI4 1.19.4.1) | First before | First after | Within three before | Within three after |
|
|
234
|
+
| ---------------------------------------------- | -----------: | ----------: | ------------------: | -----------------: |
|
|
235
|
+
| Common questions, tuning half (20) | 9 | 12 | 15 | 15 |
|
|
236
|
+
| Common questions, blind half (22, scored once) | 12 | 13 | 16 | 16 |
|
|
237
|
+
| Fresh blind set of ADR 0078 (38) | 17 | 19 | 23 | 22 |
|
|
238
|
+
| Held-out (24) | 9 | 11 | 15 | 15 |
|
|
239
|
+
| Validation (24) | 18 | 19 | 20 | 20 |
|
|
240
|
+
| Test (40) and discovery (37) | 25 | 25 | 31 and 28 | 31 and 28 |
|
|
241
|
+
|
|
242
|
+
Exact names went from 3 of 4 to 4 of 4 first on the fresh set and from 1 of 2 to 2 of 2 on the tuning half. The blind half's three exact names stayed first.
|
|
243
|
+
|
|
244
|
+
Tried and not kept:
|
|
245
|
+
|
|
246
|
+
- Making "another" a stop word. It moved "give a state to another country" and a diplomatic opinion question out of the top five.
|
|
247
|
+
- British spellings as synonyms (`neighbour`, `colour`), which pushed a correct answer from second to fifth.
|
|
248
|
+
- A minimum share of the question's rare-word weight that an answer must match, to silence negatives such as "roast a turkey". It dropped a correct "access to the sea" answer on the held-out set and left the negatives alone.
|
|
249
|
+
- A table of multi-word phrasings ("access to the sea", "share a border", "free a puppet"). It changed no rank on any set.
|
|
250
|
+
|
|
251
|
+
Still missing: "check that my country is currently fighting a war" ranks `has_war` outside the top twelve, because commands that repeat several words of a long question outscore the short, exact one. Two unrelated queries ("how to adjust the gears on a bicycle", "how long should I roast a turkey per kilo") still return results, as the nonsense queries of the earlier rounds do. The target of issue 64 (22 of 24 first, all in the top three) is not met: about 60 percent of the blind half is first and 73 percent is in the top three.
|
|
252
|
+
|
|
253
|
+
Run the new sets with `npx tsx scripts/evaluate-reference-discovery.ts MOD_ROOT GAME_ROOT --common-dev` and `--common-blind`. The blind half has now been scored once, so the next round needs a new one.
|
|
254
|
+
|
|
255
|
+
## Ten phrasings per command, a second blind set, and ten candidates (issue 64, round four)
|
|
256
|
+
|
|
257
|
+
Measured on 2026-11-14 on HOI4 1.19.4.1 with the kit's `hoi4_wiki` pack.
|
|
258
|
+
The direction, recorded on the issue: no runtime embeddings (a model download and a runtime dependency for a tool hobbyists install), a deterministic runtime, more phrasing data written at build time, and a fresh blind set that never saw that data.
|
|
259
|
+
|
|
260
|
+
**Data.** Twelve writers, one batch of about 100 each, wrote six new plain-word phrasings for every one of the 1,127 documented effects and triggers (6,747 added, none dropped by the checks: three to ten words, no command name, no underscore). Each writer saw only its batch with the documentation text and the existing phrasings. Modifiers were not part of this round and keep four. A sample reads like real questions ("fill the army chief slot with a character" for `activate_advisor`, "give a subject flat freedom points" for `add_autonomy_score`), and the output was checked by script, not item by item. With ten phrasings instead of four the per-term weight was too high, so `PHRASE_WEIGHT` went from 4 to 2. The weight was chosen on the older sets before the new blind set was looked at (3 and 2 tied on total first-place answers, 99 each across five sets).
|
|
261
|
+
|
|
262
|
+
**Blind set.** `scripts/reference-common-blind2-cases.ts` (`--common-blind2`) holds 48 questions written by a fresh author who saw no ranking code, no phrasing data and no results. It leans on the long tail (17 effects, 11 triggers, 5 modifiers, 7 wiki concepts, 3 exact names, 5 negatives). It was scored once before and once after the data change.
|
|
263
|
+
|
|
264
|
+
**How a hit is counted.** The first version of this evaluation matched a hit to the answer's documentation file, so a question whose author listed only `effects_documentation.md` counted `effects.md#add_timed_idea` (the same command, from the wiki table) as a miss. That under-counted every set whose author listed one file, and it made this round look weaker than it is (first place on the new set read 12 to 14 of 43). With `EVAL_BY_COMMAND=1` a result answers a question when it is the same command under any documentation file. The tables below use that.
|
|
265
|
+
|
|
266
|
+
| Set (HOI4 1.19.4.1, answerable questions) | First before / after | Within three | Within five | Within ten |
|
|
267
|
+
| ----------------------------------------- | -------------------: | -----------: | ----------: | ---------: |
|
|
268
|
+
| New blind set (43) | 23 / 31 | 30 / 36 | 33 / 37 | 36 / 39 |
|
|
269
|
+
| Common questions, first blind half (22) | 14 / 15 | 17 / 19 | 18 / 19 | 19 / 21 |
|
|
270
|
+
| Common questions, tuning half (20) | 14 / 16 | 16 / 18 | 17 / 18 | 19 / 19 |
|
|
271
|
+
| ADR 0078 fresh set (38) | 19 / 23 | 23 / 27 | 27 / 30 | 30 / 31 |
|
|
272
|
+
| Held-out (24) | 11 / 11 | 15 / 16 | 20 / 19 | 23 / 22 |
|
|
273
|
+
| Test (40) | 25 / 25 | 31 / 30 | 32 / 32 | 36 / 34 |
|
|
274
|
+
| Discovery (37) | 27 / 28 | 30 / 30 | 32 / 33 | 33 / 34 |
|
|
275
|
+
| Validation (24) | 21 / 21 | 22 / 22 | 22 / 22 | 24 / 24 |
|
|
276
|
+
|
|
277
|
+
On the two blind sets the right answer is among the first ten hits 21 of 22 times (95 percent) and 39 of 43 times (91 percent), and first on 15 of 22 and 31 of 43 (72 percent). The older sets, written for the earlier rounds, put it in the top ten between 82 and 100 percent of the time. Exact names stay first and the negatives return what they returned before.
|
|
278
|
+
|
|
279
|
+
**Ten short candidates.** The caller is an agent, which reads ten short lines as easily as one. `hoi4.reference_search` now returns up to ten hits by default (twelve at most), and a hit for an installed-documentation command carries a one-line meaning with the scopes it works in as its excerpt ("COUNTRY: Add a time-limited idea to country in scope"), a wiki table row carries its description cell, and the tool description tells the agent to read the candidates and pick the one that fits. A reply of ten hits is about 6 KB. Where the description is only script, the excerpt stays the plain best-matching lines.
|
|
280
|
+
|
|
281
|
+
Tried and not kept this round: doubling the weight of the per-command phrasing cards (mixed on every set).
|
|
282
|
+
Still missing: "check that my country is currently fighting a war" ranks `has_war` outside the first twelve, and nonsense questions still return a few weak hits.
|
|
283
|
+
|
|
220
284
|
## Compact context budgets
|
|
221
285
|
|
|
222
286
|
A 2026-09-27 check of the installed 3.5.0 server found that eight GUI results could contain only wiki sections even though the installed GUI documentation was available. The 3.5.1 source qualifies limits of one, two, and eight citations across the same six work surfaces. All eighteen cases retained installed documentation; limits of two or more also retained wiki citations. Required sources excluded by the limit appeared in `omittedSources`, separately from files absent under `missing`. The nine search queries still found all expected answer-bearing sections.
|
package/docs/tools.md
CHANGED
|
@@ -20,25 +20,25 @@ A test fails when this page differs from `tools/list`, so edit the tool descript
|
|
|
20
20
|
|
|
21
21
|
## References and source
|
|
22
22
|
|
|
23
|
-
| Tool | Purpose
|
|
24
|
-
| --------------------------- |
|
|
25
|
-
| `hoi4.reference_context` | Find documentation for the content you are building: events, decisions, ideas, focuses, technology, GUI, maps, localisation or AI.
|
|
26
|
-
| `hoi4.reference_search` | Find
|
|
27
|
-
| `hoi4.reference_read` | Read a documentation section returned by reference_search or reference_context. Pass its id and revision.
|
|
28
|
-
| `hoi4.source_lookup` | Find where a script symbol is defined and used across the game, DLC and mod. Pass a symbol, or a file path and line.
|
|
29
|
-
| `hoi4.script_validate` | Find broken syntax, commands and scopes in an effect, trigger or mod file using the installed docs. Unknown helpers and native argument blocks stay unresolved.
|
|
30
|
-
| `hoi4.error_log` | Find errors from the last game launch and group them by category, with source files, lines and fix hints. Show which files changed since the log and which errors appeared after a relaunch; mod entries come first.
|
|
31
|
-
| `hoi4.explain_error` | Explain error.log lines: the rule each one breaks, its file and line with the lines around it, and the fix, from a reviewed catalogue of the game's messages. Says whether the game documents the command a line names, and the closest documented names.
|
|
32
|
-
| `hoi4.mod_health` | Check a whole mod in one call: the last error.log, the engine check (unknown effects, triggers and modifiers, duplicate ids, broken overrides), script validation, and the localisation and asset audits. Returns the 10 problems that matter most, each counted with 2 examples, its fix and the tool to use next, and which audits ran.
|
|
33
|
-
| `hoi4.script_guard` | Check the files you wrote for invented commands: every effect, trigger and modifier that the installed game documentation does not list and no loaded file defines, with its file, line and the closest real name. Checks the named paths, or the mod script files changed in the last 120 minutes. Needs hoi4-engine.
|
|
34
|
-
| `hoi4.compat_check` | mod: compare this mod with another in both load orders: files at the same path and who wins, duplicate ids, definitions and hooks dropped, replace_path losses, and which order loses less. patch: store the vanilla files the mod overrides and list those a game update changed.
|
|
35
|
-
| `hoi4.mod_index` | Summarize the content in a mod or find a free event ID across the mod, game and dependencies. Use overview for descriptors, folders and definitions, or next_id with a namespace or prefix.
|
|
36
|
-
| `hoi4.localisation_inspect` | Read localisation in every language the game and mod ship. key: one key per language with file, line and layer, the languages lacking it and the files mentioning it. audit: keys the mod uses that no language defines, keys missing from a supported language, keys defined twice in one language, and file problems. coverage: keys per language.
|
|
37
|
-
| `hoi4.idea_inspect` | Read an idea or character across the game, DLC and mod. idea: category, picture sprite and texture, modifiers checked against the game docs, conditions, name in every language, the advisor it belongs to, and files mentioning it. character: name, roles with traits checked, portraits checked. audit: true checks every idea or character of the mod.
|
|
38
|
-
| `hoi4.system_inspect` | Read one definition of a newer system, or audit every one the mod makes: on_actions hooks, MIOs and policies, balance of power, special projects, operations and raids. Returns its parts, each reference with whether it exists, pictures, names in every language and problems.
|
|
39
|
-
| `hoi4.unit_inspect` | Read one order of battle (history/units), sub-unit, equipment or module, or equipment variant, or audit every one the mod makes. Checks template grids, divisions, fleets, air wings, equipment slots and modules, and each name they use.
|
|
40
|
-
| `hoi4.asset_inspect` | Read one sprite (texture size, format and frames), sound, sound effect or music track (audio file, sounds it plays), or flag (all three sizes), or audit every one the mod defines. Flags BC7 textures, missing files and wrong flag sizes.
|
|
41
|
-
| `hoi4.skill` | List the modding skills installed in the mod, or load one by name, at the kit version HOI4 Mod Setup pinned, with its hash. A file edited since Setup installed it is refused unless acceptLocalEdits.
|
|
23
|
+
| Tool | Purpose | Writes |
|
|
24
|
+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
25
|
+
| `hoi4.reference_context` | Find documentation for the content you are building: events, decisions, ideas, focuses, technology, GUI, maps, localisation or AI. | — |
|
|
26
|
+
| `hoi4.reference_search` | Find a modding rule in the offline wiki and installed game docs by plain words or script name. Returns up to 10 short candidates (limit up to 12) with file, lines, revision and, for a command, a one-line meaning and its scopes. Pick the one that fits, since several commands sound alike, then read it with hoi4.reference_read using its id and revision. | — |
|
|
27
|
+
| `hoi4.reference_read` | Read a documentation section returned by reference_search or reference_context. Pass its id and revision. | — |
|
|
28
|
+
| `hoi4.source_lookup` | Find where a script symbol is defined and used across the game, DLC and mod. Pass a symbol, or a file path and line. | — |
|
|
29
|
+
| `hoi4.script_validate` | Find broken syntax, commands and scopes in an effect, trigger or mod file using the installed docs. Unknown helpers and native argument blocks stay unresolved. | — |
|
|
30
|
+
| `hoi4.error_log` | Find errors from the last game launch and group them by category, with source files, lines and fix hints. Show which files changed since the log and which errors appeared after a relaunch; mod entries come first. | — |
|
|
31
|
+
| `hoi4.explain_error` | Explain error.log lines: the rule each one breaks, its file and line with the lines around it, and the fix, from a reviewed catalogue of the game's messages. Says whether the game documents the command a line names, and the closest documented names. | — |
|
|
32
|
+
| `hoi4.mod_health` | Check a whole mod in one call: the last error.log, the engine check (unknown effects, triggers and modifiers, duplicate ids, broken overrides), script validation, and the localisation and asset audits. Returns the 10 problems that matter most, each counted with 2 examples, its fix and the tool to use next, and which audits ran. | — |
|
|
33
|
+
| `hoi4.script_guard` | Check the files you wrote for invented commands: every effect, trigger and modifier that the installed game documentation does not list and no loaded file defines, with its file, line and the closest real name. Checks the named paths, or the mod script files changed in the last 120 minutes. Needs hoi4-engine. | — |
|
|
34
|
+
| `hoi4.compat_check` | mod: compare this mod with another in both load orders: files at the same path and who wins, duplicate ids, definitions and hooks dropped, replace_path losses, and which order loses less. patch: store the vanilla files the mod overrides and list those a game update changed. | — |
|
|
35
|
+
| `hoi4.mod_index` | Summarize the content in a mod or find a free event ID across the mod, game and dependencies. Use overview for descriptors, folders and definitions (the 50 busiest namespaces; pass a namespace or prefix to list those starting with it), or next_id with a namespace or prefix. | — |
|
|
36
|
+
| `hoi4.localisation_inspect` | Read localisation in every language the game and mod ship. key: one key per language with file, line and layer, the languages lacking it and the files mentioning it. audit: keys the mod uses that no language defines, keys missing from a supported language, keys defined twice in one language, and file problems. coverage: keys per language. | — |
|
|
37
|
+
| `hoi4.idea_inspect` | Read an idea or character across the game, DLC and mod. idea: category, picture sprite and texture, modifiers checked against the game docs, conditions, name in every language, the advisor it belongs to, and files mentioning it. character: name, roles with traits checked, portraits checked. audit: true checks every idea or character of the mod. | — |
|
|
38
|
+
| `hoi4.system_inspect` | Read one definition of a newer system, or audit every one the mod makes: on_actions hooks, MIOs and policies, balance of power, special projects, operations and raids. Returns its parts, each reference with whether it exists, pictures, names in every language and problems. | — |
|
|
39
|
+
| `hoi4.unit_inspect` | Read one order of battle (history/units), sub-unit, equipment or module, or equipment variant, or audit every one the mod makes. Checks template grids, divisions, fleets, air wings, equipment slots and modules, and each name they use. | — |
|
|
40
|
+
| `hoi4.asset_inspect` | Read one sprite (texture size, format and frames), sound, sound effect or music track (audio file, sounds it plays), or flag (all three sizes), or audit every one the mod defines. Flags BC7 textures, missing files and wrong flag sizes. | — |
|
|
41
|
+
| `hoi4.skill` | List the modding skills installed in the mod, or load one by name, at the kit version HOI4 Mod Setup pinned, with its hash. A file edited since Setup installed it is refused unless acceptLocalEdits. | — |
|
|
42
42
|
|
|
43
43
|
## Localisation
|
|
44
44
|
|
|
@@ -140,7 +140,7 @@ The CI stdio smoke suite sends each of these shapes to a real server process.
|
|
|
140
140
|
| Tool | Example arguments |
|
|
141
141
|
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
142
142
|
| `hoi4.reference_context` | `{"surface":"event","question":"fire an event after a delay"}` |
|
|
143
|
-
| `hoi4.reference_search` | `{"query":"add_timed_idea"}`
|
|
143
|
+
| `hoi4.reference_search` | `{"query":"add_timed_idea"}` or `{"query":"make a country hold elections now"}` |
|
|
144
144
|
| `hoi4.reference_read` | `{"id":"<hit id>","revision":"<hit revision>"}` |
|
|
145
145
|
| `hoi4.source_lookup` | `{"symbol":"my_scripted_effect"}` |
|
|
146
146
|
| `hoi4.script_validate` | `{"source":"add_political_power = 10","kind":"effect","scope":"country"}` or `{"path":"events/a.txt"}` |
|
package/docs/troubleshooting.md
CHANGED
|
@@ -57,6 +57,10 @@ This server reads source and never starts the game.
|
|
|
57
57
|
To reproduce a problem in game, read what the game logged with `hoi4.error_log` (the last launch only, with the file and line where the message names one), then fix the file and ask `hoi4.script_validate` with `path` to check it before relaunching.
|
|
58
58
|
For launching, loading a save and watching a campaign, pair it with the separate HOI4 Live Tools server (see [A running game](setup.md#a-running-game)).
|
|
59
59
|
|
|
60
|
+
## A game file I edited does not show up
|
|
61
|
+
|
|
62
|
+
The server reads the installed game once and then trusts that read for as long as the game's own version files (`hoi4_rev.txt`, `hoi4_branch.txt`, `clausewitz_rev.txt`, `checksum_manifest.txt`) and the game's top-level folders look the same. That keeps a focus call under a second. A game update changes those files, and the server reads the game again at once. A game file you edit in place without an update is not seen until the server restarts. Set the environment variable `HOI4_AGENT_FULL_GAME_SCAN` to any value to read the game on every call instead. A mod, a dependency and a game folder that has no `hoi4_rev.txt` are always read in full.
|
|
63
|
+
|
|
60
64
|
## Still stuck
|
|
61
65
|
|
|
62
66
|
Run `hoi4-agent-tools-setup --diagnose`, then open an issue at <https://github.com/klimPaskov/hoi4-agent-tools/issues> with the tool name, the arguments (without private paths), the error code and message, and the output of `hoi4-agent-tools-setup --diagnose`, which includes the server and Node.js versions.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/engine/bin/manifest.json
CHANGED
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
"binaries": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"file": "darwin-arm64/hoi4-engine",
|
|
7
|
-
"sha256": "
|
|
8
|
-
"size":
|
|
7
|
+
"sha256": "cfbe0d82f154c04696822c53e22717ea71a18f597d48156c7e5d037f7ba4e842",
|
|
8
|
+
"size": 4844304
|
|
9
9
|
},
|
|
10
10
|
"linux-arm64": {
|
|
11
11
|
"file": "linux-arm64/hoi4-engine",
|
|
12
|
-
"sha256": "
|
|
13
|
-
"size":
|
|
12
|
+
"sha256": "5167bc989a6432d4f6197e9173e27ea2129f838bbbeeb3f68424159ab393f7c4",
|
|
13
|
+
"size": 5186672
|
|
14
14
|
},
|
|
15
15
|
"linux-x64": {
|
|
16
16
|
"file": "linux-x64/hoi4-engine",
|
|
17
|
-
"sha256": "
|
|
18
|
-
"size":
|
|
17
|
+
"sha256": "650eced9e1ff698255aca3ca0bff182deb0acf86e64925e3c0cf474e45c1a0a9",
|
|
18
|
+
"size": 5594064
|
|
19
19
|
},
|
|
20
20
|
"win32-x64": {
|
|
21
21
|
"file": "win32-x64/hoi4-engine.exe",
|
|
22
|
-
"sha256": "
|
|
23
|
-
"size":
|
|
22
|
+
"sha256": "3d51e078f6bc18b84d807fe6ac3b3ee492165810e695509200cf00c3582c9e25",
|
|
23
|
+
"size": 4691968
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
Binary file
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hoi4-agent-tools",
|
|
9
|
-
"version": "4.
|
|
9
|
+
"version": "4.18.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fontsource-variable/roboto": "5.3.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
3
|
"mcpName": "io.github.klimPaskov/hoi4-agent-tools",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.18.0",
|
|
5
5
|
"description": "Build HOI4 mods: focus trees, events, decisions, worlds, GUI previews, docs and AI balance.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -116,8 +116,10 @@
|
|
|
116
116
|
"release:order:verify": "tsx scripts/verify-npm-release-order.ts",
|
|
117
117
|
"pack:check": "tsx scripts/check-package.ts",
|
|
118
118
|
"inspector": "tsx scripts/run-inspector.ts",
|
|
119
|
-
"check": "npm run format:check && npm run lint && npm run typecheck && npm run test:all && npm run fixtures:check && npm run schemas:check && npm run build && npm run pack:check && npm run registry:validate",
|
|
120
|
-
"prepack": "npm run build"
|
|
119
|
+
"check": "npm run changelog:check && npm run format:check && npm run lint && npm run typecheck && npm run test:all && npm run fixtures:check && npm run schemas:check && npm run build && npm run pack:check && npm run registry:validate",
|
|
120
|
+
"prepack": "npm run build",
|
|
121
|
+
"changelog:check": "tsx scripts/changelog.ts check",
|
|
122
|
+
"changelog:release": "tsx scripts/changelog.ts release"
|
|
121
123
|
},
|
|
122
124
|
"dependencies": {
|
|
123
125
|
"@fontsource-variable/roboto": "5.3.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/configuration.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/continuous-focus-palette.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/custom-weighted-pool.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/decision-inspect-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/error-log-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/event-feature-manifest.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/focus-plan.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/focus-planning-sidecar.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/geography-model.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/gui-animation-source.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/gui-helper.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/gui-scenario.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/helper-expansion-request.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/helper-expansion-summary.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.18.0/schemas/impact-inspect-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|