Alternating between TAS snap keys lets you move

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

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 153
Joined: Thu Jul 12, 2018 12:59 am

Alternating between TAS snap keys lets you move

Post by ncrecc »

Hold any snap key (e.g. snap left), then hold a second snap key (e.g. snap down) while still holding down the first snap key. Once you stop holding down either one of the snap keys, you'll walk in the direction of whichever snap key you're still holding down.
Image
^ This gif doesn't really do justice, just try out the instructions above by yourself and you'll see what I mean.
(Also note that I'm referring to the "TAS SNAP KEYS" available in the "KEY SHORTCUTS" section of the Setup menu, not just regular snapping performed by holding the singular "snap field" key and pressing any direction.)
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: Alternating between TAS snap keys lets you move

Post by Eizzoux »

There already exists topic just about that
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Alternating between TAS snap keys lets you move

Post by Holger »

Yes, I can confirm this behaviour. It is more or less "by intention", although I can see that this may result in unwanted behaviour.

The reason is that TAS snap keys act just like pressing or releasing two keys at the same time (snap key + direction key). So, when pressing, for example, "TAS snap left", the bits for "snap" and "left" are set for player actions. When pressing "TAS snap up" now (while still holding the first TAS snap key pressed), the bits for "snap" and "up" are set (while the bit for "snap" is already yet). All fine so far. Now, one of the two TAS snap keys is released. This will cause the bits for "snap" and one of the directions to be unset. But there is still another direction bit set now, with no snap bit set -- this is now a simple direction action, and the player will move accordingly!

When pressing TAS snap keys very fast, it may therefore happen that two TAS snap keys will be in "pressed down" state at the same time, causing the above problem when releasing one of them without releasing the other(s) at the exact same time.

This could probably be fixed by storing which TAS snap buttons are currently pressed (instead of just setting and unsetting the corresponding bits in the player actions).
There already exists topic just about that
This was a different problem (well, bug), which resulted in sometimes moving the player while only pressing and releasing one single TAS snap key very fast, which cannot happen (anymore) in the above scenario.
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Alternating between TAS snap keys lets you move

Post by filbo »

In my inputs to that other thread, I think I was in fact describing this issue raised by ncrecc, but my description was less clearly understandable.

The proposed solution of storing which TAS keys are currently being held down, and releasing the 'virtual snap' key only when all of them are released, seems correct to me.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Alternating between TAS snap keys lets you move

Post by Holger »

The proposed solution of storing which TAS keys are currently being held down, and releasing the 'virtual snap' key only when all of them are released, seems correct to me.
I have implemented it now that way (not pushed yet, though), and it seems to work fine.
Post Reply