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

BUG: Tilesets (even embeded ones) are being added to other maps! #2002

Closed
phanxgames opened this Issue Sep 5, 2018 · 12 comments

Comments

Projects
None yet
2 participants
@phanxgames

phanxgames commented Sep 5, 2018

I'm not entirely sure what this issue is, or if it has been fixed. But I have experienced it on version 1.1.4

Basically if I am editing Map_A with an external Tileset_A, and then open Map_B external Tileset_A will be in the tilesets window of Map_B, even though Map_B wasn't suppose to use Tileset_A.
It seems to be based on whatever is in my brush, if my Brush was still on Tileset_A, then it will be moved over into Map_B. But it may occur outside of this as well.
Keep in mind, I am opening up Map_B using the commandline, and not through the GUI.

What makes matters worse is that if I were to save Map_B, it will also add Tileset_A to its .tmx file, even though I never used it to map with.

Thanks!

@bjorn

This comment has been minimized.

Owner

bjorn commented Sep 5, 2018

Basically if I am editing Map_A with an external Tileset_A, and then open Map_B external Tileset_A will be in the tilesets window of Map_B, even though Map_B wasn't suppose to use Tileset_A.

Since Tiled 1.1, tilesets are added to the map automatically when you first use them on a map, and all loaded external tilesets are available on all maps. This was mainly done for convenience, though I understand it makes it harder to make sure you're not using a particular tileset.

What makes matters worse is that if I were to save Map_B, it will also add Tileset_A to its .tmx file, even though I never used it to map with.

This should really only happen when you have actually used the tileset, though at the moment tilesets are not automatically removed from a map when they are no longer used. So when you accidentally placed a tile from a tileset you didn't intend to use, and then erase that tile again, the tileset is still part of the map. You can remove the tileset from the current map by clicking the small button for this below the tileset view.

I wanted to get rid of the manual management of the tilesets referred to by each map and the order in which they do so, because I considered this a tedious and unnecessary process. Instead, especially once Tiled supports projects, I thought it would be much nicer if the Tilesets view simply provides access to all tilesets in your project so you can use them on your maps at will. But maybe I'm wrong?

@phanxgames

This comment has been minimized.

phanxgames commented Sep 5, 2018

Thanks for getting back to me so quickly.

This feature "and all loaded external tilesets are available on all maps" is what I'm reporting. I do not like this functionality. And it breaks things for my workflow; it clutters tileset selector, when we are working on two different maps for example at the same time. Could you please add a config option to disable the "shared tileset" functionality.

Thank you so much for your time!

@phanxgames

This comment has been minimized.

phanxgames commented Sep 7, 2018

I realized I streamed this issue occurring and I decided to rewatch my broadcast to see if I did something wrong to cause this issue. After watching I realized that not only did I not have both maps open at the same time, but the tileset in question was embedded, not even external. This made me realize that what is happening is more than what even you intended (at least based on what you described above). And while I wholeheartedly disagree with your desired feature, there is definitely a bug at play here.
So, I have spent a great deal of time exploring this bug and issue. And I have been able to recreate it consistently!

Steps Recreating the error:

  • Open a map with two embeded tilesets with incorrect image paths. (In my case both tilesets were referencing the same image, if that matters, I am not sure).
  • I fixed only the first of the embeded tilesets, while ignoring the second one (without hitting the ignore button, literally I ignored it.)
  • I now have to edit the .tmx slightly so I can save it as well.
  • Close this map's tmx but keep Tiled open.
  • Note at this point in time nothing is opened in Tiled.
  • Now I open a second map, any map really. Make a small change. Save it.
  • Now if you open the second map's TMX in notepad, it has the Embeded tileset from the first map in it!
  • You don't need to use the embeded tileset in the second map for this to occur.

This is not good! These steps can be followed and it recreates the error each time.

