mapeditor / mapeditor/tiled

"Remove Unused Tilesets" export option

Open
#3,855 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

It is usually a waste of space and parsing effort to deal with unused Tilesets in production maps, but it may be useful to leave the references in the working files. To solve this issue, it would be great if Tiled had an export option that removed unused tilesets.

There's a script available to remove unused tilesets, but it doesn't fully solve the problem: it affects the working map as well, and Tiled scripting has no good way to only affect exports. The script could be modified to re-add the removed tilesets after the asset has been saved, but then the order of tilesets will be changed, and the order is important for some engines.

This was requested by mingw on Discord.
Well, more accurately, they requested that Tiled should (provide the option to) remove unused tilesets automatically when tiles are removed. I think in practice this would be quite annoying, so I think an export option is better. If a user actually wants tilesets removed from their working map, the script linked above can be used to automatically remove tilesets on save, which should be less annoying than doing so whenever tiles are erased/replaced.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked remove-unused-tilesets.js script first, then trace Tiled's export handling to find where an export-only option could fit. Done means exported maps omit unused tilesets while working files retain their references and original tileset order.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.