no content undo!

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

no content undo!

Post by filbo »

In level editor, click on yamyam, Properties, Config. Change one of the contents when smashed. Hit Undo or Ctrl+Z -- UNDO BUFFER EMPTY!

ESC out to the main editor menu, hit Undo or Ctrl+Z -- UNDO BUFFER EMPTY!

Verified also for: magic ball; amoeba; android; presumably any other containing-elements that I've forgotten.

This is on an EMC level, might behave differently with RnD or other level types?
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: no content undo!

Post by Eizzoux »

Well, it's probably because the buffer remembers the level layout changes and not individual element setting changes, but I'd agree that this might be... a little bit frustrating, but that's somewhat common thing with most of the game editors in general.
𒈟
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: no content undo!

Post by filbo »

Yeah, but Holger's work is better than everyone else's in all other dimensions, why should it be behind in this one? :)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: no content undo!

Post by Holger »

Yeah, but Holger's work is better than everyone else's in all other dimensions, why should it be behind in this one? :)
Thank you. :wink: In fact, the current undo/redo system in the level editor is limited to just the playfield, but I see that this can easily misunderstood as potentially also covering all other aspects of the editor that change properties of the level.

Extending the undo system to other "playfield-like areas" (like yamyam content etc.) would be possible, yes. And it could also be extended to elements like text input fields, select boxes, check boxes etc. etc.; the easiest way to implement this would probably be to make a "snapshot" of the whole level data in memory (including all properties of the level) and just play it back (and forth) when using "undo" (and "redo"). This would eat up quite some memory, of course, depending on how many steps should be rolled back using "undo".

But I see some usability problems. Imagine the following: You make some changes to the playfield, then some changes to some CEs, some more changes to another CE, even more changes to the playfield. OK. Then, being on the "playfield" screen, you think that you would like to undo some of the changes you did there. So you press "undo" several times until you're happy. But you noticed that, while pressing "undo" several times, on some clicks nothing happened -- that was when your "undo" rolled back changes you did elsewhere (like on some CE properties pages), and you did not want to rollback these changes on CEs, but just those on the playfield.

So, it would be possible to only use the "undo" snapshots that match the screen you're currently on (using only the playfield changes when pressing "undo" while on the playfield screen). But your intention might indeed be: Undo *all* changes you did since some state, including changes to CEs you did since then.

So this seems to be quite complicated to "do it right" (and I'm speaking just of the logic behind such an extended undo, not the technical complications that might come up when implementing it).

That's mainly the reason why "undo/redo" is currently limited to the playfield.

But of course I will be happy to hear your thoughts on this! Maybe it is indeed possible to improve the current "undo/redo"! :-)
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: no content undo!

Post by filbo »

It could be 'snapshot of everything'. Or it could be 'statement of logical operation', like:

1 [x] change [4,10] from yamyam to sand
2 [x] change yamyam-4 content [0,1] from blank to dynamite
3 [x] change CE-12 [ whatever change ]
etc.

Then it takes up very little memory.

Undo could be linear: you hit undo, a thing is undone; if that thing was in a sub-screen (editing yamyam content or whatever), display shifts to that sub-screen so it's more obvious what changed, or at least the general nature of what changed. It could also be 'animated' like: flip from current screen to yamyam content screen, have an animated sequence that 'focuses in on' the field to change, then change it. But I think that would be painful to use.

OR: click 'undo', see a table of numbered changes, like above. Be able to scroll to and individually undo those changes in any order that makes sense. A possible UI for that would be as shown above: individual toggles for each change. So you just unclick the '1 [x]' to change [4,10] back to yamyam. Such unchecked items remain in the undo log, so you can go back in to [x] redo them.

This is of course a bit complex to do. You would need an internal symbolic representation of 'things that were done', with enough change-specific context info to be able to both undo and redo them. And some changes might not make sense to undo out of order:

1 [x] change [4,10] from yamyam to sand
2 [x] change yamyam-4 content [0,1] from blank to dynamite
3 [x] change [4,10] from sand to spaceship

-- what does it mean to 'undo' #1 when #3 already overwrote its effect? Would it automatically also mark #3 as undone? Or refuse to undo, because its precondition ([4,10] is sand) is false?

Undo 'records' for things like painting an element all over the place with a single large 'draw' or 'draw connected' operation might be hard to express.

=====

Seems likely that a strictly linear undo/redo facility would be easier. If each record is a snapshot of the entire level state, and also has an idea of where the specific change occurs -- you could flip to the particular sub-screen and at least highlight the changed field. When going backwards (undo) you flip to the screen the change occurred on. When going forwards (redo), you also do. But this means that a sequence of [undo, redo] -- i.e. no effect -- flips you to the sub-screen on which the previous change occurred, and then stays there. Which means you can easily see what the change was, by doing undo-redo-undo to manually 'twinkle' the changed thing.

Or even better -- I just noticed the editor feature in which holding down <Alt> causes all instances of drawing element #1 to highlight (? is that a recent enhancement?). After an undo or redo, you're looking at the sub-screen where that change occurred. Holding down <Alt> should highlight the changed field and toggle it to the before-[undo/redo] change; releasing <Alt> un-highlights and restores it to the 'current' value. So this is a quick reference for 'show me what that undo/redo did?'

(Maybe not <Alt> since it then becomes ambiguous whether this means 'show undo/redo effect' or 'show drawing element 1'. Maybe <Alt-U>/<Alt-Shift-U> for 'switch to sub-screen if necessary, then show what would change if I did undo/redo' ? Releasing <Alt> would flip back to previously viewed sub-screen; a sequence of <Alt+U><release U, still holding Alt><time passes><release Alt> would let you view the proposed undo for as long as you wanted.)

=====

So there's one way you could have fully user-controlled undo (but a lot of work to get right), or another way you could have linear undo/redo but with enough user control to really see what was going on (and I think a lot less work...)
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: no content undo!

Post by filbo »

Small enhancement suggestion re: <Alt>:

When holding down <Alt> to highlight drawing element #1, please (1) also highlight it in the elements list; (2) display its name in the same place the name is displayed when hovering an element in the elements list.

Noticed when I was looking at a level with 3x types of yamyam ('starts moving left' / 'up' / 'down'). All look identical on-screen. Clicking one in the elements list, then hitting <Alt>, I can see which of the elements within the level are that particular sort of yamyam. But if I want to survey them one by one, it's helpful to have a visual cue in the elements tray so I easily see which is 'next'. (For consistency, I recommend it should light up all instances: within the playfield; within the tray, including twice in the probably-unlikely case where it's visible in both 'Use' and its original section at the same time; and in the 'drawing element 1' displaycase itself.)

Also: is there a key sequence to highlight drawing elements 2 or 3? I didn't find one. I half-expected that hitting <Alt+2> would highlight 2nd drawing element, but instead it switched to drawing element 2 properties (as if hitting just <2>).
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: no content undo!

Post by filbo »

Ah, I see 'added highlighting of drawing element in editor when pressing "Alt" key' 2020-10-30, so yeah it's 7.5 months 'new', hardly an eyeblink ago...
Post Reply