Automapping works just once


(A E) #1

Hey,
first of all, thank you for Tiled! My favourite feature is the automapper. It works really well, but when I change the rules.txt while working in Tiled, the automapping feature seems to be disabled. Even if I change the txt contents to something invalid or if I delete the rules.txt, there’s no errormessage popping up. When I restart Tiled and put in the new rules.txt , it just works again.

Is that a common bug?

Here’s my workflow:
Rule1 brings me from this


to that

Rule 2 replaces those tiles and applies some variation

R1


R2

Keep up the good work.

~Monsaic

PS: I’m using Tiled 0.11
PS2: I can only embed 2 images.


(Stefan Beller) #2

It’s been a long time I wrote that Automapping tool, so I forgot about the details.

which operating system do you use?


(Thorbjørn Lindeijer) #3

I raised your trust level, please see if you can include more images in your post now.


(A E) #4

Thanks for your replies!
@bjorn Yep, I can embed all the images now, thanks!
@Stefan_Beller My operating system is Windows 8. I really love that feature and it’s a pity that I have to restart tiled everytime I change the rules.


(Les) #5

This still seems to be an issue. I tried to find it in issues at Git repository but it is not there.
Is there any info about this?
I am using Win. 08, and the latest version of Tiled as per a week ago.
Edit:
This is also a problem with setting a tile probability. The change does not affect the paint bucket random unless you close Tiled and then reopen it again.
Version 1.1.6


(A E) #6

Since the links don’t seem to be working anymore -> I think these are the screenshots I took:

The steps:


The rules:

Best regards

Monsaic


(Thorbjørn Lindeijer) #7

This should be entirely unrelated to whatever problem is affecting the automapping. The probabilities are recalculated when the tile stamp changes, so after changing the tile probability it should be enough to re-select the tile stamp.

Hmm, I don’t see any reason why the automapping rules would work just once. Are you sure that’s what’s happening? What I do see in the code, is that the rules.txt file is only loaded once and not automatically reloaded when it changes (nor are any of the rule maps). The rules are cleared when another map is selected though, and then loaded again upon the first use of the automapping feature.

Yeah, it’s annoying the old images disappeared. I’m in contact with Discourse support and hope they’ll be able to restore them from an old backup. It’s impressive that you are able to relocate the images you uploaded three years ago!


(Les) #8

Thanks for replying Bjorn.
You are correct regarding the probabilities property. Here is why I thought it might be the same issue:
I select two tiles and the paint tool and random. I can see even(ish) number of the two tiles. I edit the tileset and change one of the tiles probability to very low. Then I go back to my map and despite the tile showing the probability, it does not change the dispersment.
To see the new dispersment, you do have to reselect the tile and thats really not a problem.

In order to reproduce the automap issue:

  1. create a new tile map
  2. create a rule for that tile map and test it to make sure it works.
  3. without closing tiled go into the rules.txt and comment out all the rules.
  4. test automap again, and you will see that the rules are applied same as in step 2 despite commenting them out.
    Note that you can even completely remove rules.txt and the rules are still applied.

Tiled is fantastic and thanks for looking at this.


(Thorbjørn Lindeijer) #9

I guess it’s not really a problem once you know how to work around it. I’ll look into fixing it anyway since it should just work. The probabilities are cached by the tool, which means it should invalidate the cache when a probability is changed.

Right, note that you’re not switching maps anywhere in your steps, which is why the rules.txt file is not getting reloaded.

So another issue that’s easy to work around once you what’s going on, but again I’ll want to look into fixing this. It should probably do a quick check on the timestamp of the rules.txt file, and reload it when it’s different from last time automapping was triggered. I hope that will be fast enough even when “Automap While Drawing” is enabled.


(Les) #10

Ok thanks. I get it now and it does work by re-selecting the map.
That is easy enough.

I will add a feature request:
Automapping is essentially a smart mask or logical masking. It seems like it would be even more useful if you made it a ‘pen’ or stamp type tool instead of affecting the entire map. The user would design the rule much the same as you have it now and then apply the rule using the mouse and selecting locations on the tile map.


(Thorbjørn Lindeijer) #11

While there is no tool for doing this, you can select some area using any of the selection tools and then press A to apply automapping to that area. This was suggested here and works since Tiled 1.1.4.

In addition you can of course enable “AutoMap While Drawing”, so rules are re-applied in areas you modify with any tool.