diff --git a/CHANGELOG.md b/CHANGELOG.md index 975ab38024043fcafa5c875cfb748ba3d7a90c53..1cdeecbb0399f3659afaf1a2785008159efa7082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## 0.5.0 + +Everything is in English: theme keys, names and descriptions, sprite folders and example maps. + +### Changed + +- Ten theme keys were French and are now English: `GLACIAIRE` -> `GLACIER`, `INONDE` -> `FLOODED`, + `VOLCAN` -> `VOLCANO`, `FORET` -> `DARK_FOREST`, `HIVER` -> `WINTER`, `PRINTEMPS` -> `SPRING`, + `ETE` -> `SUMMER`, `AUTOMNE` -> `AUTUMN`, `FUTURISTE` -> `FUTURISTIC`, `ELECTRONIQUE` -> `ELECTRONIC`. + The MCP tools list only the English keys and answer an old key with its replacement + ("Theme 'GLACIAIRE' was renamed 'GLACIER'"); `getTheme()` in the builder API and the web API + still accept the old keys. +- Every theme has an English display name and description (for example "Mournevald Crypt", + "Werewolf Den", "Frozen Tundra"). +- Sprite folders, sprite ids and tileset names follow the new keys (`assets/glacier/`, + `assets/flooded/`, `assets/electronic/`, ...). A map saved before 0.5.0 with one of the renamed + themes points at the old folder: save it again, or rename the folder in its tileset paths. +- Example maps have English file names and contents: `water-cavern.tmj`, `ice-fortress.tmj`, + `hacker-lair.tmj` and `nemotron-crypt-example.tmj`. + +### Added + +- `npm test` runs every offline suite once; `npm run test:loop` runs them 5 times in a row. +- The smoke test loops over all 20 themes: English key, name and description, each layout preset + builds a map the player can walk with no warning, and a saved map finds its sprites. + ## 0.4.1 Walking reachability: a map can load correctly and still not be explorable. Suggested in diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b14f7d2cc699dc4ff07c2264b4855f7de0569cf..4459c125fad06271234ec02810332db7266d0bca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,8 +8,8 @@ welcome. ```bash npm install npm run build # compile tiled-mcp/src to tiled-mcp/dist -npm run smoke # 38 offline end-to-end checks; must stay green -npm run smoke:http # hosted mode checks; must stay green +npm test # every offline suite: 96 + 96 (legacy coordinates) + 39 checks; must stay green +npm run test:loop # the same 5 times in a row, to catch flaky failures npm run docs # regenerate docs/tools.md and docs/themes.md after changing tools or themes npm run inspect # try tools by hand in the MCP Inspector npm run preview -- maps/.tmj # look at a map without Tiled @@ -40,7 +40,7 @@ See [docs/themes.md](docs/themes.md#adding-a-theme). ## Pull requests 1. One topic per pull request. -2. `npm run build && npm run smoke && npm run smoke:http` passes, and `npm run docs` shows no unexpected diff. +2. `npm run build && npm test` passes, and `npm run docs` shows no unexpected diff. 3. Update the README or `docs/` when behaviour changes, and add a line to `CHANGELOG.md`. By contributing you agree that your contribution is licensed under the [MIT license](LICENSE). diff --git a/README.md b/README.md index e6c73144cd99a713fe80c27cd9e5ce32ca8a8f53..809e80de6028d2d3f6e9fdc487368fed86aafeb6 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ git clone https://github.com/4math2379/Tiled-MCP-Server.git cd Tiled-MCP-Server npm install # installs the server workspace npm run build # compiles tiled-mcp/src to tiled-mcp/dist -npm run smoke # optional: 38 offline end-to-end checks +npm test # optional: every offline test suite (96 + 96 + 39 checks) ``` Then register the server with your MCP client. With **Claude Code**, from the repository folder: @@ -216,26 +216,26 @@ Full parameters, generated from the server itself: **[docs/tools.md](docs/tools. | Theme key | Display name | Setting | Sprites | |---|---|---|---| -| `CRYPT` | Crypte mournevaldienne | Burial vaults, cracked flagstones, poison vents | ✅ | -| `CASTLE` | Castel Von Drak | Black marble halls, throne room, grand stairs | ✅ | -| `WEREWOLF_DEN` | Tanière de loups-garous | Damp caves, bones, blood pools | ✅ | -| `TAVERN_BLOOD_PRINCE` | Auberge du Prince Sanglant | Tavern interior, oak tables, hearth | ✅ | -| `VILLAGE` | Village mournevaldien | Wet cobblestones, half-timbered houses, well | ✅ | -| `HAUNTED_FOREST` | Forêt de Drakenmark | Dark undergrowth, brambles, parasitic mist | ✅ | -| `MAUSOLEUM` | Mausolée | Veined marble, fallen-angel statues, urns | ✅ | -| `BLOOD_TOMB` | Tombeau de sang | Ritual sanctuary, bleeding runes, altar | ✅ | -| `AQUATIC` | Eaux Croupies | Stagnant water, water lilies, sunken ruins | ✅ | -| `GLACIAIRE` | Toundra Glacée | Black ice, frozen statues, thin ice | ✅ | -| `INONDE` | Cote Inondee | Drowned city, kelp, deep currents | ✅ | -| `ELECTRONIQUE` | Reseau Electronique | Circuit boards, cables, mainframe cores | ✅ | -| `VOLCAN` | Pente Volcanique | Lava flows, obsidian, ash | ➖ | -| `FORET` | Foret Sombre | Twisted woods, quicksand, standing stones | ➖ | -| `HIVER` | Plaine Enneigee | Snowfields, frozen lakes, cairns | ➖ | -| `PRINTEMPS` | Prairie Printaniere | Flowering meadows, streams, maypole | ➖ | -| `ETE` | Plaine Estivale | Golden wheat, cracked earth, scarecrows | ➖ | -| `AUTOMNE` | Foret d'Automne | Russet leaves, bog mire, mushrooms | ➖ | -| `DESOLATION` | Terre Desolee | Ash pits, charred trees, ruins | ➖ | -| `FUTURISTE` | Cite Futuriste | Chrome, neon, plasma leaks, server racks | ➖ | +| `CRYPT` | Mournevald Crypt | Burial vaults, cracked flagstones, poison vents | ✅ | +| `CASTLE` | Castle Von Drak | Black marble halls, throne room, grand stairs | ✅ | +| `WEREWOLF_DEN` | Werewolf Den | Damp caves, bones, blood pools | ✅ | +| `TAVERN_BLOOD_PRINCE` | Blood Prince Inn | Tavern interior, oak tables, hearth | ✅ | +| `VILLAGE` | Mournevald Village | Wet cobblestones, half-timbered houses, well | ✅ | +| `HAUNTED_FOREST` | Drakenmark Forest | Dark undergrowth, brambles, parasitic mist | ✅ | +| `MAUSOLEUM` | Mausoleum | Veined marble, fallen-angel statues, urns | ✅ | +| `BLOOD_TOMB` | Blood Tomb | Ritual sanctuary, bleeding runes, altar | ✅ | +| `AQUATIC` | Stagnant Waters | Stagnant water, water lilies, sunken ruins | ✅ | +| `GLACIER` | Frozen Tundra | Black ice, frozen statues, thin ice | ✅ | +| `FLOODED` | Flooded Coast | Drowned city, kelp, deep currents | ✅ | +| `ELECTRONIC` | Electronic Network | Circuit boards, cables, mainframe cores | ✅ | +| `VOLCANO` | Volcanic Slope | Lava flows, obsidian, ash | ➖ | +| `DARK_FOREST` | Dark Forest | Twisted woods, quicksand, standing stones | ➖ | +| `WINTER` | Snowy Plain | Snowfields, frozen lakes, cairns | ➖ | +| `SPRING` | Spring Meadow | Flowering meadows, streams, maypole | ➖ | +| `SUMMER` | Summer Plain | Golden wheat, cracked earth, scarecrows | ➖ | +| `AUTUMN` | Autumn Forest | Russet leaves, bog mire, mushrooms | ➖ | +| `DESOLATION` | Desolate Land | Ash pits, charred trees, ruins | ➖ | +| `FUTURISTIC` | Futuristic City | Chrome, neon, plasma leaks, server racks | ➖ | ✅ sprites bundled in `assets/` · ➖ no sprites yet: the maps are valid and Tiled shows placeholders until you [generate the sprites](docs/sprite-generation.md). @@ -247,8 +247,8 @@ Full parameters, generated from the server itself: **[docs/tools.md](docs/tools. castle stairs boulder deep water - frozen statue - mainframe core + frozen statue + mainframe core fallen angel statue