In conclusion:

  • We have ran into this issue several times in the last few weeks without realizing what was going on, simply saying "Wow Tiled sure is more buggy lately."
  • We felt that closing Tiled and reopening it between editing maps fixed the issue, but not really understanding why. Now in light of what you said above, I understand that it has to do with a new feature you added in 1.1.
  • Overall the idea of having tilesets shared between maps just simply doesn't work well if you are working on several maps at once that you don't want the same Tilesets to be shared. It already is hard enough finding the tilesets I am looking for with having the 10 or so tilesets imported for a single map. Now having 20+ tilesets to sort through in the Tileset View is just cumbersome!
  • I don't believe its correct to assume that just because I am opening up several .tmx files at once (Or now in this case of this bug, even separately, at different times) that they are connected in any way.
  • And yes manually deleting the tilesets that get added erroneously is an option, but why should I have to do extra work for a feature that isn't helping me or making my life easier. Hence the reason why I am bringing this issue to your attention.
  • Manual management tilesets is preferred, at least then I am in control of it from the beginning. Adding in this automatic feature, while Tiled has not worked this way for all these years, seems undesirable.
  • Would perhaps downgrading to version 1.0 solve this issue for us? If so, I will give it a try and let you know if the issue occurs even on that version.

Thank you for reading.

@phanxgames phanxgames changed the title from Bug: Tilesets crossing between maps to Tileset Management crossing between maps Sep 8, 2018

@phanxgames phanxgames changed the title from Tileset Management crossing between maps to BUG: Tilesets (even embeded ones) are being added to other maps! Sep 8, 2018

@phanxgames

This comment has been minimized.

phanxgames commented Sep 8, 2018

Just wanted to add:
I tested this with having just one image path incorrect and only one embedded tileset in the first map. And the error was reproducible.

Please see previous post for full details on recreating the error.

I have tested it with Tiled version 1.1.4 and 1.1.6

I just want to add, that I love Tiled. As you know, you have seen my stream. I have been a huge fan of Tiled since it was a Java application. Keep up the great work, and I hope you consider my input on this matter.

Thank you!

@bjorn

This comment has been minimized.

Owner

bjorn commented Sep 8, 2018

I really appreciate your feedback, @phanxgames! Unfortunately I think it's too late to reconsider the general behavior for Tiled 1.2, though of course I will try to reproduce the bug and see if I can fix it.

What I'm unclear about in the steps to reproduce is what change you are making in this step: "Now I open a second map, any map really. Make a small change. Save it.". If the small change means using the current tile stamp on that map, then indeed that will necessarily add the tileset referenced by your tile stamp to the map. But if it's a change that has nothing to do with that tileset, then there must be a bug.

Also, does this bug really only reproduce by starting with a tileset that has a broken image path? Cause that would at least limit exposure to the bug considerably.

Would perhaps downgrading to version 1.0 solve this issue for us? If so, I will give it a try and let you know if the issue occurs even on that version.

