Spaces:
Running

tiled-map-builder / docs /troubleshooting.md
4math's picture
Sync from GitHub 964d9e3
950662b verified
|
Raw History Blame Contribute Delete
4.08 kB

Troubleshooting

Start with the automated check. It starts the server and exercises it end to end, offline:

npm run build && npm run smoke

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

  • Run npm run build: the client starts tiled-mcp/dist/index.js, which only exists after a build.
  • Use an absolute path in the client configuration.
  • Check the Node version with node --version; it must be 20.9 or newer. If your client starts a different Node than your terminal, put the full path to node in command.
  • Restart the client after editing its configuration.
  • Try npm run inspect: if the MCP Inspector lists the tools, the server is fine.

Unknown mapId

Maps live in server memory. They disappear when the client restarts the server, and every client session has its own server process. Call list_maps, or create the map again. Save with save_to_disk before closing the session.

Tiled shows red placeholder tiles

  • The theme has no sprites yet: list_themes shows sprites.status: "none". Use a theme with bundled sprites, or generate them.
  • The file was produced by export_json and saved by hand somewhere else. Its image paths are relative to the repository root (./assets/...). Use save_to_disk, which writes paths relative to the file, or move the file to the repository root.
  • You moved a saved .tmj to another folder. Save it again from the server, or fix the paths in Tiled (Map, Tileset properties).

Objects or spawns are on the wrong tiles in my engine

Since 0.2.0, objects use Tiled's native isometric encoding. If your importer was written for the older screen-space encoding, either update it with the formulas in map-format.md or set TILED_OBJECT_COORDS=screen.

"Map too small for generate_crypt_layout"

Presets need room for their rooms not to overlap: crypt 27x18, castle 27x20, werewolf den 22x16. Create a larger map, or build the layout with generate_room and generate_corridor.

A placement is rejected

The error says why: a wall on that cell, no ground (outside the rooms), an obstacle prop, or another object or spawn already there. Use get_tile_info on the walls and ground layers and pick a free floor cell. Doors are the exception: they go in wall openings.

"cannot be reached on foot"

validate_map or validate_world found part of the map the player cannot walk to from the player spawn (see Walking reachability). The usual causes: an obstacle prop or a building right behind a doorway, a wall opening with no ground painted in it, or two rooms whose walls overlap and leave no opening between them. The warning names the objects and gives one cell of each cut-off area: open a path there with erase_tile (layer=decorations for a prop, layer=walls for a wall) or paint_rect on the ground, or move the building.

Sprite generation fails

  • HUGGINGFACE_API_KEY (or HF_TOKEN) is not set: add the token to tiled-mcp/.env or to the client's env block. See sprite-generation.md.
  • The sprite already exists: nothing was billed. Pass force: true to regenerate.
  • Provider or billing errors come from Hugging Face. We have not been able to find inference provider information means the provider in use no longer serves FLUX.1-dev: the error lists the ones that do. Remove TILED_HF_PROVIDER to pick one automatically, or set it to one of them.
  • 'sharp' could not be loaded: run npm install again. Map editing works without it; only sprite generation and previews need it.
  • The client times out on generate_theme_sprite_set: use node scripts/gen-theme-set.mjs <THEME> --yes.

Running the server on WSL from a Windows client

See client-setup.md. Windows paths passed to tools, such as D:/maps/crypt.tmj, are translated to /mnt/d/... automatically.