mapeditor/tiled

Do you want to work on this issue?

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

Automapping - Backtracking after placing Object #3471

MisterMeme95 posted onGitHub

Describe the bug As the title suggests, the issue is in referencing to using Objects in an an automapping rule TMX. For tiles, whenever an error is made, I can easily press "Ctrl+Z" to undo any combination. This is done seamlessly, and automatically reverts back to the state it was before any additional tiles had been painted AND any rules were applied.

This doesn't happen with objects.

When an object is part of automapping output, when you try to undo a paint, it doesn't immediately go back to the appropriate state. Instead, it may take 2-3 uses of undo, similar to how the original automapping (before 1.9) would work.

Small bug, but something worth noting nonetheless.

To Reproduce Steps to reproduce the behavior:

  1. Create an automapping with an input/output rule for tiles.
  2. On top of the output for a tile, add an additional output for a specific object.
  3. Implement the rule on an actual map.
  4. Press the Undo command.
  5. See the error.

Expected behavior Press Ctrl+Z should undo any painting done by the rule set.

Media Image 1 Rule applied Attempt to Undo. Specifications:

  • OS: Windows 11
  • Tiled Version: 1.91

Are you talking about Automap While Drawing? The Automap action correctly groups both tile and object edits into one Undo.

Automap While Drawing does not merge all the Automapping into a single event, instead it relies on merging like events to produce a single Undo for the entire paint action (manual painting + Automapping), which is what allows the Automapping to merge with painting (and why normally you get just a single "Paint" event, with no "Apply AutoMap Rules" events). Hopefully these different actions aren't so dissimilar that they can't be merged at all (merging them the same was as for the Automap action would probably not work, as that would probably just bring back the old behaviour of an Automapping undo after every painted tile).

posted by eishiya over 2 years ago

Automap while drawing merges all Automapping into 1 event when I'm not including an object into the equation.

posted by MisterMeme95 over 2 years ago

Unfortunately the undo commands for adding or removing objects currently prevent the Automapping undo commands from merging. For this, the AddMapObjects and RemoveMapObjects commands would need to implement the ClonableUndoCommand interface.

posted by bjorn over 2 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests