Kiamo2 / YATI

Addon to import Tiled maps into Godot 4
MIT License
137 stars 15 forks source link

Option to import TSX files as an external TileSet resource #48

Open trickster721 opened 1 week ago

trickster721 commented 1 week ago

It would be useful to be able to import a list or folder of TSX Tilesets into a single Godot file, and let TileMaps reference that, instead of embedding a unique TileSet into each TileMap. I have many small maps in my project (one per screen), and the thousands of duplicate embedded TileSets adds up to 50 MB. Using an external shared TileSet would cut that down to 20 KB.

Great plugin by the way, thanks!

Kiamo2 commented 1 week ago

This should be achievable by creating a (dummy) .tmx which refers/includes all your .tsx files and importing that. By option 'Save Tileset To' the resulting big Godot tileset could be exported to a .res file and used otherwise.

trickster721 commented 1 week ago

There's two issues with this approach:

I'd still suggest that it would be more convenient (and probably safer) if the plugin kept track of the source indexes, maybe by automatically logging them in a data file, or reading a custom property from Tiled that labels each TSX with a source index number.

Kiamo2 commented 1 week ago

The proposal with the custom property in Tiled appeares to me as a good idea. I'll implement this in the next release which is planned for Godot 4.3 after it's stable release.