I'm a little worried that a fix for this may cause some previously working tapes to stop working.
That should be technically impossible, as the bugfix does not change how existing tapes are played, but only how new tapes are created.
But of course you will be watching out for that so I should probably suppress that worry.
Yes, I ran my tape test suite after the fix, and the results were the same as before.
I also have a wish, that the engine would somehow be able to detect old tapes made with this flaw and be able to 'upgrade' them to work. That is: I have a number of saved tapes which don't play back successfully, and expect that some are due to this issue.
That may be true, but unfortunately, this kind of problem is impossibe to be fixed afterwards, because there is no way to determine at which frame of the recorded tape actions the "stop snapping" actions would have to be inserted.
For example, I have played a test level in single-step mode with repeated snap actions that solve the level, but result in a broken tape due to the problem described here. Here's a dump of that tape:
Code: Select all
-------------------------------------------------------------------------------
0000: 0:00 [ | ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00000]
0001: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (098) [00001]
0002: 0:00 [ | ] - 1:00 [ | ] - 3:00 [ | ] - (078) [00099]
-------------------------------------------------------------------------------
As you can see, there is a long row of continuous snapping input actions (for 98 frames), and there is no chance to find out at which frames a falling gem was snapped.
After the fix, doing multiple snap actions in single-step mode like before does not work anymore, because the keys for snapping are correctly recognized as "always pressed" by the game engine now; to perform multiple snap actions, the snap key has to be released in a way that the game engine "sees" a non-snapping action for at least one frame. The corresponding tape to solve the level again now looks like this:
Code: Select all
-------------------------------------------------------------------------------
0000: 0:00 [ | ] - 1:00 [ | ] - 3:00 [ | ] - (025) [00000]
0001: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00025]
0002: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00027]
0003: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00028]
0004: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00029]
0005: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00031]
0006: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00032]
0007: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00034]
0008: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (003) [00036]
0009: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (003) [00039]
0010: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00042]
0011: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00044]
0012: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00046]
0013: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00048]
0014: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00049]
0015: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00051]
0016: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00053]
0017: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00055]
0018: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00056]
0019: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00058]
0020: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00060]
0021: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00061]
0022: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00063]
0023: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00065]
0024: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00067]
0025: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00068]
0026: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00070]
0027: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (001) [00072]
0028: 0:12 [ > |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00073]
0029: 0:10 [ |1 ] - 1:00 [ | ] - 3:00 [ | ] - (002) [00075]
0030: 0:00 [ | ] - 1:00 [ | ] - 3:00 [ | ] - (005) [00077]
-------------------------------------------------------------------------------
As can be seen, these snap actions have to be interrupted by a non-snapping input action for at least one frame (where the snap key is still pressed here, but the "right direction" action was released for at least one frame, so a new snap action is started when that key is pressed again).