Downgrading to Tiled 1.0 should definitely resolve this issue for you. Of course, I will do my best, probably for Tiled 1.3, to get to a workflow that suits you as well. I hope we can keep the automatic adding of tilesets, since it is also simply convenient to capture a brush on one map and use it on another, without first needing to make sure they both reference the needed tileset(s) (in Tiled 1.0, you could do this only using copy/paste, and paste would add those tilesets). But I can definitely see the downsides. Maybe it would help to also automatically remove tileset references (though that's problematic for embedded tilesets, due to possible loss of information), or to provide some way to pin certain tilesets for quickly accessing them. Or some toggle button in the Tilesets view to switch between "all loaded tilesets / tilesets in project" and "tilesets used by current map".

@phanxgames

This comment has been minimized.

phanxgames commented Sep 9, 2018

What I'm unclear about in the steps to reproduce is what change you are making in this step: "Now I open a second map, any map really. Make a small change. Save it.".

This small change would be doing anything to trigger the .tmx to be able to save. In my tests I took an existing, intended external tileset that was already included in the map and added a tile to the map.

Also, does this bug really only reproduce by starting with a tileset that has a broken image path? Cause that would at least limit exposure to the bug considerably.

At this time it does appear that to be the case, however, when working with my team this does occur quite often when maps are passed between our computers and the paths different in our environments. I have tried to limit this by ensuring we are always working with a similar directory structure though.

Maybe it would help to also automatically remove tileset references

I was thinking about this and I believe this could definitely lead to issues for my workflow. Since we often add tilesets and not use them, well in advance.

If you make anything automatic you really should make it so it's optional. Tiled is a great map editor, in fact, the best map editor in the world, because it is highly versatile, customizable and allows you to use it the way you want to use it. It does this job extremely well. Adding in automatic features makes it become not a general purpose map editor but an editor with a specific vision. Which breaks its versatility, which makes it amazing!

I urge you to consider before making any automatic things to make sure they are optional and you don't force people into it.

to provide some way to pin certain tilesets for quickly accessing them

This is a great idea and would make it optional and provide the functionality to people who need it. Love it. The idea of a toggle could also work.

Thank you for your reply, considering everything I have to say, and looking into the bug! You the best.

@bjorn

This comment has been minimized.

Owner

bjorn commented Sep 11, 2018

I tried to reproduce the issue without success. Tried to carefully follow the steps twice but no tileset was getting added to the other map. I think we're missing something, so we need to make the steps more concrete. Can you provide an archive with the two map files that are involved? You can upload ZIP files here by dragging them into your comment.

@phanxgames

This comment has been minimized.

phanxgames commented Sep 11, 2018

I recreated the bug with the most simplest example of files following the steps.
Perhaps my steps aren't as clear as they should be.

But here are the files attached:
tiled bug.zip

Steps:

  • Open mapA.tmx
  • Fix only the first embedded tileset error.
  • Draw one additional tile to the map (from tileset1, also called tilesetA, its green)
  • Save mapA.tmx and close it
  • Open mapB.tmx in the same Tiled instance.
  • Select a tile from the existing tileset from mapB (tileset2, its orange)
  • Draw one tile to the map from that tileset
  • Save mapB.tmx
  • You will notice tileset1 (tilesetA titled) the green one is now embedded to mapB.tmx even tho I never used it on this map. (this the error)
  • mapB.tmx was only supposed to have tilesetB (or tileset2)

These steps are the same as the ones above, just written again, hopefully in a bit more clear manner.

@phanxgames

This comment has been minimized.

phanxgames commented Sep 11, 2018

Let me know if you want me to like record it or something.

@bjorn

This comment has been minimized.

Owner

bjorn commented Sep 11, 2018

I have tested it with Tiled version 1.1.4 and 1.1.6

It's late now so I'll try your latest instructions again tomorrow, but in the meantime, I realized you've only tested it with the current stable version of Tiled, whereas I have so far been trying to reproduce it with the latest development version. Could you please try if the issue still happens for you with the latest snapshot? It's version 2018.08.22 at https://thorbjorn.itch.io/tiled.

@bjorn

This comment has been minimized.

Owner

bjorn commented Sep 12, 2018

@phanxgames With those instructions I could reproduce it, even in the latest development version. I'll have a look at what's going on!

@bjorn bjorn closed this in e99a4fe Sep 12, 2018

@bjorn

This comment has been minimized.

Owner

bjorn commented Sep 12, 2018

Alright, I found a problem in that previously selected stamps could end up affecting the list of tilesets scheduled to be added during painting, which was caused by the list not getting cleared when it should. I think that should resolve this problem, at least in this particular case.

The only way to get tilesets added should be to actually use those tilesets. So in the steps to reproduce, if you do not select an orange tile but paint with the still selected green tile, then the green tileset will still get added to the second map.

That should at least improve the behavior in Tiled 1.2. For Tiled 1.3 we can look into improving the workflow in general, which I think will come along with support for projects.

Thanks for your help in tracking down this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment