Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to create folders within 'collection of images' tileset #3670

Open
patchuby opened this issue Apr 22, 2023 · 10 comments
Open

Ability to create folders within 'collection of images' tileset #3670

patchuby opened this issue Apr 22, 2023 · 10 comments
Labels
feature It's a feature, not a bug.

Comments

@patchuby
Copy link

Is your feature request related to a problem? Please describe.
For the purposes of my game, I have 3 tilesets with a bit south of 700 tiles divided in between them. It's hard to find a tile in there, and slows down the process of map making. Ideally it'd be easier for me to optimize the game with only one giant tileset.

Describe the solution you'd like
Now that we can reorder the tiles within a tileset while retaining the gids, I wonder if it would be possible to group them in folders within a tileset.
It would not affect the gid, and in the saved tileset there would still be the 'tiles' array with all tiles unchanged, but there would be an additional element, 'folders' for example, which would be an object/dictionnary with the structure of the folder hierarchy within the tileset.
The export option is not necessary for me in the game, just a way for tiled to remember the folders, there are probably more efficient ways to do that.

@patchuby patchuby added the feature It's a feature, not a bug. label Apr 22, 2023
@patchuby patchuby changed the title Ability to create folders within tileset Ability to create folders within 'collection of images' tileset Apr 22, 2023
@eishiya
Copy link
Contributor

eishiya commented Apr 22, 2023

The usual way this is handled is by making a bunch of tilesets with fewer tiles. With image collections in particular, there's very little optimization to be gained from having a small number of larger tilesets since the images are likely to all be different and independently loaded anyway. It's also an option to replace all these separate tilesets with a single giant tileset, using a script such as this one, which can be adapted to run in exported maps - so your working maps would use a dozen small tilesets, and your maps exported to your game engine would use the single unified tileset.

If folders are added to collections of images, then why shouldn't they be added to regular tilesets? There's no difference between collections of images and regular tileset besides the source of the tile images. Plus, single-image tilesets are more likely to suffer from organisation issues since you can't easily split those tiles across multiple tilesets.

@patchuby
Copy link
Author

The script you provide means I'd have to maintain a remapping file outside of tiled right ?
The larger tileset doesn't have to do with optimization directly, just the ease of use of organizing the tiles when I move them around, not having to worry about remapping them in other tilesets. I'm trying to balance ease of use for the map maker (& technical artist) to optimize the loading of tilesets (and their corresponding textures in game).

This issue might be due to the fact that I'm using tiled not in the way it was originally intended (doing a hand drawn isometric game will present weird challenges) so I'm faced with this kind of stuff that was fine when the game started production and the number of assets was low, but now the tedium has increased with the size of the project (classic tale).

@patchuby
Copy link
Author

Looking more closely at the script, it seems to be cell based, where I'm using tile objects that are not snapped to the cell.

@eishiya
Copy link
Contributor

eishiya commented Apr 22, 2023

The script replaces both tiles in cells, and tiles in Tile Objects.

If you use a bunch of tilesets for organisation, you don't have to "maintain" a remapping map, you can simply make one (without saving, even!) with the old tile(s) and those same tile(s) in their new tileset(s), update your maps with the script, and then delete the old tile. It adds an extra step to moving tiles between tilesets, but it's a step that can fix all your maps.
You would only need to maintain a full remapping if you want to convert from a bunch of smaller tilesets to a single giant one as part of your export step, which you said you don't need to do.

It's also possible to use scripting to perform the tile movement between tilesets and the replacement in one action, which would make it nearly as quick as built-in folders would be.

@patchuby
Copy link
Author

Ok I think I'm trapped then, I'll have to learn scripting for tiled !

@eishiya
Copy link
Contributor

eishiya commented Apr 22, 2023

If you need this now, scripting is your best bet, as I doubt we're likely to get this feature soon - it involves a bunch of UI, which is always slow, and it doesn't seem to be a common demand, since most people use multiple tilesets and don't move tiles between them frequently.
There are feature requests to make it easier to find specific tiles regardless of the tileset they're in though, which may be of use to you, and perhaps more likely to be implemented.

Another alternative feature request to this one is the scratch pad panel, which would let you organise your tiles using maps. So, you could have your tiles all in one monstrosity of a tileset, but organise them in a map or several maps, arranged in a more convenient way than is possible in tilesets (with empty space and duplicates, for example). This would mean you had to add new tiles to the map, but that would essentially be instead of rearranging the tileset, so it wouldn't add much of an extra step.

@patchuby
Copy link
Author

Don't need it now, we're nearing the end of production, I'll stomach the tedium !

I'm not going to hold out hope for this feature anytime soon, since my feature request of folder syncing of 2021 is still being processed ;)

I'll start learning scripting during the pre prod of the next game, and it'll allow me to make a tailor made solution for us, that's best automated & optimized

@eishiya
Copy link
Contributor

eishiya commented Apr 22, 2023

If you're familiar with C++, you could also look into building your actual dream features yourself for Tiled - scripting is a lot more limited in what you can do. If you already know JavaScript but not C++/Qt, then scripting is a good option though.

@patchuby
Copy link
Author

I'm using gamemaker so I know GML which is close to Javascript, so here's to hoping there's not a big jump!
Thanks for the advices :)

@bjorn
Copy link
Member

bjorn commented Apr 24, 2023

I think the scratch panel mentioned by @eishiya (described in issue #3288), could provide a nice and flexible solution to the problem of organizing tiles for efficient selection, and it avoids a lot of the UI challenges that would result from introducing folders within tilesets.

For image collection tilesets, there is the synchronization issue you opened (#3083), and maybe as part of that we could support watching a folder recursively and keeping this file system hierarchy visible in the tileset view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants