mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

No option to change layer ID #4020

ManPython posted onGitHub

Describe the bug No option to change layer ID. This made problem when deleting old to add new due some mistakes, then ID is always incremented.

To Reproduce Steps to reproduce the behavior:

  1. Add layer twice or more to have eg 5 layers
  2. Delete layer 2 and 4
  3. Try to change ID layer 3 to 2 and 4 to 3

Expected behavior Manage ID due automation for discover layers, eg. levels as some template (1st main terain, 2nd sprite_1 3th sprite_3) It's bad case to no option to change or manage when many maps and something was in bad case.

Media If applicable, add screenshots or videos to help explain your problem.

Specifications:

  • OS: [e.g. Windows 10]
  • Tiled Version: 1.11.0

Why is this necessary, what is your use for sequential IDs? Layer IDs are a Tiled implementation detail and their specific value shouldn't matter as long as they remain unique within a map. If you are relying on layer IDs for something in your game, that is a mistake - use layer names or custom properties instead.

That said, I do wish Tiled assigned layer IDs sequentially based on the IDs currently in use, rather than always incrementing. This would avoid the need to store "nextlayerid" in map files, and it would prevent the IDs from getting silly large when layers are created and deleted repeatedly. I have some maps with perhaps a dozen layers with IDs in the hundreds if not thousands, and it just feels silly. It's not a "real" problem since, as I said, the IDs should not be treated as static or "important" (and in fact, could be randomised on each save without making them any less useful), but the IDs getting huge does bother me a bit.

Ditto for Objects, which have the same problem. With Objects, the IDs are done the way they are to prevent object references from accidentally referring to the wrong object when the values are changed, but I'd rather see IDs reused and no-longer-valid references cleared.

posted by eishiya 9 months ago

Coz is often fake and bad intuition due names in case code need int ID.. https://github.com/mapeditor/tiled/issues/4018

posted by ManPython 9 months ago

I think You are wrong.. coz .tmx should be like a data base and template, so if you building logic levels eg. 3 similar, then layers should be this same id for each. And when some mistake or something.. accidentally pushed add layer, etc. changing this data structure with no option to manage. I tried manually in file, but then app have problem with this.. as broken - probably I made this in bad way or it not allowing to some changes maybe.

posted by ManPython 9 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests