Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/licensing-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ Cualquier coincidencia en nombres de archivos o de componentes es generica

No se agregaron dependencias nuevas; se usan las ya presentes
(pixi.js, next, react) con sus licencias existentes.

## WorldEditor map formats (#23)

Classic `.map` / `.inf` / `.dat` interoperability is implemented as original
TypeScript in `server/src/lib/worldEditorMapConverter.ts`. No VB6 WorldEditor
source was copied. See `docs/worldeditor-map-import-export.md`.
40 changes: 40 additions & 0 deletions docs/worldeditor-map-import-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# WorldEditor map import / export (issue #23)

Clean-room converter between classic WorldEditor formats (.map / .inf / .dat) and OpenAO playable mapas_source (meta.json, terrain.json, specials.json, npcs.json).

## License / AGPL-3.0

Official editor: https://github.com/ao-org/argentum-online-worldeditor (AGPL-3.0).

- Reading/writing file formats for interoperability is allowed.
- This module does not copy VB6 WorldEditor source; it is original TypeScript from public binary/INI layouts and OpenAO schema.
- Do not vendor WorldEditor code or resources.

## Format summary (classic Int16 layout)

### .map
1. Int16LE version (typically 1)
2. For each tile y=1..100, x=1..100: Uint8 flags (0x01 blocked, 0x02/0x04/0x08 layers 2-4, 0x10 trigger), Int16LE layer1, optional Int16LE extras.

Extended nextgen headers (particles/lights) are reported as untranslated.

### .inf
- [X-Y] exits -> specials.exits
- [NPCn] -> specials.npcs + npcs.json
- [OBJn] -> specials.objects

### .dat
[MAPAn] metadata -> meta.json. Unknown keys are listed in the conversion report.


## CLI

From server/:

tsx src/scripts/worldEditorMapImportExport.ts export --map-id=1 --source-dir=./mapas_source --classic-dir=/tmp/classic-out
tsx src/scripts/worldEditorMapImportExport.ts import --map-id=1 --classic-dir=/tmp/classic-out --output-dir=/tmp/mapas_imported --pretty
tsx src/scripts/worldEditorMapImportExport.ts validate --map-id=1 --source-dir=./mapas_source

## Tests

node --experimental-strip-types --test src/tests/worldEditorMapConverter.test.ts
2 changes: 2 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"test:connection-policy": "tsx src/scripts/testConnectionPolicy.ts",
"start": "node dist/server.js",
"lint": "eslint \"./src/**/*.ts\"",
"worldeditor-maps": "tsx src/scripts/worldEditorMapImportExport.ts",
"test:worldeditor-maps": "tsx --test src/tests/worldEditorMapConverter.test.ts",
"world-map": "node scripts/build-world-map.cjs",
"compare-original-data": "tsx src/scripts/compareOriginalData.ts"
},
Expand Down
Loading