@@ -279,8 +279,8 @@ All variables, the hosted-mode settings, the `.env` lookup order and security no Map building is free and offline. Generating new sprites calls FLUX.1-dev through Hugging Face Inference Providers and **costs money per sprite**. The tools never overwrite an existing sprite unless you pass `force`, and the batch script asks for `--yes`: ```bash -node scripts/gen-theme-set.mjs VOLCAN --dry-run # free: shows what would be generated -node scripts/gen-theme-set.mjs VOLCAN --yes # paid: about 10 sprites +node scripts/gen-theme-set.mjs VOLCANO --dry-run # free: shows what would be generated +node scripts/gen-theme-set.mjs VOLCANO --yes # paid: about 10 sprites ``` Read **[docs/sprite-generation.md](docs/sprite-generation.md)** before you start. @@ -311,7 +311,8 @@ docs/ documentation, banner and preview images | Command | What it does | |---|---| | `npm run build` | Compile the server | -| `npm run smoke` | Start the server and run 62 offline end-to-end checks | +| `npm test` | Run every offline test suite once; `npm run test:loop` runs them 5 times in a row | +| `npm run smoke` | Start the server and run 96 offline end-to-end checks, including one loop over all 20 themes | | `npm run start:web` | Start the hosted mode (web page and MCP over HTTP) on port 7860 | | `npm run smoke:http` | Test the hosted mode offline, with a stand-in for the AI model | | `npm run inspect` | Open the server in the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) | diff --git a/assets/electronique/decoration_minor.png b/assets/electronic/decoration_minor.png similarity index 100% rename from assets/electronique/decoration_minor.png rename to assets/electronic/decoration_minor.png diff --git a/assets/electronique/difficult_terrain.png b/assets/electronic/difficult_terrain.png similarity index 100% rename from assets/electronique/difficult_terrain.png rename to assets/electronic/difficult_terrain.png diff --git a/assets/electronique/door_closed.png b/assets/electronic/door_closed.png similarity index 100% rename from assets/electronique/door_closed.png rename to assets/electronic/door_closed.png diff --git a/assets/electronique/hazard_primary.png b/assets/electronic/hazard_primary.png similarity index 100% rename from assets/electronique/hazard_primary.png rename to assets/electronic/hazard_primary.png diff --git a/assets/electronique/obstacle_decor.png b/assets/electronic/obstacle_decor.png similarity index 100% rename from assets/electronique/obstacle_decor.png rename to assets/electronic/obstacle_decor.png diff --git a/assets/electronique/stairs.png b/assets/electronic/stairs.png similarity index 100% rename from assets/electronique/stairs.png rename to assets/electronic/stairs.png diff --git a/assets/electronique/walkable_floor.png b/assets/electronic/walkable_floor.png similarity index 100% rename from assets/electronique/walkable_floor.png rename to assets/electronic/walkable_floor.png diff --git a/assets/electronique/walkable_floor_alt.png b/assets/electronic/walkable_floor_alt.png similarity index 100% rename from assets/electronique/walkable_floor_alt.png rename to assets/electronic/walkable_floor_alt.png diff --git a/assets/electronique/wall.png b/assets/electronic/wall.png similarity index 100% rename from assets/electronique/wall.png rename to assets/electronic/wall.png diff --git a/assets/electronique/wall_corner.png b/assets/electronic/wall_corner.png similarity index 100% rename from assets/electronique/wall_corner.png rename to assets/electronic/wall_corner.png diff --git a/assets/inonde/decoration_minor.png b/assets/flooded/decoration_minor.png similarity index 100% rename from assets/inonde/decoration_minor.png rename to assets/flooded/decoration_minor.png diff --git a/assets/inonde/difficult_terrain.png b/assets/flooded/difficult_terrain.png similarity index 100% rename from assets/inonde/difficult_terrain.png rename to assets/flooded/difficult_terrain.png diff --git a/assets/inonde/door_closed.png b/assets/flooded/door_closed.png similarity index 100% rename from assets/inonde/door_closed.png rename to assets/flooded/door_closed.png diff --git a/assets/inonde/hazard_primary.png b/assets/flooded/hazard_primary.png similarity index 100% rename from assets/inonde/hazard_primary.png rename to assets/flooded/hazard_primary.png diff --git a/assets/inonde/obstacle_decor.png b/assets/flooded/obstacle_decor.png similarity index 100% rename from assets/inonde/obstacle_decor.png rename to assets/flooded/obstacle_decor.png diff --git a/assets/inonde/stairs.png b/assets/flooded/stairs.png similarity index 100% rename from assets/inonde/stairs.png rename to assets/flooded/stairs.png diff --git a/assets/inonde/walkable_floor.png b/assets/flooded/walkable_floor.png similarity index 100% rename from assets/inonde/walkable_floor.png rename to assets/flooded/walkable_floor.png diff --git a/assets/inonde/walkable_floor_alt.png b/assets/flooded/walkable_floor_alt.png similarity index 100% rename from assets/inonde/walkable_floor_alt.png rename to assets/flooded/walkable_floor_alt.png diff --git a/assets/inonde/wall.png b/assets/flooded/wall.png similarity index 100% rename from assets/inonde/wall.png rename to assets/flooded/wall.png diff --git a/assets/inonde/wall_corner.png b/assets/flooded/wall_corner.png similarity index 100% rename from assets/inonde/wall_corner.png rename to assets/flooded/wall_corner.png diff --git a/assets/glaciaire/decoration_minor.png b/assets/glacier/decoration_minor.png similarity index 100% rename from assets/glaciaire/decoration_minor.png rename to assets/glacier/decoration_minor.png diff --git a/assets/glaciaire/difficult_terrain.png b/assets/glacier/difficult_terrain.png similarity index 100% rename from assets/glaciaire/difficult_terrain.png rename to assets/glacier/difficult_terrain.png diff --git a/assets/glaciaire/door_closed.png b/assets/glacier/door_closed.png similarity index 100% rename from assets/glaciaire/door_closed.png rename to assets/glacier/door_closed.png diff --git a/assets/glaciaire/hazard_primary.png b/assets/glacier/hazard_primary.png similarity index 100% rename from assets/glaciaire/hazard_primary.png rename to assets/glacier/hazard_primary.png diff --git a/assets/glaciaire/obstacle_decor.png b/assets/glacier/obstacle_decor.png similarity index 100% rename from assets/glaciaire/obstacle_decor.png rename to assets/glacier/obstacle_decor.png diff --git a/assets/glaciaire/stairs.png b/assets/glacier/stairs.png similarity index 100% rename from assets/glaciaire/stairs.png rename to assets/glacier/stairs.png diff --git a/assets/glaciaire/walkable_floor.png b/assets/glacier/walkable_floor.png similarity index 100% rename from assets/glaciaire/walkable_floor.png rename to assets/glacier/walkable_floor.png diff --git a/assets/glaciaire/walkable_floor_alt.png b/assets/glacier/walkable_floor_alt.png similarity index 100% rename from assets/glaciaire/walkable_floor_alt.png rename to assets/glacier/walkable_floor_alt.png diff --git a/assets/glaciaire/wall.png b/assets/glacier/wall.png similarity index 100% rename from assets/glaciaire/wall.png rename to assets/glacier/wall.png diff --git a/assets/glaciaire/wall_corner.png b/assets/glacier/wall_corner.png similarity index 100% rename from assets/glaciaire/wall_corner.png rename to assets/glacier/wall_corner.png diff --git a/docs/client-setup.md b/docs/client-setup.md index a88cfcbf9e535e5fca56c82e9aeb52c8a9a162c8..e2cba38d9cf812ca64e28337525ee347d3fc221a 100644 --- a/docs/client-setup.md +++ b/docs/client-setup.md @@ -190,4 +190,4 @@ This opens the official [MCP Inspector](https://github.com/modelcontextprotocol/ your browser, connected to the server. You can list the tools, call `create_map`, then `generate_crypt_layout`, then `save_to_disk`, and open the file in Tiled. -For an automated check, `npm run smoke` runs 39 end-to-end checks without any network access. +For an automated check, `npm run smoke` runs 96 end-to-end checks without any network access. diff --git a/docs/sprite-generation.md b/docs/sprite-generation.md index a4602c7673855f8b81c862384b3ceb71c3a8e872..0c3832d847bb3803428d9c48315fa69d0a35978a 100644 --- a/docs/sprite-generation.md +++ b/docs/sprite-generation.md @@ -8,8 +8,8 @@ ## When you need it -12 of the 20 themes ship with sprites in `assets/`. The other 8 (`VOLCAN`, `FORET`, `HIVER`, -`PRINTEMPS`, `ETE`, `AUTOMNE`, `DESOLATION`, `FUTURISTE`) produce valid maps, but Tiled shows +12 of the 20 themes ship with sprites in `assets/`. The other 8 (`VOLCANO`, `DARK_FOREST`, `WINTER`, +`SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`) produce valid maps, but Tiled shows placeholders until their PNGs exist. `list_themes` reports the status of every theme. You also need generation for **contextual variants**, such as an alembic instead of the default @@ -37,8 +37,8 @@ wait for a single tool call. Use the script: ```bash npm run build -node scripts/gen-theme-set.mjs VOLCAN --dry-run # free: lists the sprites it would generate -node scripts/gen-theme-set.mjs VOLCAN --yes # paid +node scripts/gen-theme-set.mjs VOLCANO --dry-run # free: lists the sprites it would generate +node scripts/gen-theme-set.mjs VOLCANO --yes # paid node scripts/gen-theme-set.mjs --missing --dry-run # every theme that lacks sprites ``` diff --git a/docs/themes.md b/docs/themes.md index a17dc54d99bfeb59d638997c01f607511f55a4d3..d10a1024bd17b14f817a25e4a5f01ae74f71ea59 100644 --- a/docs/themes.md +++ b/docs/themes.md @@ -12,26 +12,26 @@ Sprites live in `assets//.png`. | Key | Display name | Setting | Roles | Sprites | |---|---|---|---|---| -| `CRYPT` | Crypte mournevaldienne | Burial vaults under chapels, cracked flagstones, poison vents from broken sarcophagi. | 10 | bundled (10/10) | -| `CASTLE` | Castel Von Drak | Black marble and basalt halls, broken stained glass, throne room, grand stairs. | 9 | bundled (9/9) | -| `WEREWOLF_DEN` | Tanière de loups-garous | Damp caves dug into the forest, bone-strewn earth floor, claw-marked rock, blood pools. | 8 | bundled (8/8) | -| `TAVERN_BLOOD_PRINCE` | Auberge du Prince Sanglant | Dark floorboards, heavy beams, oak tables, crackling hearth. No active traps. | 8 | bundled (8/8) | -| `VILLAGE` | Village mournevaldien | Rain-soaked cobblestones, shuttered half-timbered houses, abandoned stalls, well and gallows. | 7 | bundled (7/7) | -| `HAUNTED_FOREST` | Forêt de Drakenmark | Stifling undergrowth of black moss, fallen trunks, parasitic mist that slows walkers. | 7 | bundled (7/7) | -| `MAUSOLEUM` | Mausolée | Grey-veined marble, fallen-angel statues, funeral urns in niches. No hazards. | 8 | bundled (8/8) | -| `BLOOD_TOMB` | Tombeau de sang | Deep ritual sanctuary, pulsing bleeding runes, central altar. | 8 | bundled (8/8) | -| `AQUATIC` | Eaux Croupies | Black stagnant water, water lilies, sunken ruins, haunted marsh. | 10 | bundled (10/10) | -| `GLACIAIRE` | Toundra Glacée | Black ice, figures frozen in the ice, frost, haunted tundra. | 10 | bundled (10/10) | -| `INONDE` | Cote Inondee | Drowned city under the waves, hanging kelp, broken bridges, deep currents. | 10 | bundled (10/10) | -| `VOLCAN` | Pente Volcanique | Lava flows, cooled black rock, flying ash, active caldera. | 10 | not generated yet (0/10) | -| `FORET` | Foret Sombre | Twisted woods, thick moss, exposed roots, misty clearings, quicksand. | 10 | not generated yet (0/10) | -| `HIVER` | Plaine Enneigee | Powder snow, frozen lakes, frosted branches, trappers' huts. | 10 | not generated yet (0/10) | -| `PRINTEMPS` | Prairie Printaniere | Flowering meadows, clear streams, budding trees, druid circles. | 10 | not generated yet (0/10) | -| `ETE` | Plaine Estivale | Golden grass, ripe wheat, cloudless heat, abandoned granaries. | 10 | not generated yet (0/10) | -| `AUTOMNE` | Foret d'Automne | Russet leaves, mushrooms, morning mist, bog mire. | 10 | not generated yet (0/10) | -| `DESOLATION` | Terre Desolee | Cold ash, charred trees, barren ground, post-cataclysm ruins. | 10 | not generated yet (0/10) | -| `FUTURISTE` | Cite Futuriste | Chrome, cold neon, holographic panels, dystopian megacity. | 10 | not generated yet (0/10) | -| `ELECTRONIQUE` | Reseau Electronique | Circuit boards, optic fibre, silent servers, AI cores. | 10 | bundled (10/10) | +| `CRYPT` | Mournevald Crypt | Burial vaults under chapels, cracked flagstones, poison vents from broken sarcophagi. | 10 | bundled (10/10) | +| `CASTLE` | Castle Von Drak | Black marble and basalt halls, broken stained glass, throne room, grand stairs. | 9 | bundled (9/9) | +| `WEREWOLF_DEN` | Werewolf Den | Damp caves dug into the forest, bone-strewn earth floor, claw-marked rock, blood pools. | 8 | bundled (8/8) | +| `TAVERN_BLOOD_PRINCE` | Blood Prince Inn | Dark floorboards, heavy beams, oak tables, crackling hearth. No active traps. | 8 | bundled (8/8) | +| `VILLAGE` | Mournevald Village | Rain-soaked cobblestones, shuttered half-timbered houses, abandoned stalls, well and gallows. | 7 | bundled (7/7) | +| `HAUNTED_FOREST` | Drakenmark Forest | Stifling undergrowth of black moss, fallen trunks, parasitic mist that slows walkers. | 7 | bundled (7/7) | +| `MAUSOLEUM` | Mausoleum | Grey-veined marble, fallen-angel statues, funeral urns in niches. No hazards. | 8 | bundled (8/8) | +| `BLOOD_TOMB` | Blood Tomb | Deep ritual sanctuary, pulsing bleeding runes, central altar. | 8 | bundled (8/8) | +| `AQUATIC` | Stagnant Waters | Black stagnant water, water lilies, sunken ruins, haunted marsh. | 10 | bundled (10/10) | +| `GLACIER` | Frozen Tundra | Black ice, figures frozen in the ice, frost, haunted tundra. | 10 | bundled (10/10) | +| `FLOODED` | Flooded Coast | Drowned city under the waves, hanging kelp, broken bridges, deep currents. | 10 | bundled (10/10) | +| `VOLCANO` | Volcanic Slope | Lava flows, cooled black rock, flying ash, active caldera. | 10 | not generated yet (0/10) | +| `DARK_FOREST` | Dark Forest | Twisted woods, thick moss, exposed roots, misty clearings, quicksand. | 10 | not generated yet (0/10) | +| `WINTER` | Snowy Plain | Powder snow, frozen lakes, frosted branches, trappers' huts. | 10 | not generated yet (0/10) | +| `SPRING` | Spring Meadow | Flowering meadows, clear streams, budding trees, druid circles. | 10 | not generated yet (0/10) | +| `SUMMER` | Summer Plain | Golden grass, ripe wheat, cloudless heat, abandoned granaries. | 10 | not generated yet (0/10) | +| `AUTUMN` | Autumn Forest | Russet leaves, mushrooms, morning mist, bog mire. | 10 | not generated yet (0/10) | +| `DESOLATION` | Desolate Land | Cold ash, charred trees, barren ground, post-cataclysm ruins. | 10 | not generated yet (0/10) | +| `FUTURISTIC` | Futuristic City | Chrome, cold neon, holographic panels, dystopian megacity. | 10 | not generated yet (0/10) | +| `ELECTRONIC` | Electronic Network | Circuit boards, optic fibre, silent servers, AI cores. | 10 | bundled (10/10) | ## Roles per theme @@ -46,59 +46,59 @@ Sprites live in `assets//.png`. | `MAUSOLEUM` | `walkable_floor`, `walkable_floor_alt`, `wall`, `difficult_terrain`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | | `BLOOD_TOMB` | `walkable_floor`, `walkable_floor_alt`, `wall`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed` | | `AQUATIC` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `GLACIAIRE` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `INONDE` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `VOLCAN` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `FORET` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `HIVER` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `PRINTEMPS` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `ETE` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `AUTOMNE` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `GLACIER` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `FLOODED` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `VOLCANO` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `DARK_FOREST` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `WINTER` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `SPRING` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `SUMMER` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `AUTUMN` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | | `DESOLATION` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `FUTURISTE` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | -| `ELECTRONIQUE` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `FUTURISTIC` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | +| `ELECTRONIC` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | ## Original descriptions -**CRYPT** (Crypte mournevaldienne): Caveaux funéraires sous les chapelles, dalles fissurées, runes mortuaires, gaz toxiques émanant des sarcophages disjoints. +**CRYPT** (Mournevald Crypt): Burial vaults beneath the chapels, cracked flagstones, funeral runes, toxic gas seeping from broken sarcophagi. -**CASTLE** (Castel Von Drak): Marbres noirs, basalte poli, vitraux brisés, bannières frappées du blason des Von Drak. Salle du trône, escaliers grandioses, candélabres en fer noir. +**CASTLE** (Castle Von Drak): Black marble, polished basalt, shattered stained glass, banners bearing the Von Drak crest. Throne room, grand staircases, black iron candelabra. -**WEREWOLF_DEN** (Tanière de loups-garous): Cavernes humides creusées dans la forêt de Drakenmark, sol en terre battue jonché d'ossements, parois rocheuses entaillées par les griffes, mares de sang frénétique près des proies récentes. +**WEREWOLF_DEN** (Werewolf Den): Damp caves dug into the Drakenmark forest, packed-earth floor strewn with bones, rock walls scored by claws, pools of blood near fresh prey. -**TAVERN_BLOOD_PRINCE** (Auberge du Prince Sanglant): Parquet sombre, enduit fissuré, lourde charpente apparente. Tables rondes en chêne, âtre crépitant, bar marbré de taches anciennes. Pas de pièges actifs — la peur suffit. +**TAVERN_BLOOD_PRINCE** (Blood Prince Inn): Dark floorboards, cracked plaster, heavy exposed beams. Round oak tables, a crackling hearth, a bar marked with old stains. No active traps: fear is enough. -**VILLAGE** (Village mournevaldien): Pavés humides luisant sous la pluie perpétuelle, maisons à colombages aux fenêtres closes, étals de marché abandonnés, puits central et potence rouillée sur la place. +**VILLAGE** (Mournevald Village): Wet cobblestones gleaming under endless rain, half-timbered houses with shuttered windows, abandoned market stalls, a central well and a rusty gallows on the square. -**HAUNTED_FOREST** (Forêt de Drakenmark): Sous-bois étouffant de mousses noires, troncs morts couchés, brumes parasitaires qui s'enroulent autour des chevilles et ralentissent la marche. +**HAUNTED_FOREST** (Drakenmark Forest): Stifling undergrowth of black moss, fallen dead trunks, clinging mists that coil around the ankles and slow every step. -**MAUSOLEUM** (Mausolée): Marbre veiné de gris, statues d'anges déchus aux ailes brisées, urnes funéraires alignées dans les niches, chuchotements à la limite de l'audible. +**MAUSOLEUM** (Mausoleum): Grey-veined marble, statues of fallen angels with broken wings, funeral urns lined up in niches, whispers at the edge of hearing. -**BLOOD_TOMB** (Tombeau de sang): Sanctuaire profond consacré aux pactes anciens. Dalles rituelles, runes saignantes qui pulsent au passage, autel central, candélabres en fer noir. Le sang ne sèche jamais sur ce sol. +**BLOOD_TOMB** (Blood Tomb): A deep sanctuary devoted to ancient pacts. Ritual slabs, bleeding runes that pulse as you pass, a central altar, black iron candelabra. Blood never dries on this floor. -**AQUATIC** (Eaux Croupies): Eaux noires stagnantes, nénuphars, ruines submergées, brume sur l'eau. Marais hanté, pontons pourris, cryptes inondées. +**AQUATIC** (Stagnant Waters): Black stagnant water, water lilies, sunken ruins, mist on the water. Haunted marsh, rotten pontoons, flooded crypts. -**GLACIAIRE** (Toundra Glacée): Glace noire, figures gelées prises dans la glace, givre, stalactites de pierre. Toundra hantée, pontons de gel, cryptes sous pergélisol. +**GLACIER** (Frozen Tundra): Black ice, figures frozen in the ice, frost, stone stalactites. Haunted tundra, frozen pontoons, crypts under the permafrost. -**INONDE** (Cote Inondee): Villes englouties sous les flots, ruines submergees, algues pendantes, eaux saumustres. Quartiers noyés, ponts rompus, cryptes immergees. +**FLOODED** (Flooded Coast): Towns swallowed by the sea, sunken ruins, hanging seaweed, brackish water. Drowned districts, broken bridges, submerged crypts. -**VOLCAN** (Pente Volcanique): Coulées de lave, roches noires refroidies, cendres volantes, chaleur étouffante. Caldera active, ponts de basalte, cryptes de cendre. +**VOLCANO** (Volcanic Slope): Lava flows, cooled black rock, drifting ash, stifling heat. Active caldera, basalt bridges, crypts of ash. -**FORET** (Foret Sombre): Bois sylvains tordus, mousse épaisse, racines apparentes, clairières brumeuses. Foret hantée, huttes de bûcherons, tombes sous les chênes. +**DARK_FOREST** (Dark Forest): Twisted woods, thick moss, exposed roots, misty clearings. Haunted forest, woodcutters' huts, graves under the oaks. -**HIVER** (Plaine Enneigee): Neige poudreuse, lacs gelés, branches givrées, brouillard glacial. Toundra hivernale, refuges de trappeurs, tombeaux sous la neige. +**WINTER** (Snowy Plain): Powder snow, frozen lakes, frosted branches, freezing fog. Winter tundra, trappers' shelters, tombs under the snow. -**PRINTEMPS** (Prairie Printaniere): Champs en fleurs, herbe tendre, ruisseaux clairs, arbres en bourgeon. Prairies ouvertes, cercles de druides, fontaines sacrées. +**SPRING** (Spring Meadow): Fields in bloom, tender grass, clear streams, budding trees. Open meadows, druid circles, sacred fountains. -**ETE** (Plaine Estivale): Herbe dorée, blés mûrs, ciel sans nuage, chaleur accablante. Moissons, greniers abandonnés, ossuaires sous le soleil. +**SUMMER** (Summer Plain): Golden grass, ripe wheat, cloudless sky, crushing heat. Harvest fields, abandoned granaries, ossuaries under the sun. -**AUTOMNE** (Foret d'Automne): Feuilles rousses, champignons, brume matinale, gibier traqué. Bois automnal, sentiers couverts, tombes sous les érables. +**AUTUMN** (Autumn Forest): Russet leaves, mushrooms, morning mist, hunted game. Autumn woods, leaf-covered paths, graves under the maples. -**DESOLATION** (Terre Desolee): Cendres froides, arbres carbonisés, sols stériles, ciel gris. Paysage post-cataclysmique, ruines calcinées, ossuaires à ciel ouvert. +**DESOLATION** (Desolate Land): Cold ash, charred trees, barren ground, grey sky. Post-cataclysm landscape, burnt ruins, open-air ossuaries. -**FUTURISTE** (Cite Futuriste): Métal chromé, néons froids, panneaux holographiques, gratte-ciel en ruine. Megalopole dystopique, laboratoires secrets, cités volantes. +**FUTURISTIC** (Futuristic City): Chrome metal, cold neon, holographic panels, ruined skyscrapers. Dystopian megacity, secret laboratories, flying cities. -**ELECTRONIQUE** (Reseau Electronique): Circuits imprimés, fibres optiques, données en flux, serveurs silencieux. Matrice numérique, nœuds de calcul, foyers d'IA. +**ELECTRONIC** (Electronic Network): Printed circuits, optical fibres, streaming data, silent servers. Digital matrix, compute nodes, AI cores. ## Adding a theme diff --git a/docs/tools.md b/docs/tools.md index 9386a657906ca4e90071fbc01915cb34fe0b7848..26a9e30fcf18790a9e22b172dcfcfb3639d4019b 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -47,7 +47,7 @@ Creates an empty isometric (default) or orthogonal Tiled map in the given theme | `name` | string | yes | Display name of the map, e.g. 'Crypt under the abandoned chapel'. 1..120 chars | | `width` | integer | yes | Width in cells, 4..256 (1 cell = 5 ft in tabletop terms). 4..256 | | `height` | integer | yes | Height in cells, 4..256. 4..256 | -| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIAIRE`, `INONDE`, `VOLCAN`, `FORET`, `HIVER`, `PRINTEMPS`, `ETE`, `AUTOMNE`, `DESOLATION`, `FUTURISTE`, `ELECTRONIQUE` | yes | Theme key from list_themes, e.g. CRYPT | +| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes, e.g. CRYPT | | `orientation` | `isometric`, `orthogonal` | no | Defaults to isometric | ### list_maps @@ -383,7 +383,7 @@ Free: returns the exact FLUX prompt, geometry and size generate_tile_sprite woul | Parameter | Type | Required | Notes | |---|---|---|---| -| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIAIRE`, `INONDE`, `VOLCAN`, `FORET`, `HIVER`, `PRINTEMPS`, `ETE`, `AUTOMNE`, `DESOLATION`, `FUTURISTE`, `ELECTRONIQUE` | yes | Theme key from list_themes | +| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, e.g. walkable_floor, wall, obstacle_decor | | `material` | string | no | | | `lighting` | string | no | | @@ -397,7 +397,7 @@ PAID: generates one isometric sprite for (theme, role) with FLUX.1-dev via Huggi | Parameter | Type | Required | Notes | |---|---|---|---| -| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIAIRE`, `INONDE`, `VOLCAN`, `FORET`, `HIVER`, `PRINTEMPS`, `ETE`, `AUTOMNE`, `DESOLATION`, `FUTURISTE`, `ELECTRONIQUE` | yes | Theme key from list_themes | +| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes | | `role` | `walkable_floor`, `walkable_floor_alt`, `wall`, `wall_corner`, `difficult_terrain`, `hazard_primary`, `obstacle_decor`, `decoration_minor`, `door_closed`, `stairs` | yes | Tile role, e.g. walkable_floor, wall, obstacle_decor | | `variant` | string | no | Contextual variant slug, e.g. 'alembic' for a laboratory: saved as __.png and bound to a map with override_tile_image. pattern `^[a-z0-9_]+$` | | `material` | string | no | Override of the material description, e.g. 'alchemical workbench with brass alembics' | @@ -415,7 +415,7 @@ PAID and slow: generates every sprite of a theme that is missing on disk (about | Parameter | Type | Required | Notes | |---|---|---|---| -| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIAIRE`, `INONDE`, `VOLCAN`, `FORET`, `HIVER`, `PRINTEMPS`, `ETE`, `AUTOMNE`, `DESOLATION`, `FUTURISTE`, `ELECTRONIQUE` | yes | Theme key from list_themes | +| `theme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | yes | Theme key from list_themes | | `force` | boolean | no | Regenerate sprites that already exist (paid again) | | `seed` | integer | no | -9007199254740991..9007199254740991 | @@ -468,7 +468,7 @@ Puts a building on an outdoor map and, by default, creates its interior as a new | `name` | string | no | Display name, e.g. 'Miller house'; also the base of the building id. 1..80 chars | | `door` | `south`, `east` | no | Footprint edge with the door: south (default, bottom-left face) or east (bottom-right face) | | `interior` | boolean | no | Create and link an interior map (default true); false places a building that cannot be entered | -| `interiorTheme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIAIRE`, `INONDE`, `VOLCAN`, `FORET`, `HIVER`, `PRINTEMPS`, `ETE`, `AUTOMNE`, `DESOLATION`, `FUTURISTE`, `ELECTRONIQUE` | no | Theme of the interior (default per type: TAVERN_BLOOD_PRINCE, MAUSOLEUM or CASTLE) | +| `interiorTheme` | `CRYPT`, `CASTLE`, `WEREWOLF_DEN`, `TAVERN_BLOOD_PRINCE`, `VILLAGE`, `HAUNTED_FOREST`, `MAUSOLEUM`, `BLOOD_TOMB`, `AQUATIC`, `GLACIER`, `FLOODED`, `VOLCANO`, `DARK_FOREST`, `WINTER`, `SPRING`, `SUMMER`, `AUTUMN`, `DESOLATION`, `FUTURISTIC`, `ELECTRONIC` | no | Theme of the interior (default per type: TAVERN_BLOOD_PRINCE, MAUSOLEUM or CASTLE) | | `interiorWidth` | integer | no | Interior width in cells (default per type). 5..256 | | `interiorHeight` | integer | no | Interior height in cells (default per type). 5..256 | | `spriteVariant` | string | no | Use assets/buildings/__.png instead of .png. pattern `^[a-z0-9_]+$` | diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 31054254b8ba3a664f1950c0235883cd7781ad6d..3404c4e679c7cafe402c15fff32b726df82f2fea 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -6,7 +6,7 @@ Start with the automated check. It starts the server and exercises it end to end npm run build && npm run smoke ``` -If it prints `73 passed, 0 failed`, the server works and the problem is in the client setup. +If it prints `96 passed, 0 failed`, the server works and the problem is in the client setup. ## The tools do not appear in my client diff --git a/maps/README.md b/maps/README.md index 4b20513148e6ede9278223cc6b4716eca664896a..6c3baa5254c69693b23dfd00755f3056133ea433 100644 --- a/maps/README.md +++ b/maps/README.md @@ -3,15 +3,15 @@ Open any of these in [Tiled](https://www.mapeditor.org) (File, Open) or render a PNG preview: ```bash -npm run preview -- maps/forteresse-glace-etage.tmj +npm run preview -- maps/ice-fortress.tmj ``` | File | Theme | Size | How it was made | |---|---|---|---| -| `exemple-crypte-nemotron.tmj` | `CRYPT` | 20x14 | Built by a Nemotron agent through the MCP tools with an early version of the server. The crypt preset ran on a map smaller than it needs, so some rooms overlap and two doors share a cell; current versions refuse that size (the crypt preset needs 27x18). A prop behind the north door also seals the north room, which `validate_map`'s walking check now reports. Kept as a real agent-made example. | -| `caverne-aquatique.tmj` | `AQUATIC` | 64x64 | `scripts/create-aquatic-map.mjs` | -| `forteresse-glace-etage.tmj` | `GLACIAIRE` | 64x64 | `scripts/create-glacier-map.mjs` | -| `reseau-electronique-repaire-hacker.tmj` | `ELECTRONIQUE` | 64x64 | `scripts/create-electronic-hacker-map.mjs` | +| `nemotron-crypt-example.tmj` | `CRYPT` | 20x14 | Built by a Nemotron agent through the MCP tools with an early version of the server. The crypt preset ran on a map smaller than it needs, so some rooms overlap and two doors share a cell; current versions refuse that size (the crypt preset needs 27x18). A prop behind the north door also seals the north room, which `validate_map`'s walking check now reports. Kept as a real agent-made example; its names were translated to English. | +| `water-cavern.tmj` | `AQUATIC` | 64x64 | `scripts/create-aquatic-map.mjs` | +| `ice-fortress.tmj` | `GLACIER` | 64x64 | `scripts/create-glacier-map.mjs` | +| `hacker-lair.tmj` | `ELECTRONIC` | 64x64 | `scripts/create-electronic-hacker-map.mjs` | | `crossroads-village/` | `VILLAGE` and interiors | 40x40 + 7 maps | `scripts/create-village-world.mjs` | `crossroads-village/` is a sample **world**: an outdoor map with six buildings you can enter diff --git a/maps/reseau-electronique-repaire-hacker.tmj b/maps/hacker-lair.tmj similarity index 95% rename from maps/reseau-electronique-repaire-hacker.tmj rename to maps/hacker-lair.tmj index f42618ab7954465ec9b347d9a8ec5a8fd8e79276..76217ec91d614453dbb52900286b6785b1315c9f 100644 --- a/maps/reseau-electronique-repaire-hacker.tmj +++ b/maps/hacker-lair.tmj @@ -14,7 +14,7 @@ "tilesets": [ { "firstgid": 1, - "name": "electronique-tileset", + "name": "electronic-tileset", "tilewidth": 64, "tileheight": 32, "tilecount": 10, @@ -30,11 +30,11 @@ }, { "name": "spriteId", - "value": "electronique.pcb_trace", + "value": "electronic.pcb_trace", "type": "string" } ], - "image": "../assets/electronique/walkable_floor.png", + "image": "../assets/electronic/walkable_floor.png", "imagewidth": 64, "imageheight": 32 }, @@ -48,11 +48,11 @@ }, { "name": "spriteId", - "value": "electronique.chip_substrate", + "value": "electronic.chip_substrate", "type": "string" } ], - "image": "../assets/electronique/walkable_floor_alt.png", + "image": "../assets/electronic/walkable_floor_alt.png", "imagewidth": 64, "imageheight": 32 }, @@ -66,11 +66,11 @@ }, { "name": "spriteId", - "value": "electronique.server_casing", + "value": "electronic.server_casing", "type": "string" } ], - "image": "../assets/electronique/wall.png", + "image": "../assets/electronic/wall.png", "imagewidth": 64, "imageheight": 64 }, @@ -84,11 +84,11 @@ }, { "name": "spriteId", - "value": "electronique.circuit_corner", + "value": "electronic.circuit_corner", "type": "string" } ], - "image": "../assets/electronique/wall_corner.png", + "image": "../assets/electronic/wall_corner.png", "imagewidth": 64, "imageheight": 64 }, @@ -102,11 +102,11 @@ }, { "name": "spriteId", - "value": "electronique.tangled_cable", + "value": "electronic.tangled_cable", "type": "string" } ], - "image": "../assets/electronique/difficult_terrain.png", + "image": "../assets/electronic/difficult_terrain.png", "imagewidth": 64, "imageheight": 32 }, @@ -120,11 +120,11 @@ }, { "name": "spriteId", - "value": "electronique.power_surge", + "value": "electronic.power_surge", "type": "string" } ], - "image": "../assets/electronique/hazard_primary.png", + "image": "../assets/electronic/hazard_primary.png", "imagewidth": 64, "imageheight": 64 }, @@ -138,11 +138,11 @@ }, { "name": "spriteId", - "value": "electronique.mainframe_core", + "value": "electronic.mainframe_core", "type": "string" } ], - "image": "../assets/electronique/obstacle_decor.png", + "image": "../assets/electronic/obstacle_decor.png", "imagewidth": 64, "imageheight": 64 }, @@ -156,11 +156,11 @@ }, { "name": "spriteId", - "value": "electronique.blinking_led", + "value": "electronic.blinking_led", "type": "string" } ], - "image": "../assets/electronique/decoration_minor.png", + "image": "../assets/electronic/decoration_minor.png", "imagewidth": 64, "imageheight": 32 }, @@ -174,11 +174,11 @@ }, { "name": "spriteId", - "value": "electronique.biometric_door", + "value": "electronic.biometric_door", "type": "string" } ], - "image": "../assets/electronique/door_closed.png", + "image": "../assets/electronic/door_closed.png", "imagewidth": 64, "imageheight": 64 }, @@ -192,11 +192,11 @@ }, { "name": "spriteId", - "value": "electronique.access_ladder", + "value": "electronic.access_ladder", "type": "string" } ], - "image": "../assets/electronique/stairs.png", + "image": "../assets/electronic/stairs.png", "imagewidth": 64, "imageheight": 64 } @@ -257,7 +257,7 @@ "y": 1856, "width": 32, "height": 32, - "name": "coffre-donnees-hacker", + "name": "hacker-data-chest", "type": "chest", "visible": true, "rotation": 0, @@ -320,7 +320,7 @@ }, { "name": "npcName", - "value": "Hacker-reseau", + "value": "Network Hacker", "type": "string" } ] @@ -342,7 +342,7 @@ }, { "name": "npcName", - "value": "Hacker-reseau", + "value": "Network Hacker", "type": "string" } ] @@ -364,7 +364,7 @@ }, { "name": "npcName", - "value": "Hacker-reseau", + "value": "Network Hacker", "type": "string" } ] @@ -374,7 +374,7 @@ "x": 784, "y": 1776, "point": true, - "name": "securite-1", + "name": "security-1", "type": "enemy", "visible": true, "rotation": 0, @@ -386,7 +386,7 @@ }, { "name": "npcName", - "value": "Securite-numerique", + "value": "Security Daemon", "type": "string" } ] @@ -408,7 +408,7 @@ }, { "name": "npcName", - "value": "IA-rogue", + "value": "Rogue AI", "type": "string" } ] @@ -423,12 +423,12 @@ "properties": [ { "name": "theme", - "value": "ELECTRONIQUE", + "value": "ELECTRONIC", "type": "string" }, { "name": "mapName", - "value": "Reseau Electronique - Repaire Hacker", + "value": "Electronic Network - Hacker Lair", "type": "string" } ] diff --git a/maps/forteresse-glace-etage.tmj b/maps/ice-fortress.tmj similarity index 95% rename from maps/forteresse-glace-etage.tmj rename to maps/ice-fortress.tmj index ced4a57bc319c10b0ac35948b99aca6a470aed45..fecb01dc9b34042207f4794d9bc9bbf71a0dd0f2 100644 --- a/maps/forteresse-glace-etage.tmj +++ b/maps/ice-fortress.tmj @@ -14,7 +14,7 @@ "tilesets": [ { "firstgid": 1, - "name": "glaciaire-tileset", + "name": "glacier-tileset", "tilewidth": 64, "tileheight": 32, "tilecount": 10, @@ -30,11 +30,11 @@ }, { "name": "spriteId", - "value": "glaciaire.black_ice", + "value": "glacier.black_ice", "type": "string" } ], - "image": "../assets/glaciaire/walkable_floor.png", + "image": "../assets/glacier/walkable_floor.png", "imagewidth": 64, "imageheight": 32 }, @@ -48,11 +48,11 @@ }, { "name": "spriteId", - "value": "glaciaire.frost_flagstone", + "value": "glacier.frost_flagstone", "type": "string" } ], - "image": "../assets/glaciaire/walkable_floor_alt.png", + "image": "../assets/glacier/walkable_floor_alt.png", "imagewidth": 64, "imageheight": 32 }, @@ -66,11 +66,11 @@ }, { "name": "spriteId", - "value": "glaciaire.glacial_ice", + "value": "glacier.glacial_ice", "type": "string" } ], - "image": "../assets/glaciaire/wall.png", + "image": "../assets/glacier/wall.png", "imagewidth": 64, "imageheight": 64 }, @@ -84,11 +84,11 @@ }, { "name": "spriteId", - "value": "glaciaire.frost_corner", + "value": "glacier.frost_corner", "type": "string" } ], - "image": "../assets/glaciaire/wall_corner.png", + "image": "../assets/glacier/wall_corner.png", "imagewidth": 64, "imageheight": 64 }, @@ -102,11 +102,11 @@ }, { "name": "spriteId", - "value": "glaciaire.cracked_ice", + "value": "glacier.cracked_ice", "type": "string" } ], - "image": "../assets/glaciaire/difficult_terrain.png", + "image": "../assets/glacier/difficult_terrain.png", "imagewidth": 64, "imageheight": 32 }, @@ -120,11 +120,11 @@ }, { "name": "spriteId", - "value": "glaciaire.thin_ice", + "value": "glacier.thin_ice", "type": "string" } ], - "image": "../assets/glaciaire/hazard_primary.png", + "image": "../assets/glacier/hazard_primary.png", "imagewidth": 64, "imageheight": 64 }, @@ -138,11 +138,11 @@ }, { "name": "spriteId", - "value": "glaciaire.frozen_statue", + "value": "glacier.frozen_statue", "type": "string" } ], - "image": "../assets/glaciaire/obstacle_decor.png", + "image": "../assets/glacier/obstacle_decor.png", "imagewidth": 64, "imageheight": 64 }, @@ -156,11 +156,11 @@ }, { "name": "spriteId", - "value": "glaciaire.icicles", + "value": "glacier.icicles", "type": "string" } ], - "image": "../assets/glaciaire/decoration_minor.png", + "image": "../assets/glacier/decoration_minor.png", "imagewidth": 64, "imageheight": 32 }, @@ -174,11 +174,11 @@ }, { "name": "spriteId", - "value": "glaciaire.frosted_door", + "value": "glacier.frosted_door", "type": "string" } ], - "image": "../assets/glaciaire/door_closed.png", + "image": "../assets/glacier/door_closed.png", "imagewidth": 64, "imageheight": 64 }, @@ -192,11 +192,11 @@ }, { "name": "spriteId", - "value": "glaciaire.ice_stairs", + "value": "glacier.ice_stairs", "type": "string" } ], - "image": "../assets/glaciaire/stairs.png", + "image": "../assets/glacier/stairs.png", "imagewidth": 64, "imageheight": 64 } @@ -257,7 +257,7 @@ "y": 1024, "width": 32, "height": 32, - "name": "coffre-sur-le-lac", + "name": "lake-chest", "type": "chest", "visible": true, "rotation": 0, @@ -280,7 +280,7 @@ "y": 192, "width": 32, "height": 32, - "name": "coffre-ne", + "name": "north-east-chest", "type": "chest", "visible": true, "rotation": 0, @@ -303,7 +303,7 @@ "y": 1024, "width": 32, "height": 32, - "name": "levier-pont-levis", + "name": "drawbridge-lever", "type": "lever", "visible": true, "rotation": 0, @@ -349,7 +349,7 @@ }, { "name": "npcName", - "value": "Seigneur des Glaces", + "value": "Ice Lord", "type": "string" } ] @@ -388,7 +388,7 @@ }, { "name": "npcName", - "value": "Givre-Rôdeur", + "value": "Frost Stalker", "type": "string" } ] @@ -410,7 +410,7 @@ }, { "name": "npcName", - "value": "Givre-Rôdeur", + "value": "Frost Stalker", "type": "string" } ] @@ -432,7 +432,7 @@ }, { "name": "npcName", - "value": "Esprit de Glace", + "value": "Ice Spirit", "type": "string" } ] @@ -454,7 +454,7 @@ }, { "name": "npcName", - "value": "Esprit de Glace", + "value": "Ice Spirit", "type": "string" } ] @@ -476,7 +476,7 @@ }, { "name": "npcName", - "value": "Givre-Rôdeur", + "value": "Frost Stalker", "type": "string" } ] @@ -498,7 +498,7 @@ }, { "name": "npcName", - "value": "Givre-Rôdeur", + "value": "Frost Stalker", "type": "string" } ] @@ -513,12 +513,12 @@ "properties": [ { "name": "theme", - "value": "GLACIAIRE", + "value": "GLACIER", "type": "string" }, { "name": "mapName", - "value": "Forteresse de Glace - Donjon Principal v4", + "value": "Ice Fortress - Main Keep", "type": "string" } ] diff --git a/maps/exemple-crypte-nemotron.tmj b/maps/nemotron-crypt-example.tmj similarity index 98% rename from maps/exemple-crypte-nemotron.tmj rename to maps/nemotron-crypt-example.tmj index f95f3bd492ea3981f3340be3c14d7cbc976f5098..c9ef9251e93ef90d2eef921932d228723f1cce19 100644 --- a/maps/exemple-crypte-nemotron.tmj +++ b/maps/nemotron-crypt-example.tmj @@ -1294,7 +1294,7 @@ "y": 192, "width": 32, "height": 32, - "name": "Coffre verrouillé (chambre nord)", + "name": "Locked chest (north chamber)", "type": "chest", "visible": true, "rotation": 0, @@ -1322,7 +1322,7 @@ "y": 256, "width": 32, "height": 32, - "name": "Piège à fléchettes devant la crypte", + "name": "Dart trap before the crypt", "type": "trap", "visible": true, "rotation": 0, @@ -1388,7 +1388,7 @@ "x": 304.0, "y": 208.0, "point": true, - "name": "Squelette patrouille nef (gauche)", + "name": "Skeleton patrol, nave (left)", "type": "enemy", "visible": true, "rotation": 0, @@ -1400,7 +1400,7 @@ }, { "name": "npcName", - "value": "Squelette", + "value": "Skeleton", "type": "string" } ] @@ -1410,7 +1410,7 @@ "x": 368.0, "y": 208.0, "point": true, - "name": "Squelette patrouille nef (droite)", + "name": "Skeleton patrol, nave (right)", "type": "enemy", "visible": true, "rotation": 0, @@ -1422,7 +1422,7 @@ }, { "name": "npcName", - "value": "Squelette", + "value": "Skeleton", "type": "string" } ] @@ -1432,7 +1432,7 @@ "x": 400.0, "y": 400.0, "point": true, - "name": "Bastellus (dort dans la crypte centrale)", + "name": "Bastellus (asleep in the central crypt)", "type": "enemy", "visible": true, "rotation": 0, @@ -1464,7 +1464,7 @@ }, { "name": "mapName", - "value": "Crypte sous la chapelle abandonnée", + "value": "Crypt under the abandoned chapel", "type": "string" } ] diff --git a/maps/caverne-aquatique.tmj b/maps/water-cavern.tmj similarity index 98% rename from maps/caverne-aquatique.tmj rename to maps/water-cavern.tmj index e5f68c154914cd3432debad980fb2634751c247e..82b5b0c810be5aab7975ba074dc472f5a23c841d 100644 --- a/maps/caverne-aquatique.tmj +++ b/maps/water-cavern.tmj @@ -257,7 +257,7 @@ "y": 1024, "width": 32, "height": 32, - "name": "sarcophage-submerge", + "name": "sunken-sarcophagus", "type": "chest", "visible": true, "rotation": 0, @@ -303,7 +303,7 @@ }, { "name": "npcName", - "value": "Seigneur des Abysses", + "value": "Lord of the Depths", "type": "string" } ] @@ -342,7 +342,7 @@ }, { "name": "npcName", - "value": "Rampant des Eaux", + "value": "Water Crawler", "type": "string" } ] @@ -364,7 +364,7 @@ }, { "name": "npcName", - "value": "Rampant des Eaux", + "value": "Water Crawler", "type": "string" } ] @@ -386,7 +386,7 @@ }, { "name": "npcName", - "value": "Esprit de l'Onde", + "value": "Wave Spirit", "type": "string" } ] @@ -408,7 +408,7 @@ }, { "name": "npcName", - "value": "Esprit de l'Onde", + "value": "Wave Spirit", "type": "string" } ] @@ -430,7 +430,7 @@ }, { "name": "npcName", - "value": "Rampant des Eaux", + "value": "Water Crawler", "type": "string" } ] @@ -452,7 +452,7 @@ }, { "name": "npcName", - "value": "Rampant des Eaux", + "value": "Water Crawler", "type": "string" } ] @@ -472,7 +472,7 @@ }, { "name": "mapName", - "value": "Caverne Aquatique Souterraine", + "value": "Underground Water Cavern", "type": "string" } ] diff --git a/package-lock.json b/package-lock.json index 97af4e3c342090c6d12aa43f4c316d93b2026920..6a6ab5717491220fa2c500afa5eabcff81788aa4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tiled-mcp-server", - "version": "0.4.1", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tiled-mcp-server", - "version": "0.4.1", + "version": "0.5.0", "license": "MIT", "workspaces": [ "tiled-mcp" @@ -1723,7 +1723,7 @@ }, "tiled-mcp": { "name": "tiled-map-builder-mcp", - "version": "0.4.1", + "version": "0.5.0", "license": "MIT", "dependencies": { "@huggingface/inference": "^4.13.15", diff --git a/package.json b/package.json index 767792598bd1f1c2906298773f620175a5e71a03..8cea31610d10290cc872715bdd2b28d2795755ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tiled-mcp-server", - "version": "0.4.1", + "version": "0.5.0", "description": "Tiled Map Builder MCP: an MCP server that lets AI agents compose isometric Tiled maps, with sample maps, sprites, an agent skill and docs.", "private": true, "license": "MIT", @@ -20,6 +20,8 @@ "preview": "node scripts/render-map-preview.mjs", "smoke": "node scripts/smoke-test.mjs", "smoke:http": "node scripts/smoke-http.mjs", + "test": "node scripts/test-loop.mjs 1", + "test:loop": "node scripts/test-loop.mjs 5", "docs": "node scripts/gen-docs.mjs" }, "engines": { diff --git a/scripts/README.md b/scripts/README.md index 8a03f2858cf6e12a6875842e65f1eb81045f97a5..1b65af2b2740a75914c63ba3ca1209e9808f2e7a 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -4,13 +4,14 @@ Run them from the repository root after `npm install && npm run build`. | Script | npm shortcut | Cost | What it does | |---|---|---|---| -| `smoke-test.mjs` | `npm run smoke` | free, offline | Starts the server and runs 73 end-to-end checks over stdio, including the walking checks. Pass `screen` to test the legacy coordinate mode. | +| `smoke-test.mjs` | `npm run smoke` | free, offline | Starts the server and runs 96 end-to-end checks over stdio, including the walking checks and a loop over every theme. Pass `screen` to test the legacy coordinate mode. | +| `test-loop.mjs` | `npm test`, `npm run test:loop` | free, offline | Runs every suite above (both coordinate modes and the hosted mode) once, or 5 times in a row with `test:loop` (`node scripts/test-loop.mjs 20` for 20); stops at the first failure. | | `smoke-http.mjs` | `npm run smoke:http` | free, offline | Starts the hosted mode with a scripted stand-in for the AI model: web routes, MCP sessions over HTTP, downloads, isolation, and that every paid call uses the caller's token. | | `render-map-preview.mjs` | `npm run preview -- ` | free | Renders a `.tmj` to PNG with object markers. Options: `[out.png] [--width 1600] [--no-markers]`. | | `gen-docs.mjs` | `npm run docs` | free | Regenerates `docs/tools.md` and `docs/themes.md` from the server. | -| `create-aquatic-map.mjs` | `npm run examples` | free | Rebuilds `maps/caverne-aquatique.tmj` with the builder API. | -| `create-glacier-map.mjs` | `npm run examples` | free | Rebuilds `maps/forteresse-glace-etage.tmj`. | -| `create-electronic-hacker-map.mjs` | `npm run examples` | free | Rebuilds `maps/reseau-electronique-repaire-hacker.tmj`. | +| `create-aquatic-map.mjs` | `npm run examples` | free | Rebuilds `maps/water-cavern.tmj` with the builder API. | +| `create-glacier-map.mjs` | `npm run examples` | free | Rebuilds `maps/ice-fortress.tmj`. | +| `create-electronic-hacker-map.mjs` | `npm run examples` | free | Rebuilds `maps/hacker-lair.tmj`. | | `create-village-world.mjs` | `npm run examples` | free | Rebuilds the sample world `maps/crossroads-village/`: an outdoor map, six buildings and their linked interiors. | | `gen-theme-set.mjs` | | **paid** | Generates a theme's missing sprites with FLUX.1-dev. Needs `--yes`; try `--dry-run` first. See [docs/sprite-generation.md](../docs/sprite-generation.md). | | `gen-building-sprites.mjs` | | **paid** (`--clean` free) | Generates missing building sprites with FLUX.1-dev (`--yes`, try `--dry-run` first); `--clean` removes leftover background from existing ones. | diff --git a/scripts/create-aquatic-map.mjs b/scripts/create-aquatic-map.mjs index b5531384fb9fbb36695b904d7f458a37d5503b42..888cfe6128dc497fbd4501e5c17e63d566ff6ee5 100644 --- a/scripts/create-aquatic-map.mjs +++ b/scripts/create-aquatic-map.mjs @@ -1,4 +1,4 @@ -// Example map script: builds maps/caverne-aquatique.tmj (AQUATIC theme, 64x64: flooded cavern with a central lake) +// Example map script: builds maps/water-cavern.tmj (AQUATIC theme, 64x64: flooded cavern with a central lake) // by calling the builder API directly, without an MCP client. It is deterministic: // re-running it reproduces the committed sample map. Run from the repository root // after building the server (npm run build): @@ -12,7 +12,7 @@ import fs from 'node:fs'; const theme = getTheme("AQUATIC"); const { mapId } = createMap({ - name: "Caverne Aquatique Souterraine", + name: "Underground Water Cavern", width: 64, height: 64, theme: theme, @@ -93,7 +93,7 @@ paintRect(mapId, "decorations", 38, 38, 38, 38, "obstacle_decor"); paintRect(mapId, "ground", 20, 2, 42, 15, "walkable_floor"); paintWallBorder(mapId, 20, 2, 42, 15); openWall(31, 15); -placeSpawn(mapId, { x: 31, y: 8, role: "enemy", npcName: "Seigneur des Abysses", name: "boss-final" }); +placeSpawn(mapId, { x: 31, y: 8, role: "enemy", npcName: "Lord of the Depths", name: "boss-final" }); // SOUTH: rectangular room, player entrance paintRect(mapId, "ground", 20, 48, 42, 61, "walkable_floor"); @@ -105,39 +105,39 @@ placeSpawn(mapId, { x: 31, y: 55, role: "player", name: "player-start" }); paintLRoom(46, 20, 62, 41, 46, 42, 58, 50, "walkable_floor"); paintWallBorder(mapId, 46, 20, 62, 50); openWall(46, 31); -placeSpawn(mapId, { x: 54, y: 31, role: "enemy", npcName: "Rampant des Eaux", name: "water-creature-east" }); +placeSpawn(mapId, { x: 54, y: 31, role: "enemy", npcName: "Water Crawler", name: "water-creature-east" }); // WEST: L-shaped room paintLRoom(2, 20, 18, 41, 6, 42, 18, 50, "walkable_floor"); paintWallBorder(mapId, 2, 20, 18, 50); openWall(18, 31); -placeSpawn(mapId, { x: 10, y: 31, role: "enemy", npcName: "Rampant des Eaux", name: "water-creature-west" }); +placeSpawn(mapId, { x: 10, y: 31, role: "enemy", npcName: "Water Crawler", name: "water-creature-west" }); // NORTH-EAST: circular room (radius 7) paintCircleRoom(53, 11, 7, "walkable_floor"); paintWallBorder(mapId, 46, 4, 60, 18); openWall(49, 18); -placeSpawn(mapId, { x: 53, y: 11, role: "enemy", npcName: "Esprit de l'Onde", name: "water-creature-ne" }); +placeSpawn(mapId, { x: 53, y: 11, role: "enemy", npcName: "Wave Spirit", name: "water-creature-ne" }); // NORTH-WEST: circular room (radius 7) paintCircleRoom(11, 11, 7, "walkable_floor"); paintWallBorder(mapId, 4, 4, 18, 18); openWall(14, 18); -placeSpawn(mapId, { x: 11, y: 11, role: "enemy", npcName: "Esprit de l'Onde", name: "water-creature-nw" }); +placeSpawn(mapId, { x: 11, y: 11, role: "enemy", npcName: "Wave Spirit", name: "water-creature-nw" }); // SOUTH-EAST: T-shaped room paintRect(mapId, "ground", 46, 44, 62, 52, "walkable_floor"); paintRect(mapId, "ground", 52, 52, 56, 60, "walkable_floor"); paintWallBorder(mapId, 46, 44, 62, 60); openWall(49, 44); -placeSpawn(mapId, { x: 54, y: 55, role: "enemy", npcName: "Rampant des Eaux", name: "water-creature-se" }); +placeSpawn(mapId, { x: 54, y: 55, role: "enemy", npcName: "Water Crawler", name: "water-creature-se" }); // SOUTH-WEST: T-shaped room paintRect(mapId, "ground", 2, 44, 18, 52, "walkable_floor"); paintRect(mapId, "ground", 8, 52, 12, 60, "walkable_floor"); paintWallBorder(mapId, 2, 44, 18, 60); openWall(15, 44); -placeSpawn(mapId, { x: 10, y: 55, role: "enemy", npcName: "Rampant des Eaux", name: "water-creature-sw" }); +placeSpawn(mapId, { x: 10, y: 55, role: "enemy", npcName: "Water Crawler", name: "water-creature-sw" }); // ---------- Wide corridors ---------- paintRect(mapId, "ground", 30, 16, 34, 47, "walkable_floor"); // N-S @@ -202,11 +202,11 @@ for (const [lx, ly] of lilyPads) { } // ---------- Objects: only the chest (interactable) ---------- -placeObject(mapId, { x: 32, y: 32, kind: "chest", name: "sarcophage-submerge" }); +placeObject(mapId, { x: 32, y: 32, kind: "chest", name: "sunken-sarcophagus" }); // ---------- Save the map ---------- const mapData = serializeMap(mapId); -const outPath = fileURLToPath(new URL('../maps/caverne-aquatique.tmj', import.meta.url)); +const outPath = fileURLToPath(new URL('../maps/water-cavern.tmj', import.meta.url)); await saveMapFile(mapId, outPath); console.log("Saved:", outPath); diff --git a/scripts/create-electronic-hacker-map.mjs b/scripts/create-electronic-hacker-map.mjs index bdc00986929862a92fc5f25ee159e29e8fdab09b..56ba38a4899cc31c0457e6956545cb77d96c724b 100644 --- a/scripts/create-electronic-hacker-map.mjs +++ b/scripts/create-electronic-hacker-map.mjs @@ -1,4 +1,4 @@ -// Example map script: builds maps/reseau-electronique-repaire-hacker.tmj (ELECTRONIQUE theme, 64x64: hacker lair in a digital network) +// Example map script: builds maps/hacker-lair.tmj (ELECTRONIC theme, 64x64: hacker lair in a digital network) // by calling the builder API directly, without an MCP client. It is deterministic: // re-running it reproduces the committed sample map. Run from the repository root // after building the server (npm run build): @@ -9,10 +9,10 @@ import { saveMapFile } from '../tiled-mcp/dist/tmj.js'; import { fileURLToPath } from 'node:url'; import fs from 'node:fs'; -const theme = getTheme("ELECTRONIQUE"); +const theme = getTheme("ELECTRONIC"); const { mapId } = createMap({ - name: "Reseau Electronique - Repaire Hacker", + name: "Electronic Network - Hacker Lair", width: 64, height: 64, theme: theme, @@ -156,17 +156,17 @@ for (let i = 0; i < 20; i++) { placeSpawn(mapId, { x: 31, y: 42, role: "player", name: "player-start" }); // Hacker enemies inside the building -placeSpawn(mapId, { x: 26, y: 50, role: "enemy", npcName: "Hacker-reseau", name: "hacker-terminal-1" }); -placeSpawn(mapId, { x: 37, y: 50, role: "enemy", npcName: "Hacker-reseau", name: "hacker-terminal-2" }); -placeSpawn(mapId, { x: 31, y: 56, role: "enemy", npcName: "Hacker-reseau", name: "hacker-central" }); -placeSpawn(mapId, { x: 24, y: 55, role: "enemy", npcName: "Securite-numerique", name: "securite-1" }); +placeSpawn(mapId, { x: 26, y: 50, role: "enemy", npcName: "Network Hacker", name: "hacker-terminal-1" }); +placeSpawn(mapId, { x: 37, y: 50, role: "enemy", npcName: "Network Hacker", name: "hacker-terminal-2" }); +placeSpawn(mapId, { x: 31, y: 56, role: "enemy", npcName: "Network Hacker", name: "hacker-central" }); +placeSpawn(mapId, { x: 24, y: 55, role: "enemy", npcName: "Security Daemon", name: "security-1" }); // Guard enemy near the rune's core -placeSpawn(mapId, { x: 32, y: 20, role: "enemy", npcName: "IA-rogue", name: "ai-core-guardian" }); +placeSpawn(mapId, { x: 32, y: 20, role: "enemy", npcName: "Rogue AI", name: "ai-core-guardian" }); // ---------- Objects ---------- // Data chest in the building -placeObject(mapId, { x: 30, y: 58, kind: "chest", name: "coffre-donnees-hacker" }); +placeObject(mapId, { x: 30, y: 58, kind: "chest", name: "hacker-data-chest" }); // Stairs (access to the lower level) paintRect(mapId, "ground", 31, 59, 31, 59, "stairs"); @@ -182,7 +182,7 @@ for (const [ix, iy] of runeDecorSpots) { // ---------- Save the map ---------- const mapData = serializeMap(mapId); -const outPath = fileURLToPath(new URL('../maps/reseau-electronique-repaire-hacker.tmj', import.meta.url)); +const outPath = fileURLToPath(new URL('../maps/hacker-lair.tmj', import.meta.url)); await saveMapFile(mapId, outPath); console.log("Saved:", outPath); diff --git a/scripts/create-glacier-map.mjs b/scripts/create-glacier-map.mjs index b32167b572c185506ac1f8a944f9d8006664003c..cb23a3befe15e87408206e9859da5ff1ffe9dea1 100644 --- a/scripts/create-glacier-map.mjs +++ b/scripts/create-glacier-map.mjs @@ -1,4 +1,4 @@ -// Example map script: builds maps/forteresse-glace-etage.tmj (GLACIAIRE theme, 64x64: ice fortress with a circular central hall) +// Example map script: builds maps/ice-fortress.tmj (GLACIER theme, 64x64: ice fortress with a circular central hall) // by calling the builder API directly, without an MCP client. It is deterministic: // re-running it reproduces the committed sample map. Run from the repository root // after building the server (npm run build): @@ -9,10 +9,10 @@ import { saveMapFile } from '../tiled-mcp/dist/tmj.js'; import { fileURLToPath } from 'node:url'; import fs from 'node:fs'; -const theme = getTheme("GLACIAIRE"); +const theme = getTheme("GLACIER"); const { mapId } = createMap({ - name: "Forteresse de Glace - Donjon Principal v4", + name: "Ice Fortress - Main Keep", width: 64, height: 64, theme: theme, @@ -97,7 +97,7 @@ openWall(22, 32); // west openWall(42, 32); // east // Chest on the central lake -placeObject(mapId, { x: 32, y: 32, kind: "chest", name: "coffre-sur-le-lac" }); +placeObject(mapId, { x: 32, y: 32, kind: "chest", name: "lake-chest" }); // Frozen fountain north of the centre, one cell inside so it does not plug the north opening paintRect(mapId, "decorations", 32, 24, 32, 24, "obstacle_decor"); @@ -115,7 +115,7 @@ paintRect(mapId, "decorations", 33, 40, 33, 40, "decoration_minor"); paintRect(mapId, "ground", 15, 2, 48, 16, "walkable_floor"); paintWallBorder(mapId, 15, 2, 48, 16); openWall(31, 16); -placeSpawn(mapId, { x: 31, y: 6, role: "enemy", npcName: "Seigneur des Glaces", name: "boss-final" }); +placeSpawn(mapId, { x: 31, y: 6, role: "enemy", npcName: "Ice Lord", name: "boss-final" }); // Boss throne paintRect(mapId, "decorations", 31, 4, 31, 4, "obstacle_decor"); @@ -129,40 +129,40 @@ placeSpawn(mapId, { x: 31, y: 54, role: "player", name: "player-start" }); paintLRoom(47, 18, 62, 40, 47, 41, 58, 46, "walkable_floor"); paintWallBorder(mapId, 47, 18, 62, 46); openWall(47, 31); -placeSpawn(mapId, { x: 54, y: 31, role: "enemy", npcName: "Givre-Rôdeur", name: "ice-creature-east" }); +placeSpawn(mapId, { x: 54, y: 31, role: "enemy", npcName: "Frost Stalker", name: "ice-creature-east" }); paintRect(mapId, "decorations", 58, 31, 58, 31, "obstacle_decor"); // WEST: L-shaped room paintLRoom(2, 18, 17, 40, 6, 41, 17, 46, "walkable_floor"); paintWallBorder(mapId, 2, 18, 17, 46); openWall(17, 31); -placeSpawn(mapId, { x: 10, y: 31, role: "enemy", npcName: "Givre-Rôdeur", name: "ice-creature-west" }); +placeSpawn(mapId, { x: 10, y: 31, role: "enemy", npcName: "Frost Stalker", name: "ice-creature-west" }); paintRect(mapId, "decorations", 6, 31, 6, 31, "obstacle_decor"); // NORTH-EAST: circular room (radius 8) paintCircleRoom(54, 10, 8, "walkable_floor"); paintWallBorder(mapId, 46, 2, 62, 18); openWall(49, 18); -placeSpawn(mapId, { x: 54, y: 10, role: "enemy", npcName: "Esprit de Glace", name: "ice-creature-ne" }); -placeObject(mapId, { x: 54, y: 6, kind: "chest", name: "coffre-ne" }); +placeSpawn(mapId, { x: 54, y: 10, role: "enemy", npcName: "Ice Spirit", name: "ice-creature-ne" }); +placeObject(mapId, { x: 54, y: 6, kind: "chest", name: "north-east-chest" }); // NORTH-WEST: circular room (radius 8) paintCircleRoom(10, 10, 8, "walkable_floor"); paintWallBorder(mapId, 2, 2, 18, 18); openWall(14, 18); -placeSpawn(mapId, { x: 10, y: 10, role: "enemy", npcName: "Esprit de Glace", name: "ice-creature-nw" }); +placeSpawn(mapId, { x: 10, y: 10, role: "enemy", npcName: "Ice Spirit", name: "ice-creature-nw" }); // SOUTH-EAST: T-shaped room paintTRoom(47, 44, 62, 53, 52, 53, 56, 61, "walkable_floor"); paintWallBorder(mapId, 47, 44, 62, 61); openWall(49, 44); -placeSpawn(mapId, { x: 54, y: 56, role: "enemy", npcName: "Givre-Rôdeur", name: "ice-creature-se" }); +placeSpawn(mapId, { x: 54, y: 56, role: "enemy", npcName: "Frost Stalker", name: "ice-creature-se" }); // SOUTH-WEST: T-shaped room paintTRoom(2, 44, 17, 53, 8, 53, 12, 61, "walkable_floor"); paintWallBorder(mapId, 2, 44, 17, 61); openWall(15, 44); -placeSpawn(mapId, { x: 10, y: 56, role: "enemy", npcName: "Givre-Rôdeur", name: "ice-creature-sw" }); +placeSpawn(mapId, { x: 10, y: 56, role: "enemy", npcName: "Frost Stalker", name: "ice-creature-sw" }); // ---------- Outer ring (belt corridor linking the rooms) ---------- paintRect(mapId, "ground", 2, 17, 62, 20, "walkable_floor"); // top @@ -248,11 +248,11 @@ paintRect(mapId, "ground", 32, 6, 32, 6, "stairs"); paintRect(mapId, "ground", 32, 57, 32, 57, "stairs"); // ---------- Lever (mechanism) ---------- -placeObject(mapId, { x: 40, y: 32, kind: "lever", name: "levier-pont-levis" }); +placeObject(mapId, { x: 40, y: 32, kind: "lever", name: "drawbridge-lever" }); // ---------- Save the map ---------- const mapData = serializeMap(mapId); -const outPath = fileURLToPath(new URL('../maps/forteresse-glace-etage.tmj', import.meta.url)); +const outPath = fileURLToPath(new URL('../maps/ice-fortress.tmj', import.meta.url)); await saveMapFile(mapId, outPath); console.log("Saved:", outPath); diff --git a/scripts/gen-docs.mjs b/scripts/gen-docs.mjs index 3cfa5336f1c6ef5393a90e3abccc87b620ffa36b..02423b28c16767070ef2eff263adea772fa1f23e 100644 --- a/scripts/gen-docs.mjs +++ b/scripts/gen-docs.mjs @@ -22,17 +22,17 @@ const SUMMARY = { MAUSOLEUM: "Grey-veined marble, fallen-angel statues, funeral urns in niches. No hazards.", BLOOD_TOMB: "Deep ritual sanctuary, pulsing bleeding runes, central altar.", AQUATIC: "Black stagnant water, water lilies, sunken ruins, haunted marsh.", - GLACIAIRE: "Black ice, figures frozen in the ice, frost, haunted tundra.", - INONDE: "Drowned city under the waves, hanging kelp, broken bridges, deep currents.", - VOLCAN: "Lava flows, cooled black rock, flying ash, active caldera.", - FORET: "Twisted woods, thick moss, exposed roots, misty clearings, quicksand.", - HIVER: "Powder snow, frozen lakes, frosted branches, trappers' huts.", - PRINTEMPS: "Flowering meadows, clear streams, budding trees, druid circles.", - ETE: "Golden grass, ripe wheat, cloudless heat, abandoned granaries.", - AUTOMNE: "Russet leaves, mushrooms, morning mist, bog mire.", + GLACIER: "Black ice, figures frozen in the ice, frost, haunted tundra.", + FLOODED: "Drowned city under the waves, hanging kelp, broken bridges, deep currents.", + VOLCANO: "Lava flows, cooled black rock, flying ash, active caldera.", + DARK_FOREST: "Twisted woods, thick moss, exposed roots, misty clearings, quicksand.", + WINTER: "Powder snow, frozen lakes, frosted branches, trappers' huts.", + SPRING: "Flowering meadows, clear streams, budding trees, druid circles.", + SUMMER: "Golden grass, ripe wheat, cloudless heat, abandoned granaries.", + AUTUMN: "Russet leaves, mushrooms, morning mist, bog mire.", DESOLATION: "Cold ash, charred trees, barren ground, post-cataclysm ruins.", - FUTURISTE: "Chrome, cold neon, holographic panels, dystopian megacity.", - ELECTRONIQUE: "Circuit boards, optic fibre, silent servers, AI cores.", + FUTURISTIC: "Chrome, cold neon, holographic panels, dystopian megacity.", + ELECTRONIC: "Circuit boards, optic fibre, silent servers, AI cores.", }; const GROUPS = [ diff --git a/scripts/gen-theme-set.mjs b/scripts/gen-theme-set.mjs index c9f1c8892ca0f3d482649ada271e79b5663f1d27..41429bfca0614b4bf37f30d90eeda0c178654a63 100644 --- a/scripts/gen-theme-set.mjs +++ b/scripts/gen-theme-set.mjs @@ -3,10 +3,10 @@ // skips sprites that already exist (unless --force). Each generated sprite is a paid call. // // Usage (from the repository root, after npm install && npm run build): -// node scripts/gen-theme-set.mjs VOLCAN --yes -// node scripts/gen-theme-set.mjs VOLCAN HIVER ETE --yes +// node scripts/gen-theme-set.mjs VOLCANO --yes +// node scripts/gen-theme-set.mjs VOLCANO WINTER SUMMER --yes // node scripts/gen-theme-set.mjs --missing --yes # every theme with missing sprites -// node scripts/gen-theme-set.mjs --dry-run VOLCAN # list what would be generated, free +// node scripts/gen-theme-set.mjs --dry-run VOLCANO # list what would be generated, free // // Needs HUGGINGFACE_API_KEY (or HF_TOKEN) in the environment or in tiled-mcp/.env. // See docs/sprite-generation.md for costs and providers. diff --git a/scripts/render-map-preview.mjs b/scripts/render-map-preview.mjs index 8e31584bed3cfa84a32ba03b2a1508dba5565f96..5b30bd78ef94b5708aa8918d58c56a52e8698bbc 100644 --- a/scripts/render-map-preview.mjs +++ b/scripts/render-map-preview.mjs @@ -3,7 +3,7 @@ // a marker on every object and spawn so you can check where they landed. // // Usage (from the repository root, after npm install && npm run build): -// node scripts/render-map-preview.mjs maps/forteresse-glace-etage.tmj +// node scripts/render-map-preview.mjs maps/ice-fortress.tmj // node scripts/render-map-preview.mjs [out.png] [--width 1600] [--no-markers] // // The renderer itself lives in tiled-mcp/src/render.ts and is shared with the hosted web page. diff --git a/scripts/smoke-test.mjs b/scripts/smoke-test.mjs index d0bf4f77cb7c3e554d4cccca04bfd8b1258e3f9d..3a4a59ecb0945a66e26f36a0a53862501e7c4fec 100644 --- a/scripts/smoke-test.mjs +++ b/scripts/smoke-test.mjs @@ -74,6 +74,50 @@ const crypt = themes.find((t) => t.key === "CRYPT"); check("CRYPT sprites all present", crypt.sprites.status === "all", crypt.sprites); check("every theme reports sprite status", themes.every((t) => ["all", "partial", "none"].includes(t.sprites.status))); +// Every theme, in a loop: English key, name and description; each layout preset builds a map +// the player can walk with no warning; a saved map records its theme and finds its sprites. +const LEGACY_KEYS = ["GLACIAIRE", "INONDE", "VOLCAN", "FORET", "HIVER", "PRINTEMPS", "ETE", "AUTOMNE", "FUTURISTE", "ELECTRONIQUE"]; +const FRENCH = /[À-ſ]|\b(le|la|les|des|du|et|sous|aux|une|dans|avec)\b/i; +check("no theme keeps a pre-0.5.0 French key", !themes.some((t) => LEGACY_KEYS.includes(t.key)) && !createMapTool.inputSchema.properties.theme.enum.some((k) => LEGACY_KEYS.includes(k)), themes.map((t) => t.key)); +const PRESETS = [ + ["generate_crypt_layout", 27, 18, {}], + ["generate_castle_floor", 27, 20, { floorVariant: "throne" }], + ["generate_werewolf_den", 22, 16, {}], +]; +for (const t of themes) { + const problems = []; + if (!/^[A-Z][A-Z_]*$/.test(t.key)) problems.push(`key ${t.key}`); + if (FRENCH.test(t.name) || !t.name.trim()) problems.push(`name "${t.name}"`); + if (FRENCH.test(t.description) || t.description.length < 20) problems.push(`description "${t.description}"`); + for (const [preset, w, h, extra] of PRESETS) { + const m = (await call("create_map", { name: `${preset} ${t.key}`, width: w, height: h, theme: t.key })).data; + const r = await call(preset, { mapId: m.mapId, ...extra }); + const v = (await call("validate_map", { mapId: m.mapId })).data; + if (r.isError || !v.ok || v.warnings.length) problems.push(`${preset}: ${r.isError ? r.data : JSON.stringify(v.warnings).slice(0, 200)}`); + await call("discard_map", { mapId: m.mapId }); + } + const room = (await call("create_map", { name: `Room ${t.key}`, width: 10, height: 8, theme: t.key })).data; + await call("generate_room", { mapId: room.mapId, originX: 0, originY: 0, width: 10, height: 8 }); + await call("place_spawn_player", { mapId: room.mapId, x: 2, y: 4 }); + const saved = await call("save_to_disk", { mapId: room.mapId, path: `themes/${t.key.toLowerCase()}.tmj` }); + if (saved.isError) problems.push(`save: ${saved.data}`); + else { + const file = resolve(outDir, "themes", `${t.key.toLowerCase()}.tmj`); + const tmj = JSON.parse(readFileSync(file, "utf8")); + if (tmj.properties?.find((p) => p.name === "theme")?.value !== t.key) problems.push("saved map does not record its theme"); + const images = tmj.tilesets[0].tiles.map((tile) => tile.image).filter(Boolean); + if (images.some((img) => !img.includes(`/assets/${t.key.toLowerCase()}/`))) problems.push("sprite paths outside the theme's folder"); + const missing = images.filter((img) => !existsSync(resolve(dirname(file), img))); + if (t.sprites.status === "all" && missing.length) problems.push(`missing sprites: ${missing.join(", ")}`); + } + await call("discard_map", { mapId: room.mapId }); + check(`theme ${t.key} ("${t.name}"): English, 3 presets walkable, saves with its sprites`, problems.length === 0, problems); +} +const legacyCall = await call("create_map", { name: "Old key", width: 10, height: 8, theme: "GLACIAIRE" }); +check("an old French key is refused with its English replacement", (legacyCall.isError || legacyCall.protocolError) && JSON.stringify(legacyCall).includes("was renamed 'GLACIER'"), legacyCall); +const { getTheme: themeByKey } = await import("../tiled-mcp/dist/themes/index.js"); +check("the builder API still accepts old French keys", themeByKey("ELECTRONIQUE").key === "ELECTRONIC" && themeByKey("GLACIAIRE").key === "GLACIER"); + // Presets: minimum sizes enforced const small = (await call("create_map", { name: "small", width: 20, height: 14, theme: "CRYPT" })).data; const tooSmall = await call("generate_crypt_layout", { mapId: small.mapId }); @@ -139,7 +183,7 @@ check("saved sprite paths resolve from the file location", missing.length === 0, // Paid tools without credentials const gen = await call("generate_tile_sprite", { theme: "AQUATIC", role: "wall" }); check("sprite generation without token: clean message, no network", gen.data.ok === false && /HUGGINGFACE_API_KEY/.test(gen.data.error), gen); -const prev = await call("preview_sprite_prompt", { theme: "VOLCAN", role: "wall" }); +const prev = await call("preview_sprite_prompt", { theme: "VOLCANO", role: "wall" }); check("prompt preview works for a newer theme", prev.data.ok && /magenta/.test(prev.data.prompt), prev); const ovr = (await call("override_tile_image", { mapId: cm, role: "obstacle_decor", variant: "alembic" })).data; check("override to a missing variant warns", ovr.ok && /No file/.test(ovr.warning ?? ""), ovr); diff --git a/scripts/test-loop.mjs b/scripts/test-loop.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3c2f4a2cff77bf12a3395dea7f0bf13a3eac340d --- /dev/null +++ b/scripts/test-loop.mjs @@ -0,0 +1,35 @@ +// Runs every offline test suite, several times in a row, to catch failures that only show up +// now and then. Stops at the first failing run and prints its output. Free and offline. +// +// Usage (after npm run build): +// npm test # each suite once +// npm run test:loop # each suite 5 times +// node scripts/test-loop.mjs 20 # each suite 20 times +import { spawnSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; + +const runs = Math.max(1, Number.parseInt(process.argv[2] ?? "1", 10) || 1); +const script = (name) => fileURLToPath(new URL(`./${name}`, import.meta.url)); +const SUITES = [ + ["smoke (Tiled coordinates)", [script("smoke-test.mjs")]], + ["smoke (legacy screen coordinates)", [script("smoke-test.mjs"), "screen"]], + ["hosted mode over HTTP", [script("smoke-http.mjs")]], +]; + +const started = Date.now(); +for (let run = 1; run <= runs; run++) { + for (const [label, args] of SUITES) { + const t0 = Date.now(); + const r = spawnSync(process.execPath, args, { encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }); + const summary = (r.stdout.match(/(\d+) passed, (\d+) failed/) ?? [])[0] ?? "no summary"; + const seconds = ((Date.now() - t0) / 1000).toFixed(1); + console.log(`run ${run}/${runs} ${label.padEnd(34)} ${summary} (${seconds} s)`); + if (r.status !== 0) { + console.log(r.stdout.split("\n").filter((l) => !l.startsWith("PASS")).join("\n")); + if (r.stderr.trim()) console.log(r.stderr.slice(0, 2000)); + console.log(`\nFailed on run ${run} of ${runs}: ${label}.`); + process.exit(1); + } + } +} +console.log(`\nAll ${SUITES.length} suites passed ${runs} time(s) in ${((Date.now() - started) / 1000).toFixed(0)} s.`); diff --git a/skills/map-builder/SKILL.md b/skills/map-builder/SKILL.md index 2db15af9000b7c037e3fa03bc104aeacea3e8222..9943b16c26594165c63516c2fb3046326fad5c50 100644 --- a/skills/map-builder/SKILL.md +++ b/skills/map-builder/SKILL.md @@ -80,17 +80,17 @@ Structured (recommended for complex maps): | cave, den, lair, beasts | `WEREWOLF_DEN` | | inn, tavern, interior | `TAVERN_BLOOD_PRINCE` | | village, square, market, street | `VILLAGE` | -| haunted forest, undergrowth, clearing | `HAUNTED_FOREST` or `FORET` | +| haunted forest, undergrowth, clearing | `HAUNTED_FOREST` or `DARK_FOREST` | | mausoleum, tomb, statues | `MAUSOLEUM` | | blood ritual, altar, sanctuary | `BLOOD_TOMB` | | swamp, stagnant water, sunken ruins | `AQUATIC` | -| flooded city, drowned district | `INONDE` | -| ice, frozen fortress, tundra | `GLACIAIRE` or `HIVER` | -| volcano, lava, ash | `VOLCAN` | -| seasons: spring, summer, autumn | `PRINTEMPS`, `ETE`, `AUTOMNE` | +| flooded city, drowned district | `FLOODED` | +| ice, frozen fortress, tundra | `GLACIER` or `WINTER` | +| volcano, lava, ash | `VOLCANO` | +| seasons: spring, summer, autumn | `SPRING`, `SUMMER`, `AUTUMN` | | wasteland, ruins after a cataclysm | `DESOLATION` | -| futuristic city, laboratory, neon | `FUTURISTE` | -| digital network, servers, hacker | `ELECTRONIQUE` | +| futuristic city, laboratory, neon | `FUTURISTIC` | +| digital network, servers, hacker | `ELECTRONIC` | ### Step 2: reference material (optional) @@ -220,15 +220,15 @@ in Step 4); until they exist Tiled shows placeholders and the map still works. but costly obstacle. - **WEREWOLF_DEN**: an alpha lair with boulders in the corners and bone piles (`difficult_terrain`), several scattered enemy spawns, no locked doors (caves). -- **HAUNTED_FOREST / FORET**: no full perimeter walls (open forest); use `obstacle_decor` +- **HAUNTED_FOREST / DARK_FOREST**: no full perimeter walls (open forest); use `obstacle_decor` (boulders, standing stones) to create chokepoints; parasitic mist (HAUNTED_FOREST) or - quicksand (FORET) as hazards in damp areas. + quicksand (DARK_FOREST) as hazards in damp areas. - **MAUSOLEUM**: fallen-angel statues as obstacles, several small alcoves, no hazards (the theme has none: the mood is contemplative). -- **AQUATIC / INONDE**: deep water or currents as `hazard_primary`, stepping paths of floor tiles. -- **GLACIAIRE / HIVER**: cracked ice or slush (`difficult_terrain`) slows movement, thin ice is +- **AQUATIC / FLOODED**: deep water or currents as `hazard_primary`, stepping paths of floor tiles. +- **GLACIER / WINTER**: cracked ice or slush (`difficult_terrain`) slows movement, thin ice is the hazard; open frozen halls. -- **VOLCAN**: lava flows as hazards with narrow bridges of floor tiles. +- **VOLCANO**: lava flows as hazards with narrow bridges of floor tiles. - **TAVERN_BLOOD_PRINCE / VILLAGE**: social scenes; tables or the well as obstacles, friendly NPC spawns, few or no traps. diff --git a/tiled-mcp/README.md b/tiled-mcp/README.md index 32e848ee1b2fa93d9552900c9f49782a808ba844..6d3a65a80e3fe9a6768c0933804be9c810bc28a0 100644 --- a/tiled-mcp/README.md +++ b/tiled-mcp/README.md @@ -15,8 +15,8 @@ From the repository root: ```bash npm install npm run build # tsc: src/ -> dist/ -npm run smoke # 38 offline end-to-end checks (stdio) -npm run smoke:http # offline checks of the hosted mode +npm test # every offline suite (stdio, legacy coordinates, hosted mode) +npm run test:loop # the same 5 times in a row npm run start:web # hosted mode on http://127.0.0.1:7860 ``` diff --git a/tiled-mcp/package.json b/tiled-mcp/package.json index 227c907ade0ca63515213461895f2ec56d104963..51083cdaa65f38d58fbba56e5381a7064475cf9c 100644 --- a/tiled-mcp/package.json +++ b/tiled-mcp/package.json @@ -1,6 +1,6 @@ { "name": "tiled-map-builder-mcp", - "version": "0.4.1", + "version": "0.5.0", "description": "MCP server that composes isometric Tiled (.tmj) maps: themes, rooms, corridors, layout presets, objects, spawns, validation, export, optional FLUX sprite generation, and a hosted web mode where an AI model builds maps from a description.", "license": "MIT", "keywords": [ diff --git a/tiled-mcp/src/http.ts b/tiled-mcp/src/http.ts index 94a63d371e6b7251f92ebd2edb39fc79c7fc2a65..e5be69c9723224795a33a1a610d69ef970bcc7c0 100644 --- a/tiled-mcp/src/http.ts +++ b/tiled-mcp/src/http.ts @@ -25,7 +25,7 @@ import { loadEnvFile } from "./env.js"; import { PACKAGE_ROOT } from "./paths.js"; import { createServer, SERVER_VERSION } from "./server.js"; import { assetFile } from "./sprites.js"; -import { THEME_KEYS, describeThemes } from "./themes/index.js"; +import { THEME_KEYS, describeThemes, resolveThemeKey } from "./themes/index.js"; setHostedMode(true); loadEnvFile(); @@ -191,7 +191,7 @@ async function handleGenerate(req: IncomingMessage, res: ServerResponse): Promis if (description.length > MAX_DESCRIPTION) { return json(res, 400, { error: `The description is too long (${description.length} characters, at most ${MAX_DESCRIPTION}).` }); } - const theme = typeof body.theme === "string" && body.theme ? body.theme : undefined; + const theme = typeof body.theme === "string" && body.theme ? resolveThemeKey(body.theme) : undefined; if (theme && !THEME_KEYS.includes(theme)) return json(res, 400, { error: `Unknown theme '${theme}'.` }); const model = typeof body.model === "string" && body.model.trim() ? body.model.trim() : DEFAULT_MODEL; if (!MODEL_ID.test(model)) return json(res, 400, { error: `'${model}' is not a model id such as openai/gpt-oss-120b.` }); diff --git a/tiled-mcp/src/server.ts b/tiled-mcp/src/server.ts index 6b4e1a48be94c7435a6681718a5d62af27d3b85a..9cea1ccb724eef67551577b48c18effa1a0b6e97 100644 --- a/tiled-mcp/src/server.ts +++ b/tiled-mcp/src/server.ts @@ -13,7 +13,7 @@ import { registerWorldTools } from "./tools/world.js"; import { registerPrompts } from "./prompts.js"; export const SERVER_NAME = "tiled-map-builder"; -export const SERVER_VERSION = "0.4.1"; +export const SERVER_VERSION = "0.5.0"; export function createServer(): McpServer { const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }); diff --git a/tiled-mcp/src/themes/aquatic.ts b/tiled-mcp/src/themes/aquatic.ts index 04f44fbf89866399cdb1f9a6e7eb59246d3e544d..9dfd0dbe57e96d4bd93adc0bd18db6d5724bbca0 100644 --- a/tiled-mcp/src/themes/aquatic.ts +++ b/tiled-mcp/src/themes/aquatic.ts @@ -6,9 +6,9 @@ const A = "./assets/aquatic"; export const AQUATIC: Theme = { key: "AQUATIC", - name: "Eaux Croupies", + name: "Stagnant Waters", description: - "Eaux noires stagnantes, nénuphars, ruines submergées, brume sur l'eau. Marais hanté, pontons pourris, cryptes inondées.", + "Black stagnant water, water lilies, sunken ruins, mist on the water. Haunted marsh, rotten pontoons, flooded crypts.", tilesetName: "aquatic-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/automne.ts b/tiled-mcp/src/themes/automne.ts deleted file mode 100644 index 507537aba058fdc2bd37fff289135a3adc04b00a..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/automne.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const AU = "./assets/automne"; - -export const AUTOMNE: Theme = { - key: "AUTOMNE", - name: "Foret d'Automne", - description: - "Feuilles rousses, champignons, brume matinale, gibier traqué. Bois automnal, sentiers couverts, tombes sous les érables.", - tilesetName: "automne-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "automne.fallen_leaves", imageFile: `${AU}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "automne.damp_earth", imageFile: `${AU}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "automne.rustic_oak", imageFile: `${AU}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "automne.twisted_branch", imageFile: `${AU}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "automne.slippery_leaf_carpet", imageFile: `${AU}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "automne.bog_mire", imageFile: `${AU}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "automne.scarecrow_withered", imageFile: `${AU}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "automne.acorn", imageFile: `${AU}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "automne.ivy_door", imageFile: `${AU}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "automne.leaf_stairs", imageFile: `${AU}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#2a1a0a", fogIntensity: 0.25 }, -}; diff --git a/tiled-mcp/src/themes/autumn.ts b/tiled-mcp/src/themes/autumn.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c8bd3a07f2b6a62ee568f6bd6eefb717cff5957 --- /dev/null +++ b/tiled-mcp/src/themes/autumn.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const AU = "./assets/autumn"; + +export const AUTUMN: Theme = { + key: "AUTUMN", + name: "Autumn Forest", + description: + "Russet leaves, mushrooms, morning mist, hunted game. Autumn woods, leaf-covered paths, graves under the maples.", + tilesetName: "autumn-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "autumn.fallen_leaves", imageFile: `${AU}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "autumn.damp_earth", imageFile: `${AU}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "autumn.rustic_oak", imageFile: `${AU}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "autumn.twisted_branch", imageFile: `${AU}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "autumn.slippery_leaf_carpet", imageFile: `${AU}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "autumn.bog_mire", imageFile: `${AU}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "autumn.scarecrow_withered", imageFile: `${AU}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "autumn.acorn", imageFile: `${AU}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "autumn.ivy_door", imageFile: `${AU}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "autumn.leaf_stairs", imageFile: `${AU}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#2a1a0a", fogIntensity: 0.25 }, +}; diff --git a/tiled-mcp/src/themes/blood-tomb.ts b/tiled-mcp/src/themes/blood-tomb.ts index 7d88c2d770c4b1f7f4c1cf30ab225224f207c588..6c55884fed84c11434cbe971e56b5285b665f29b 100644 --- a/tiled-mcp/src/themes/blood-tomb.ts +++ b/tiled-mcp/src/themes/blood-tomb.ts @@ -6,9 +6,9 @@ const A = "./assets/blood_tomb"; export const BLOOD_TOMB: Theme = { key: "BLOOD_TOMB", - name: "Tombeau de sang", + name: "Blood Tomb", description: - "Sanctuaire profond consacré aux pactes anciens. Dalles rituelles, runes saignantes qui pulsent au passage, autel central, candélabres en fer noir. Le sang ne sèche jamais sur ce sol.", + "A deep sanctuary devoted to ancient pacts. Ritual slabs, bleeding runes that pulse as you pass, a central altar, black iron candelabra. Blood never dries on this floor.", tilesetName: "blood-tomb-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/castle.ts b/tiled-mcp/src/themes/castle.ts index 3b77036d1d5655a0ddfab113e5bb94bdf3a97d63..5b0ca860eec48c1bd5cc6f7f3040e4df81766ac8 100644 --- a/tiled-mcp/src/themes/castle.ts +++ b/tiled-mcp/src/themes/castle.ts @@ -6,9 +6,9 @@ const A = "./assets/castle"; export const CASTLE: Theme = { key: "CASTLE", - name: "Castel Von Drak", + name: "Castle Von Drak", description: - "Marbres noirs, basalte poli, vitraux brisés, bannières frappées du blason des Von Drak. Salle du trône, escaliers grandioses, candélabres en fer noir.", + "Black marble, polished basalt, shattered stained glass, banners bearing the Von Drak crest. Throne room, grand staircases, black iron candelabra.", tilesetName: "castle-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/crypt.ts b/tiled-mcp/src/themes/crypt.ts index 0344ed27ff6a2ea646afa99933bf6a9d6d6bb01c..19afa6c53a820c5eb9c658a3a81a233b65a8994f 100644 --- a/tiled-mcp/src/themes/crypt.ts +++ b/tiled-mcp/src/themes/crypt.ts @@ -6,9 +6,9 @@ const A = "./assets/crypt"; export const CRYPT: Theme = { key: "CRYPT", - name: "Crypte mournevaldienne", + name: "Mournevald Crypt", description: - "Caveaux funéraires sous les chapelles, dalles fissurées, runes mortuaires, gaz toxiques émanant des sarcophages disjoints.", + "Burial vaults beneath the chapels, cracked flagstones, funeral runes, toxic gas seeping from broken sarcophagi.", tilesetName: "crypt-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/dark-forest.ts b/tiled-mcp/src/themes/dark-forest.ts new file mode 100644 index 0000000000000000000000000000000000000000..c90ccd25ed890e212fef8ab481241e64bb9045f2 --- /dev/null +++ b/tiled-mcp/src/themes/dark-forest.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const F = "./assets/dark_forest"; + +export const DARK_FOREST: Theme = { + key: "DARK_FOREST", + name: "Dark Forest", + description: + "Twisted woods, thick moss, exposed roots, misty clearings. Haunted forest, woodcutters' huts, graves under the oaks.", + tilesetName: "dark-forest-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "dark_forest.moss_ground", imageFile: `${F}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "dark_forest.pine_needles", imageFile: `${F}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "dark_forest.ancient_trunk", imageFile: `${F}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "dark_forest.gnarled_root", imageFile: `${F}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "dark_forest.thicket", imageFile: `${F}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "dark_forest.quicksand_pool", imageFile: `${F}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "dark_forest.standing_stone", imageFile: `${F}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "dark_forest.fallen_leaf", imageFile: `${F}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "dark_forest.wooden_gate", imageFile: `${F}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "dark_forest.root_stairs", imageFile: `${F}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#1a2a1a", fogIntensity: 0.3 }, +}; diff --git a/tiled-mcp/src/themes/desolation.ts b/tiled-mcp/src/themes/desolation.ts index d31a2daf206915a07a880e9ddd9b063c46409bef..53fba2a7bbf311d30ed43766e099799f7dbb4215 100644 --- a/tiled-mcp/src/themes/desolation.ts +++ b/tiled-mcp/src/themes/desolation.ts @@ -6,9 +6,9 @@ const D = "./assets/desolation"; export const DESOLATION: Theme = { key: "DESOLATION", - name: "Terre Desolee", + name: "Desolate Land", description: - "Cendres froides, arbres carbonisés, sols stériles, ciel gris. Paysage post-cataclysmique, ruines calcinées, ossuaires à ciel ouvert.", + "Cold ash, charred trees, barren ground, grey sky. Post-cataclysm landscape, burnt ruins, open-air ossuaries.", tilesetName: "desolation-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/electronic.ts b/tiled-mcp/src/themes/electronic.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cc5849525efb7dd8f346452a9b695c282c79750 --- /dev/null +++ b/tiled-mcp/src/themes/electronic.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const EL = "./assets/electronic"; + +export const ELECTRONIC: Theme = { + key: "ELECTRONIC", + name: "Electronic Network", + description: + "Printed circuits, optical fibres, streaming data, silent servers. Digital matrix, compute nodes, AI cores.", + tilesetName: "electronic-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "electronic.pcb_trace", imageFile: `${EL}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "electronic.chip_substrate", imageFile: `${EL}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "electronic.server_casing", imageFile: `${EL}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "electronic.circuit_corner", imageFile: `${EL}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "electronic.tangled_cable", imageFile: `${EL}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "electronic.power_surge", imageFile: `${EL}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "electronic.mainframe_core", imageFile: `${EL}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "electronic.blinking_led", imageFile: `${EL}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "electronic.biometric_door", imageFile: `${EL}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "electronic.access_ladder", imageFile: `${EL}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#0a0a1a", fogIntensity: 0.2 }, +}; diff --git a/tiled-mcp/src/themes/electronique.ts b/tiled-mcp/src/themes/electronique.ts deleted file mode 100644 index d04147b82cb2f72ec7c1478309c5e056ae1946c0..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/electronique.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const EL = "./assets/electronique"; - -export const ELECTRONIQUE: Theme = { - key: "ELECTRONIQUE", - name: "Reseau Electronique", - description: - "Circuits imprimés, fibres optiques, données en flux, serveurs silencieux. Matrice numérique, nœuds de calcul, foyers d'IA.", - tilesetName: "electronique-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "electronique.pcb_trace", imageFile: `${EL}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "electronique.chip_substrate", imageFile: `${EL}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "electronique.server_casing", imageFile: `${EL}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "electronique.circuit_corner", imageFile: `${EL}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "electronique.tangled_cable", imageFile: `${EL}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "electronique.power_surge", imageFile: `${EL}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "electronique.mainframe_core", imageFile: `${EL}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "electronique.blinking_led", imageFile: `${EL}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "electronique.biometric_door", imageFile: `${EL}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "electronique.access_ladder", imageFile: `${EL}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#0a0a1a", fogIntensity: 0.2 }, -}; diff --git a/tiled-mcp/src/themes/ete.ts b/tiled-mcp/src/themes/ete.ts deleted file mode 100644 index 71f6bec2ffaa26b53bf0ffb281e5dd752093bff3..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/ete.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const E = "./assets/ete"; - -export const ETE: Theme = { - key: "ETE", - name: "Plaine Estivale", - description: - "Herbe dorée, blés mûrs, ciel sans nuage, chaleur accablante. Moissons, greniers abandonnés, ossuaires sous le soleil.", - tilesetName: "ete-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "ete.golden_wheat", imageFile: `${E}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "ete.dry_grass", imageFile: `${E}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "ete.sunbaked_clay", imageFile: `${E}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "ete.terracotta_corner", imageFile: `${E}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "ete.cracked_earth", imageFile: `${E}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "ete.heat_haze_pool", imageFile: `${E}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "ete.scarecrow", imageFile: `${E}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "ete.dried_herb", imageFile: `${E}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "ete.weathered_plank_door", imageFile: `${E}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "ete.dusty_steps", imageFile: `${E}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#2a1a0a", fogIntensity: 0.1 }, -}; diff --git a/tiled-mcp/src/themes/flooded.ts b/tiled-mcp/src/themes/flooded.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2edad10a788e06c9ba46c00836fff958a421e15 --- /dev/null +++ b/tiled-mcp/src/themes/flooded.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const I = "./assets/flooded"; + +export const FLOODED: Theme = { + key: "FLOODED", + name: "Flooded Coast", + description: + "Towns swallowed by the sea, sunken ruins, hanging seaweed, brackish water. Drowned districts, broken bridges, submerged crypts.", + tilesetName: "flooded-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "flooded.stagnant_water", imageFile: `${I}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "flooded.muddy_flats", imageFile: `${I}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "flooded.submerged_wall", imageFile: `${I}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "flooded.drowned_corner", imageFile: `${I}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "flooded.kelp_tangle", imageFile: `${I}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "flooded.deep_current", imageFile: `${I}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "flooded.sunken_statue", imageFile: `${I}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "flooded.floating_debris", imageFile: `${I}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "flooded.bloated_door", imageFile: `${I}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "flooded.slippery_steps", imageFile: `${I}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#0a1a2a", fogIntensity: 0.35 }, +}; diff --git a/tiled-mcp/src/themes/forest.ts b/tiled-mcp/src/themes/forest.ts index df523354fd933f4fbb12d9c9c64507db2ee7bf6f..b7308044d78d34b92a939d4f0842b3f40b8926c0 100644 --- a/tiled-mcp/src/themes/forest.ts +++ b/tiled-mcp/src/themes/forest.ts @@ -6,9 +6,9 @@ const A = "./assets/haunted_forest"; export const HAUNTED_FOREST: Theme = { key: "HAUNTED_FOREST", - name: "Forêt de Drakenmark", + name: "Drakenmark Forest", description: - "Sous-bois étouffant de mousses noires, troncs morts couchés, brumes parasitaires qui s'enroulent autour des chevilles et ralentissent la marche.", + "Stifling undergrowth of black moss, fallen dead trunks, clinging mists that coil around the ankles and slow every step.", tilesetName: "forest-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/foret.ts b/tiled-mcp/src/themes/foret.ts deleted file mode 100644 index 2225937ffc8c29be9d3b1e356efe8b2cf768c1d7..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/foret.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const F = "./assets/foret"; - -export const FORET: Theme = { - key: "FORET", - name: "Foret Sombre", - description: - "Bois sylvains tordus, mousse épaisse, racines apparentes, clairières brumeuses. Foret hantée, huttes de bûcherons, tombes sous les chênes.", - tilesetName: "foret-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "foret.moss_ground", imageFile: `${F}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "foret.pine_needles", imageFile: `${F}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "foret.ancient_trunk", imageFile: `${F}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "foret.gnarled_root", imageFile: `${F}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "foret.thicket", imageFile: `${F}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "foret.quicksand_pool", imageFile: `${F}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "foret.standing_stone", imageFile: `${F}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "foret.fallen_leaf", imageFile: `${F}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "foret.wooden_gate", imageFile: `${F}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "foret.root_stairs", imageFile: `${F}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#1a2a1a", fogIntensity: 0.3 }, -}; diff --git a/tiled-mcp/src/themes/futuriste.ts b/tiled-mcp/src/themes/futuriste.ts deleted file mode 100644 index de3f27820e3edb66bf03f3c66c8fb25a974fc52d..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/futuriste.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const FT = "./assets/futuriste"; - -export const FUTURISTE: Theme = { - key: "FUTURISTE", - name: "Cite Futuriste", - description: - "Métal chromé, néons froids, panneaux holographiques, gratte-ciel en ruine. Megalopole dystopique, laboratoires secrets, cités volantes.", - tilesetName: "futuriste-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "futuriste.plasteel_plate", imageFile: `${FT}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "futuriste.circuit_floor", imageFile: `${FT}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "futuriste.chrome_panel", imageFile: `${FT}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "futuriste.alloy_corner", imageFile: `${FT}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "futuriste.broken_conduit", imageFile: `${FT}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "futuriste.plasma_leak", imageFile: `${FT}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "futuriste.server_rack", imageFile: `${FT}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "futuriste.holographic_tag", imageFile: `${FT}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "futuriste.sliding_airlock", imageFile: `${FT}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "futuriste.metal_grating_stairs", imageFile: `${FT}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#0a0a1a", fogIntensity: 0.3 }, -}; diff --git a/tiled-mcp/src/themes/futuristic.ts b/tiled-mcp/src/themes/futuristic.ts new file mode 100644 index 0000000000000000000000000000000000000000..2912a633c2b156fff5e988cd3bf7aaa268eca51e --- /dev/null +++ b/tiled-mcp/src/themes/futuristic.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const FT = "./assets/futuristic"; + +export const FUTURISTIC: Theme = { + key: "FUTURISTIC", + name: "Futuristic City", + description: + "Chrome metal, cold neon, holographic panels, ruined skyscrapers. Dystopian megacity, secret laboratories, flying cities.", + tilesetName: "futuristic-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "futuristic.plasteel_plate", imageFile: `${FT}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "futuristic.circuit_floor", imageFile: `${FT}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "futuristic.chrome_panel", imageFile: `${FT}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "futuristic.alloy_corner", imageFile: `${FT}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "futuristic.broken_conduit", imageFile: `${FT}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "futuristic.plasma_leak", imageFile: `${FT}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "futuristic.server_rack", imageFile: `${FT}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "futuristic.holographic_tag", imageFile: `${FT}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "futuristic.sliding_airlock", imageFile: `${FT}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "futuristic.metal_grating_stairs", imageFile: `${FT}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#0a0a1a", fogIntensity: 0.3 }, +}; diff --git a/tiled-mcp/src/themes/glaciaire.ts b/tiled-mcp/src/themes/glaciaire.ts deleted file mode 100644 index 1758e886d51011f3ee4c84d2dd1673092117fb57..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/glaciaire.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const G = "./assets/glaciaire"; - -export const GLACIAIRE: Theme = { - key: "GLACIAIRE", - name: "Toundra Glacée", - description: - "Glace noire, figures gelées prises dans la glace, givre, stalactites de pierre. Toundra hantée, pontons de gel, cryptes sous pergélisol.", - tilesetName: "glaciaire-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "glaciaire.black_ice", imageFile: `${G}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "glaciaire.frost_flagstone", imageFile: `${G}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "glaciaire.glacial_ice", imageFile: `${G}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "glaciaire.frost_corner", imageFile: `${G}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "glaciaire.cracked_ice", imageFile: `${G}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "glaciaire.thin_ice", imageFile: `${G}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "glaciaire.frozen_statue", imageFile: `${G}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "glaciaire.icicles", imageFile: `${G}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "glaciaire.frosted_door", imageFile: `${G}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "glaciaire.ice_stairs", imageFile: `${G}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#0a1a2a", fogIntensity: 0.25 }, -}; diff --git a/tiled-mcp/src/themes/glacier.ts b/tiled-mcp/src/themes/glacier.ts new file mode 100644 index 0000000000000000000000000000000000000000..37c9dc88d72145a57b14628dfbd71933e58058b4 --- /dev/null +++ b/tiled-mcp/src/themes/glacier.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const G = "./assets/glacier"; + +export const GLACIER: Theme = { + key: "GLACIER", + name: "Frozen Tundra", + description: + "Black ice, figures frozen in the ice, frost, stone stalactites. Haunted tundra, frozen pontoons, crypts under the permafrost.", + tilesetName: "glacier-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "glacier.black_ice", imageFile: `${G}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "glacier.frost_flagstone", imageFile: `${G}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "glacier.glacial_ice", imageFile: `${G}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "glacier.frost_corner", imageFile: `${G}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "glacier.cracked_ice", imageFile: `${G}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "glacier.thin_ice", imageFile: `${G}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "glacier.frozen_statue", imageFile: `${G}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "glacier.icicles", imageFile: `${G}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "glacier.frosted_door", imageFile: `${G}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "glacier.ice_stairs", imageFile: `${G}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#0a1a2a", fogIntensity: 0.25 }, +}; diff --git a/tiled-mcp/src/themes/hiver.ts b/tiled-mcp/src/themes/hiver.ts deleted file mode 100644 index 7bd681377acfe7bd6f47c3976ba605b016311f8b..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/hiver.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const H = "./assets/hiver"; - -export const HIVER: Theme = { - key: "HIVER", - name: "Plaine Enneigee", - description: - "Neige poudreuse, lacs gelés, branches givrées, brouillard glacial. Toundra hivernale, refuges de trappeurs, tombeaux sous la neige.", - tilesetName: "hiver-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "hiver.fresh_snow", imageFile: `${H}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "hiver.packed_ice", imageFile: `${H}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "hiver.snow_drift", imageFile: `${H}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "hiver.frozen_corner", imageFile: `${H}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "hiver.slush", imageFile: `${H}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "hiver.thin_ice_lake", imageFile: `${H}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "hiver.frozen_cairn", imageFile: `${H}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "hiver.snowflake", imageFile: `${H}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "hiver.frosted_log_door", imageFile: `${H}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "hiver.ice_steps", imageFile: `${H}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#0f1a2a", fogIntensity: 0.2 }, -}; diff --git a/tiled-mcp/src/themes/index.ts b/tiled-mcp/src/themes/index.ts index 470e14a21999507c9f6c1b6a0d841c78d77f2177..afce361f4437a3f348e5df5fa8ac8a5355de5747 100644 --- a/tiled-mcp/src/themes/index.ts +++ b/tiled-mcp/src/themes/index.ts @@ -3,6 +3,7 @@ import { join } from "node:path"; import { assetsRoot } from "../paths.js"; import { ASSET_PREFIX } from "../tmj.js"; import type { Theme } from "../types.js"; +import { z } from "zod"; import { CRYPT } from "./crypt.js"; import { CASTLE } from "./castle.js"; import { WEREWOLF_DEN } from "./werewolf-den.js"; @@ -12,17 +13,17 @@ import { HAUNTED_FOREST } from "./forest.js"; import { MAUSOLEUM } from "./mausoleum.js"; import { BLOOD_TOMB } from "./blood-tomb.js"; import { AQUATIC } from "./aquatic.js"; -import { GLACIAIRE } from "./glaciaire.js"; -import { INONDE } from "./inonde.js"; -import { VOLCAN } from "./volcan.js"; -import { FORET } from "./foret.js"; -import { HIVER } from "./hiver.js"; -import { PRINTEMPS } from "./printemps.js"; -import { ETE } from "./ete.js"; -import { AUTOMNE } from "./automne.js"; +import { GLACIER } from "./glacier.js"; +import { FLOODED } from "./flooded.js"; +import { VOLCANO } from "./volcano.js"; +import { DARK_FOREST } from "./dark-forest.js"; +import { WINTER } from "./winter.js"; +import { SPRING } from "./spring.js"; +import { SUMMER } from "./summer.js"; +import { AUTUMN } from "./autumn.js"; import { DESOLATION } from "./desolation.js"; -import { FUTURISTE } from "./futuriste.js"; -import { ELECTRONIQUE } from "./electronique.js"; +import { FUTURISTIC } from "./futuristic.js"; +import { ELECTRONIC } from "./electronic.js"; export const THEMES: Record = { CRYPT, @@ -34,23 +35,41 @@ export const THEMES: Record = { MAUSOLEUM, BLOOD_TOMB, AQUATIC, - GLACIAIRE, - INONDE, - VOLCAN, - FORET, - HIVER, - PRINTEMPS, - ETE, - AUTOMNE, + GLACIER, + FLOODED, + VOLCANO, + DARK_FOREST, + WINTER, + SPRING, + SUMMER, + AUTUMN, DESOLATION, - FUTURISTE, - ELECTRONIQUE, + FUTURISTIC, + ELECTRONIC, }; export const THEME_KEYS = Object.keys(THEMES) as [string, ...string[]]; +/** French theme keys used before 0.5.0, mapped to their English replacement. */ +export const LEGACY_THEME_KEYS: Record = { GLACIAIRE: "GLACIER", INONDE: "FLOODED", VOLCAN: "VOLCANO", FORET: "DARK_FOREST", HIVER: "WINTER", PRINTEMPS: "SPRING", ETE: "SUMMER", AUTOMNE: "AUTUMN", FUTURISTE: "FUTURISTIC", ELECTRONIQUE: "ELECTRONIC" }; + +/** The current key for `key`, translating a pre-0.5.0 French key. */ +export function resolveThemeKey(key: string): string { + return LEGACY_THEME_KEYS[key] ?? key; +} + +/** Tool input schema for a theme key; an old French key gets an error naming its replacement. */ +export function themeKeySchema() { + return z.enum(THEME_KEYS, { + error: (issue) => { + const renamed = typeof issue.input === "string" ? LEGACY_THEME_KEYS[issue.input] : undefined; + return renamed ? `Theme '${String(issue.input)}' was renamed '${renamed}' in 0.5.0: use '${renamed}'.` : undefined; + }, + }); +} + export function getTheme(key: string): Theme { - const theme = THEMES[key]; + const theme = THEMES[resolveThemeKey(key)]; if (!theme) { throw new Error(`Unknown theme '${key}'. Available themes: ${THEME_KEYS.join(", ")}`); } diff --git a/tiled-mcp/src/themes/inonde.ts b/tiled-mcp/src/themes/inonde.ts deleted file mode 100644 index 24e33cf6f49ffa295a632bc3db4af2fa7021ed7b..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/inonde.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const I = "./assets/inonde"; - -export const INONDE: Theme = { - key: "INONDE", - name: "Cote Inondee", - description: - "Villes englouties sous les flots, ruines submergees, algues pendantes, eaux saumustres. Quartiers noyés, ponts rompus, cryptes immergees.", - tilesetName: "inonde-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "inonde.stagnant_water", imageFile: `${I}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "inonde.muddy_flats", imageFile: `${I}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "inonde.submerged_wall", imageFile: `${I}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "inonde.drowned_corner", imageFile: `${I}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "inonde.kelp_tangle", imageFile: `${I}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "inonde.deep_current", imageFile: `${I}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "inonde.sunken_statue", imageFile: `${I}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "inonde.floating_debris", imageFile: `${I}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "inonde.bloated_door", imageFile: `${I}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "inonde.slippery_steps", imageFile: `${I}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#0a1a2a", fogIntensity: 0.35 }, -}; diff --git a/tiled-mcp/src/themes/mausoleum.ts b/tiled-mcp/src/themes/mausoleum.ts index cc5c8c9b824aa8f989e48e7743d02de8ea5fa66a..a6ba1dfb6ee5291d3f807b18ef70fda8f7cc17fe 100644 --- a/tiled-mcp/src/themes/mausoleum.ts +++ b/tiled-mcp/src/themes/mausoleum.ts @@ -6,9 +6,9 @@ const A = "./assets/mausoleum"; export const MAUSOLEUM: Theme = { key: "MAUSOLEUM", - name: "Mausolée", + name: "Mausoleum", description: - "Marbre veiné de gris, statues d'anges déchus aux ailes brisées, urnes funéraires alignées dans les niches, chuchotements à la limite de l'audible.", + "Grey-veined marble, statues of fallen angels with broken wings, funeral urns lined up in niches, whispers at the edge of hearing.", tilesetName: "mausoleum-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/printemps.ts b/tiled-mcp/src/themes/printemps.ts deleted file mode 100644 index ca2b006af219a51e38ed28fbbf9de7d4b5cca702..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/printemps.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const P = "./assets/printemps"; - -export const PRINTEMPS: Theme = { - key: "PRINTEMPS", - name: "Prairie Printaniere", - description: - "Champs en fleurs, herbe tendre, ruisseaux clairs, arbres en bourgeon. Prairies ouvertes, cercles de druides, fontaines sacrées.", - tilesetName: "printemps-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "printemps.green_meadow", imageFile: `${P}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "printemps.clover_field", imageFile: `${P}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "printemps.living_hedge", imageFile: `${P}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "printemps.flowered_arch", imageFile: `${P}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "printemps.muddy_puddle", imageFile: `${P}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "printemps.swollen_stream", imageFile: `${P}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "printemps.maypole", imageFile: `${P}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "printemps.wildflower", imageFile: `${P}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "printemps.woven_wicker_door", imageFile: `${P}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "printemps.moss_steps", imageFile: `${P}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#1a2a1a", fogIntensity: 0.15 }, -}; diff --git a/tiled-mcp/src/themes/prompts.ts b/tiled-mcp/src/themes/prompts.ts index 4972f6090a050dd0af5dc899687021e852a5b56a..9bfe834b75a0dc0bc4d93d12e7980c654f209f60 100644 --- a/tiled-mcp/src/themes/prompts.ts +++ b/tiled-mcp/src/themes/prompts.ts @@ -16,17 +16,17 @@ export type ThemeKey = | "MAUSOLEUM" | "BLOOD_TOMB" | "AQUATIC" - | "GLACIAIRE" - | "INONDE" - | "VOLCAN" - | "FORET" - | "HIVER" - | "PRINTEMPS" - | "ETE" - | "AUTOMNE" + | "GLACIER" + | "FLOODED" + | "VOLCANO" + | "DARK_FOREST" + | "WINTER" + | "SPRING" + | "SUMMER" + | "AUTUMN" | "DESOLATION" - | "FUTURISTE" - | "ELECTRONIQUE"; + | "FUTURISTIC" + | "ELECTRONIC"; interface RoleVisual { /** Material / subject description for the tile. */ @@ -539,7 +539,7 @@ export const ROLE_VISUALS: Partial/.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const P = "./assets/spring"; + +export const SPRING: Theme = { + key: "SPRING", + name: "Spring Meadow", + description: + "Fields in bloom, tender grass, clear streams, budding trees. Open meadows, druid circles, sacred fountains.", + tilesetName: "spring-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "spring.green_meadow", imageFile: `${P}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "spring.clover_field", imageFile: `${P}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "spring.living_hedge", imageFile: `${P}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "spring.flowered_arch", imageFile: `${P}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "spring.muddy_puddle", imageFile: `${P}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "spring.swollen_stream", imageFile: `${P}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "spring.maypole", imageFile: `${P}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "spring.wildflower", imageFile: `${P}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "spring.woven_wicker_door", imageFile: `${P}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "spring.moss_steps", imageFile: `${P}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#1a2a1a", fogIntensity: 0.15 }, +}; diff --git a/tiled-mcp/src/themes/summer.ts b/tiled-mcp/src/themes/summer.ts new file mode 100644 index 0000000000000000000000000000000000000000..934992bdc6a60f8e078ab2a478dbceefcf6246f6 --- /dev/null +++ b/tiled-mcp/src/themes/summer.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const E = "./assets/summer"; + +export const SUMMER: Theme = { + key: "SUMMER", + name: "Summer Plain", + description: + "Golden grass, ripe wheat, cloudless sky, crushing heat. Harvest fields, abandoned granaries, ossuaries under the sun.", + tilesetName: "summer-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "summer.golden_wheat", imageFile: `${E}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "summer.dry_grass", imageFile: `${E}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "summer.sunbaked_clay", imageFile: `${E}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "summer.terracotta_corner", imageFile: `${E}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "summer.cracked_earth", imageFile: `${E}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "summer.heat_haze_pool", imageFile: `${E}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "summer.scarecrow", imageFile: `${E}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "summer.dried_herb", imageFile: `${E}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "summer.weathered_plank_door", imageFile: `${E}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "summer.dusty_steps", imageFile: `${E}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#2a1a0a", fogIntensity: 0.1 }, +}; diff --git a/tiled-mcp/src/themes/tavern.ts b/tiled-mcp/src/themes/tavern.ts index 2b64f932c6f9710852fbf0cd7f1ccd7c373038c5..5cbaa80279adcdddc955a662871f262a1be93c0b 100644 --- a/tiled-mcp/src/themes/tavern.ts +++ b/tiled-mcp/src/themes/tavern.ts @@ -6,9 +6,9 @@ const A = "./assets/tavern_blood_prince"; export const TAVERN_BLOOD_PRINCE: Theme = { key: "TAVERN_BLOOD_PRINCE", - name: "Auberge du Prince Sanglant", + name: "Blood Prince Inn", description: - "Parquet sombre, enduit fissuré, lourde charpente apparente. Tables rondes en chêne, âtre crépitant, bar marbré de taches anciennes. Pas de pièges actifs — la peur suffit.", + "Dark floorboards, cracked plaster, heavy exposed beams. Round oak tables, a crackling hearth, a bar marked with old stains. No active traps: fear is enough.", tilesetName: "tavern-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/village.ts b/tiled-mcp/src/themes/village.ts index 3281da23832d5b218d703cef30b76471cf6d1b3d..fbf34f027c3b26321901a2c58c23000490571dc6 100644 --- a/tiled-mcp/src/themes/village.ts +++ b/tiled-mcp/src/themes/village.ts @@ -6,9 +6,9 @@ const A = "./assets/village"; export const VILLAGE: Theme = { key: "VILLAGE", - name: "Village mournevaldien", + name: "Mournevald Village", description: - "Pavés humides luisant sous la pluie perpétuelle, maisons à colombages aux fenêtres closes, étals de marché abandonnés, puits central et potence rouillée sur la place.", + "Wet cobblestones gleaming under endless rain, half-timbered houses with shuttered windows, abandoned market stalls, a central well and a rusty gallows on the square.", tilesetName: "village-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/volcan.ts b/tiled-mcp/src/themes/volcan.ts deleted file mode 100644 index 52bf0ec65ab36c57b6136ebd0318c19de3efb606..0000000000000000000000000000000000000000 --- a/tiled-mcp/src/themes/volcan.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Theme } from "../types.js"; - -// Sprite paths are "./assets//.png", relative to the repository root -// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. -const V = "./assets/volcan"; - -export const VOLCAN: Theme = { - key: "VOLCAN", - name: "Pente Volcanique", - description: - "Coulées de lave, roches noires refroidies, cendres volantes, chaleur étouffante. Caldera active, ponts de basalte, cryptes de cendre.", - tilesetName: "volcan-tileset", - tilewidth: 64, - tileheight: 32, - tiles: [ - { role: "walkable_floor", tileType: "WALKABLE", spriteId: "volcan.cooled_lava", imageFile: `${V}/walkable_floor.png` }, - { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "volcan.ash_ground", imageFile: `${V}/walkable_floor_alt.png` }, - { role: "wall", tileType: "WALL", spriteId: "volcan.dark_basalt", imageFile: `${V}/wall.png`, imageWidth: 64, imageHeight: 64 }, - { role: "wall_corner", tileType: "WALL", spriteId: "volcan.magma_corner", imageFile: `${V}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, - { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "volcan.cracked_obsidian", imageFile: `${V}/difficult_terrain.png` }, - { role: "hazard_primary", tileType: "HAZARD", spriteId: "volcan.lava_flow", imageFile: `${V}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, - { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "volcan.obsidian_menhir", imageFile: `${V}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, - { role: "decoration_minor", tileType: "WALKABLE", spriteId: "volcan.ember_ash", imageFile: `${V}/decoration_minor.png` }, - { role: "door_closed", tileType: "DOOR", spriteId: "volcan.iron_door", imageFile: `${V}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, - { role: "stairs", tileType: "STAIRS", spriteId: "volcan.ash_stairs", imageFile: `${V}/stairs.png`, imageWidth: 64, imageHeight: 64 }, - ], - ambient: { lightColor: "#1a0a00", fogIntensity: 0.4 }, -}; diff --git a/tiled-mcp/src/themes/volcano.ts b/tiled-mcp/src/themes/volcano.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c17a3b3b380df24e599e89f23d3a2fe97d4b317 --- /dev/null +++ b/tiled-mcp/src/themes/volcano.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const V = "./assets/volcano"; + +export const VOLCANO: Theme = { + key: "VOLCANO", + name: "Volcanic Slope", + description: + "Lava flows, cooled black rock, drifting ash, stifling heat. Active caldera, basalt bridges, crypts of ash.", + tilesetName: "volcano-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "volcano.cooled_lava", imageFile: `${V}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "volcano.ash_ground", imageFile: `${V}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "volcano.dark_basalt", imageFile: `${V}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "volcano.magma_corner", imageFile: `${V}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "volcano.cracked_obsidian", imageFile: `${V}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "volcano.lava_flow", imageFile: `${V}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "volcano.obsidian_menhir", imageFile: `${V}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "volcano.ember_ash", imageFile: `${V}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "volcano.iron_door", imageFile: `${V}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "volcano.ash_stairs", imageFile: `${V}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#1a0a00", fogIntensity: 0.4 }, +}; diff --git a/tiled-mcp/src/themes/werewolf-den.ts b/tiled-mcp/src/themes/werewolf-den.ts index 9d00c9dd56c254b10da4041a73f4804fb165592e..91a77529cc46793ea99f637982d41c79d2ef2567 100644 --- a/tiled-mcp/src/themes/werewolf-den.ts +++ b/tiled-mcp/src/themes/werewolf-den.ts @@ -6,9 +6,9 @@ const A = "./assets/werewolf_den"; export const WEREWOLF_DEN: Theme = { key: "WEREWOLF_DEN", - name: "Tanière de loups-garous", + name: "Werewolf Den", description: - "Cavernes humides creusées dans la forêt de Drakenmark, sol en terre battue jonché d'ossements, parois rocheuses entaillées par les griffes, mares de sang frénétique près des proies récentes.", + "Damp caves dug into the Drakenmark forest, packed-earth floor strewn with bones, rock walls scored by claws, pools of blood near fresh prey.", tilesetName: "werewolf-den-tileset", tilewidth: 64, tileheight: 32, diff --git a/tiled-mcp/src/themes/winter.ts b/tiled-mcp/src/themes/winter.ts new file mode 100644 index 0000000000000000000000000000000000000000..c73bc1a7e53dfd7d0cf2c0c69b1be2256e1ca3c3 --- /dev/null +++ b/tiled-mcp/src/themes/winter.ts @@ -0,0 +1,28 @@ +import type { Theme } from "../types.js"; + +// Sprite paths are "./assets//.png", relative to the repository root +// (or TILED_ASSETS_DIR). save_to_disk rewrites them relative to the saved .tmj file. +const H = "./assets/winter"; + +export const WINTER: Theme = { + key: "WINTER", + name: "Snowy Plain", + description: + "Powder snow, frozen lakes, frosted branches, freezing fog. Winter tundra, trappers' shelters, tombs under the snow.", + tilesetName: "winter-tileset", + tilewidth: 64, + tileheight: 32, + tiles: [ + { role: "walkable_floor", tileType: "WALKABLE", spriteId: "winter.fresh_snow", imageFile: `${H}/walkable_floor.png` }, + { role: "walkable_floor_alt", tileType: "WALKABLE", spriteId: "winter.packed_ice", imageFile: `${H}/walkable_floor_alt.png` }, + { role: "wall", tileType: "WALL", spriteId: "winter.snow_drift", imageFile: `${H}/wall.png`, imageWidth: 64, imageHeight: 64 }, + { role: "wall_corner", tileType: "WALL", spriteId: "winter.frozen_corner", imageFile: `${H}/wall_corner.png`, imageWidth: 64, imageHeight: 64 }, + { role: "difficult_terrain", tileType: "DIFFICULT_TERRAIN", spriteId: "winter.slush", imageFile: `${H}/difficult_terrain.png` }, + { role: "hazard_primary", tileType: "HAZARD", spriteId: "winter.thin_ice_lake", imageFile: `${H}/hazard_primary.png`, imageWidth: 64, imageHeight: 64 }, + { role: "obstacle_decor", tileType: "OBSTACLE", spriteId: "winter.frozen_cairn", imageFile: `${H}/obstacle_decor.png`, imageWidth: 64, imageHeight: 64 }, + { role: "decoration_minor", tileType: "WALKABLE", spriteId: "winter.snowflake", imageFile: `${H}/decoration_minor.png` }, + { role: "door_closed", tileType: "DOOR", spriteId: "winter.frosted_log_door", imageFile: `${H}/door_closed.png`, imageWidth: 64, imageHeight: 64 }, + { role: "stairs", tileType: "STAIRS", spriteId: "winter.ice_steps", imageFile: `${H}/stairs.png`, imageWidth: 64, imageHeight: 64 }, + ], + ambient: { lightColor: "#0f1a2a", fogIntensity: 0.2 }, +}; diff --git a/tiled-mcp/src/tools/generation.ts b/tiled-mcp/src/tools/generation.ts index 95e400f59941d245c3a8e57b7a401d3c9b4e4768..115d107824ad964f0447b363ae4afc94a6a9bbf9 100644 --- a/tiled-mcp/src/tools/generation.ts +++ b/tiled-mcp/src/tools/generation.ts @@ -10,7 +10,7 @@ import { existsSync } from "node:fs"; import { join } from "node:path"; import { buildBuildingPrompt, buildPrompt, NEGATIVE_PROMPT, type ThemeKey } from "../themes/prompts.js"; import { BUILDINGS, BUILDING_TYPES, buildingSpriteFile } from "../buildings.js"; -import { THEME_KEYS, themeAssetDir } from "../themes/index.js"; +import { themeAssetDir, themeKeySchema } from "../themes/index.js"; import { THEME_ROLES } from "../types.js"; import { getMap, overrideTileImage } from "../builder.js"; import { assetsRoot, resolveUserPath } from "../paths.js"; @@ -348,7 +348,7 @@ async function fitBuilding(sharp: Sharp, buf: Buffer, width: number, height: num .toBuffer(); } -const THEME = z.enum(THEME_KEYS).describe("Theme key from list_themes"); +const THEME = themeKeySchema().describe("Theme key from list_themes"); const ROLE = z.enum(THEME_ROLES).describe("Tile role, e.g. walkable_floor, wall, obstacle_decor"); const PAID = { readOnlyHint: false, destructiveHint: false, openWorldHint: true } as const; diff --git a/tiled-mcp/src/tools/lifecycle.ts b/tiled-mcp/src/tools/lifecycle.ts index cd9294bddeb8aab1a60a8c8f63e593b071d28ecc..0e5473c1c45fc0e858377688d692f471d7d926fa 100644 --- a/tiled-mcp/src/tools/lifecycle.ts +++ b/tiled-mcp/src/tools/lifecycle.ts @@ -1,7 +1,7 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { createMap, describeMap, discardMap, listMaps, maxMapSize } from "../builder.js"; -import { THEME_KEYS, describeThemes, getTheme } from "../themes/index.js"; +import { describeThemes, getTheme, themeKeySchema } from "../themes/index.js"; import { asText } from "./util.js"; export function registerLifecycleTools(server: McpServer): void { @@ -28,7 +28,7 @@ export function registerLifecycleTools(server: McpServer): void { name: z.string().min(1).max(120).describe("Display name of the map, e.g. 'Crypt under the abandoned chapel'"), width: z.number().int().min(4).max(max).describe(`Width in cells, 4..${max} (1 cell = 5 ft in tabletop terms)`), height: z.number().int().min(4).max(max).describe(`Height in cells, 4..${max}`), - theme: z.enum(THEME_KEYS).describe("Theme key from list_themes, e.g. CRYPT"), + theme: themeKeySchema().describe("Theme key from list_themes, e.g. CRYPT"), orientation: z.enum(["isometric", "orthogonal"]).optional().describe("Defaults to isometric"), }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }, diff --git a/tiled-mcp/src/tools/world.ts b/tiled-mcp/src/tools/world.ts index 266751fb085edc4a7a62aa4615d7828cb692ecc4..132b2185c11d0f1bc6d70ad13151b397ffe05b1a 100644 --- a/tiled-mcp/src/tools/world.ts +++ b/tiled-mcp/src/tools/world.ts @@ -7,7 +7,7 @@ import { isHosted } from "../context.js"; import { publishWorld } from "../downloads.js"; import { slugify } from "../names.js"; import { mapsRoot, resolveUserPath } from "../paths.js"; -import { THEME_KEYS } from "../themes/index.js"; +import { themeKeySchema } from "../themes/index.js"; import { saveMapFile } from "../tmj.js"; import { linkMaps, placeBuilding, validateWorld, worldOf } from "../world.js"; import { GRID_HELP, asText } from "./util.js"; @@ -40,7 +40,7 @@ export function registerWorldTools(server: McpServer): void { name: z.string().min(1).max(80).optional().describe("Display name, e.g. 'Miller house'; also the base of the building id"), door: z.enum(["south", "east"]).optional().describe("Footprint edge with the door: south (default, bottom-left face) or east (bottom-right face)"), interior: z.boolean().optional().describe("Create and link an interior map (default true); false places a building that cannot be entered"), - interiorTheme: z.enum(THEME_KEYS).optional().describe("Theme of the interior (default per type: TAVERN_BLOOD_PRINCE, MAUSOLEUM or CASTLE)"), + interiorTheme: themeKeySchema().optional().describe("Theme of the interior (default per type: TAVERN_BLOOD_PRINCE, MAUSOLEUM or CASTLE)"), interiorWidth: z.number().int().min(5).max(max).optional().describe("Interior width in cells (default per type)"), interiorHeight: z.number().int().min(5).max(max).optional().describe("Interior height in cells (default per type)"), spriteVariant: z diff --git a/tiled-mcp/web/app.js b/tiled-mcp/web/app.js index b6cfaf71ce941727dff6deaeb8b4182a8474695f..423b7a127e27e025f6017bd62b65982d9968ab4a 100644 --- a/tiled-mcp/web/app.js +++ b/tiled-mcp/web/app.js @@ -10,7 +10,7 @@ const EXAMPLES = [ ["Crypt", "A crypt 28x18 under an abandoned chapel: two skeletons patrol the nave, a ghoul lord sleeps in the deep crypt behind a locked door (DC 15), and a poison trap guards the reliquary."], ["Ice fortress", "A frozen fortress 30x22: a great hall with ice pillars, a throne room at the far end where a frost giant waits, two guard rooms, and slippery ice in the corridors."], ["Tavern", "A cozy tavern 20x14 with a bar, tables, a hearth and stairs to the cellar. The innkeeper and three patrons are friendly NPCs; a thief hides in the storeroom."], - ["Repaire (FR)", "Un repaire de loups-garous 24x18 dans une grotte humide : l'alpha dort au fond de sa tanière, des tas d'os ralentissent le passage, et trois loups attendent en embuscade près de l'entrée."], + ["Werewolf den (in French)", "Un repaire de loups-garous 24x18 dans une grotte humide : l'alpha dort au fond de sa tanière, des tas d'os ralentissent le passage, et trois loups attendent en embuscade près de l'entrée."], ]; let session = loadSession();