Integrate native OBW editor and three submenu themes (by Codex)
# Conflicts: # tools/public_release/check_public_tree.py
This commit is contained in:
commit
6636308cad
55 files changed
+5879
-8
No files matched your search
@@ -1,5 +1,9 @@
|
||||
# OBW: OpenBMH world, save and pack format (concept, format version 1.0)
|
||||
|
||||
The standalone editor additionally implements the non-playable
|
||||
[OBW 1.1 `editor-world-v1` profile](obw/editor-v1.md). This does not relax the
|
||||
Classic 1.0 content contract or seals. See [the editor guide](../EDITOR.md).
|
||||
|
||||
Status: **format concept with a complete Classic installation-content converter** for roadmap 0.2, with preparation for 0.4. `openbmh_import` produces `BMH-classic` and `FLTD-classic` worlds under the guarded [`runtime:classic-v1` contract](obw/classic-v1.md), including all startup inputs and media. The [import guide](obw/import.md) distinguishes this from the explicitly partial `legacy-database-v1` development export. The 0.2 development branch adds a sealed Classic runtime, portable launcher and native career checkpoints; see [the runtime contract](obw/runtime-0.2.md). The released 0.1 engine still reads legacy installations.
|
||||
|
||||
## 1. Goals and non-goals
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
# OBW 1.1 editor-world-v1
|
||||
|
||||
This additive profile is a native editing interchange. It does **not** change
|
||||
`classic-installation-v1`, its seals, the Classic runtime or save files.
|
||||
|
||||
## Identification
|
||||
|
||||
```json
|
||||
{
|
||||
"format": "openbmh-world",
|
||||
"format_version": "1.1",
|
||||
"min_reader": "1.1",
|
||||
"kind": "world",
|
||||
"title": {"default": "My world"},
|
||||
"start_date": "2026-07-01",
|
||||
"currency": {"code": "EUR", "minor_units": 2},
|
||||
"requires": ["editor:world-v1"],
|
||||
"extensions": [{"id": "x-editor", "version": "1"}],
|
||||
"x-editor": {"profile": "editor-world-v1", "playable": false}
|
||||
}
|
||||
```
|
||||
|
||||
The required editor capability is deliberately different from
|
||||
`runtime:classic-v1`. An edited world must not be resealed as a Classic world.
|
||||
On import the editor keeps the original manifest under
|
||||
`x-editor.original_manifest`, leaves compatibility/source regions intact, and
|
||||
requires Save As. An original Classic seal is historical evidence only in this
|
||||
profile. The existing Classic reader/validator is not broadened to accept it.
|
||||
|
||||
## Tables and values
|
||||
|
||||
The existing `world/*.json` and `assets/index.json` structure remains. Each table
|
||||
is an object with `schema` and `items`. Stable `id` identifiers (asset `key`)
|
||||
are references, never array positions. Existing identifiers and unknown fields
|
||||
are preserved. New identifiers have a namespace and opaque suffix.
|
||||
|
||||
The editor adds explicit club `competition`, competition `members` (club IDs),
|
||||
and player `squad_order`. These are the editable projections of Classic league
|
||||
slots/squad rows. Moving a club updates league membership in the same
|
||||
transaction. The historical Classic slots stay source evidence; a future
|
||||
playable format adapter must choose and implement its own generation rules.
|
||||
|
||||
Player `born` can be `null`; an imported `age_at_start` object remains an age,
|
||||
not an invented birth date. `team: null` is an unassigned projection; an
|
||||
`x-editor.membership_unresolved` or `membership_unassigned` marker distinguishes
|
||||
missing/contradictory source facts from a verified free agent. Reported
|
||||
nationalities and sporting eligibility remain separate. No full roster is
|
||||
cut down to the 24 rows of a Classic compatibility view.
|
||||
|
||||
Attribute sets declare their actual numeric ranges in `world/rules.json`:
|
||||
`type: "attribute_set"`, optional `attribute_set` alias, and `fields` mapping
|
||||
attribute names to `{min,max,...}`. The Classic importer declares strength
|
||||
0–99, form/condition/technique/bonus 0–127, skills 0–3. An FC set remains a
|
||||
separate 0–99 system. Missing values are null/absent; `unrated@1` with empty
|
||||
attributes does not invent a rating.
|
||||
|
||||
Competition `trophy` and optional fallback remain logical asset references;
|
||||
images are indexed just like crests and portraits. Arbitrary new competitions
|
||||
can use their own trophy or a package-supplied generic trophy.
|
||||
|
||||
## Sources, conflicts and images
|
||||
|
||||
- `x-source/` can contain unchanged or losslessly gzipped normalized source
|
||||
tables, input hashes, source-to-projection identifiers and identity evidence.
|
||||
References include package-local file paths and JSON pointers. Sources do
|
||||
not become authoritative merely by being present.
|
||||
- `x-editor/review.json` has `items` with `id`, `reason`, `resolved`, optional
|
||||
`table`, `entity`, `field` (JSON pointer), and `alternatives` with `value` and
|
||||
source descriptions. Choosing a value updates its target plus the review
|
||||
record in one undoable transaction. Original alternatives remain.
|
||||
- Raster and SVG sources are stored unchanged. Identity imports preserve exact
|
||||
bytes. Edits use a normalized recipe: `angle` degrees, `flip_x`, `flip_y`,
|
||||
`crop: {x,y,width,height}`. Mirroring precedes clockwise rotation; rotation
|
||||
expands the canvas; crop coordinates refer to that expanded canvas. Values
|
||||
are finite, crop dimensions positive and inside [0,1]. JSON floating-point
|
||||
values must survive round trips.
|
||||
- An edited asset's `x-editor` stores `original`, `original_sha256` and
|
||||
`transform`. Originals live in `x-editor/originals/`, rendered files in
|
||||
`assets/edited/`, addressed by SHA-256. Raster edits are PNG with transparent
|
||||
expanded edges, SVG edits remain vectors. Import does not upscale portraits.
|
||||
Referenced external SVG resources are refused. Originals and source recipes
|
||||
remain available on re-edit; no repeated destructive resampling is needed.
|
||||
- Portrait part sets and frozen `appearance` recipes remain valid. The editor
|
||||
composes those layers for display; a rename never regenerates the recipe.
|
||||
|
||||
## Container, validation and saving
|
||||
|
||||
ZIP/ZIP64, stored or deflated entries; UTF-8 JSON; package-local paths without
|
||||
absolute paths, `..`, backslashes or symlinks. The editor limits are 100,000
|
||||
entries, 64 MiB per uncompressed entry and 2 GiB total uncompressed bytes. This
|
||||
is independent of the smaller Classic 1.0 reader limits.
|
||||
|
||||
The editor checks identifier uniqueness, typed references, valid dates,
|
||||
declared attribute ranges and assets. Missing facts/source questions are
|
||||
warnings; structural errors block saving. A transaction either validates and
|
||||
commits or is rolled back. `revision` increases monotonically, including
|
||||
undo/redo. Undoing to the saved state clears the dirty flag.
|
||||
|
||||
Unknown entries, extensions, binary assets and untouched table bytes are
|
||||
retained. Large assets remain lazily read from an immutable source snapshot.
|
||||
Saving streams a temporary ZIP and atomically replaces the destination only
|
||||
after finalization. Modified-on-disk sources require Save As. The editor never
|
||||
writes legacy files or a running save.
|
||||
|
||||
The [1.1 editor schema](schema/1.1/editor-world.json) documents structural
|
||||
constraints. Runtime validation additionally resolves cross-table references
|
||||
and rule-declared scales. This is not a claim that the generic world can yet
|
||||
be played by a game engine.
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://openbmh.org/schema/1.1/editor-world.json",
|
||||
"title": "OBW 1.1 editor-world-v1 manifest",
|
||||
"type": "object",
|
||||
"required": ["format", "format_version", "min_reader", "kind", "title", "requires", "x-editor"],
|
||||
"properties": {
|
||||
"format": {"const": "openbmh-world"},
|
||||
"format_version": {"const": "1.1"},
|
||||
"min_reader": {"const": "1.1"},
|
||||
"kind": {"const": "world"},
|
||||
"title": {"oneOf": [{"type": "string"}, {"type": "object", "additionalProperties": {"type": "string"}}]},
|
||||
"start_date": {"type": "string", "format": "date"},
|
||||
"requires": {"type": "array", "contains": {"const": "editor:world-v1"}, "items": {"type": "string"}},
|
||||
"x-editor": {
|
||||
"type": "object", "required": ["profile", "playable"],
|
||||
"properties": {"profile": {"const": "editor-world-v1"}, "playable": {"const": false}},
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": true,
|
||||
"$defs": {
|
||||
"table": {"type": "object", "required": ["schema", "items"], "properties": {"schema": {"type": "string"}, "items": {"type": "array", "items": {"type": "object"}}}, "additionalProperties": true},
|
||||
"transform": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"angle": {"type": "number", "minimum": -360, "maximum": 360},
|
||||
"flip_x": {"type": "boolean"}, "flip_y": {"type": "boolean"},
|
||||
"crop": {"type": "object", "properties": {
|
||||
"x": {"type": "number", "minimum": 0, "maximum": 1}, "y": {"type": "number", "minimum": 0, "maximum": 1},
|
||||
"width": {"type": "number", "exclusiveMinimum": 0, "maximum": 1}, "height": {"type": "number", "exclusiveMinimum": 0, "maximum": 1}
|
||||
}, "additionalProperties": true}
|
||||
}, "additionalProperties": true
|
||||
},
|
||||
"review": {"type": "object", "required": ["id", "reason", "resolved", "alternatives"], "properties": {
|
||||
"id": {"type": "string", "minLength": 1}, "reason": {"type": "string"}, "resolved": {"type": "boolean"},
|
||||
"table": {"type": "string"}, "entity": {"type": "string"}, "field": {"type": "string", "pattern": "^/"},
|
||||
"alternatives": {"type": "array", "items": {"type": "object", "required": ["value"], "additionalProperties": true}}
|
||||
}, "additionalProperties": true}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user