mclemente / about-face

FoundryVTT Module to rotate tokens on move
Other
7 stars 8 forks source link

support step back without changing face #25

Closed josmardias closed 2 years ago

josmardias commented 2 years ago

I would like to use this module but not being able to skip the change direction is kind of painful.

My table use vision angle 180º and move points rules, so being able to step back without changing facing is important for us. With the "auto face change" of this module the token vision would reveal enemy positioning on it's back.

So for this I have these ideas (I prefer 2)):

1) Detect step back and not change the token face For both square and hex boards, there is a position that is 180º from the current face. In this case just make the movement without changing the token face. Make this configurable for backwards compatibility.

2) Detect step back and sideways Same as 1) but also detect a sideways movement. For a square board it's more simple bc there is only step back and sideways, on both cases just don't change token face. For a hex board is a bit more complicated. Here's how GURPS solve it: image In this case I would say back/left/right shouldn't change face.

3) Suport a hot key to disable change face for that movement

mclemente commented 2 years ago

Update and check out the new Step Back setting, it's an implementation of Idea 1. Idea 2 is obviously the best choice, but I need more time to test it out since I need to take into account two other spaces instead of just the last position.

josmardias commented 2 years ago

Thanks for the quick reply.

So, I just tested the Step Back setting and it's not accurate to my description of 1). The Step Back setting is not exactly what I'm expecting. It works for most cases, but not for the general case.

Here's a step by step of what the module is doing:

My expectation was to keep face if and only if the movement is 180º with the current face, doesn't matter the last position.

I can take a look at the code to see what I can do if you're ok with the current state of Step Back. I tried it before but it was on the previous repo (eadorin/about-face), it took me some time to figure I was not looking at the right one.

mclemente commented 2 years ago

This was one the issues with the implementation. If you're going to use SHIFT + direction key, you might as well use it again when moving back into the last position.

The problem with figuring out the 3 squares/hexes behind is that the logic is different for Squares, Hex Rows and Hex Columns. Squares is obviously the easiest, but there's no point implementing that feature just for one grid type.

If you figure out how do to it on Hex Rows I can make it work for squares and columns.

Some help:

josmardias commented 2 years ago

I'll take a look into it.

Btw, I don't think we need to figure out the 3 hexes behind, just 1.

At least for GURPS there is one 1 real behind, the other 2 are considered left and right (take a look at the image I posted previously). I know, in that post I said that we shouldn't change face also for left and right, but I'm reconsidering.

josmardias commented 2 years ago

Actually I think we need more input on this.

I can see it working on my table (just back, not left and right), but I wonder how other people playing on hex board feel about this.

josmardias commented 2 years ago

So, I talked to some friends. They said: it's better to simplify and just have a hot key to enable face change for that movement only.

In other words, a movement would never change face. A movement holding SHIFT would always change face.

This makes sense to me, and we don't need to calculate Front/Left/Right/Back anymore

What you think?

josmardias commented 2 years ago

Just opened PR #26 that adds a setting to make auto rotation opt in per movement. That's enough for my table. I hope it works for you and the rest of the community :smile:

I already have it on my local install and I'll start using in my next session (8 hours from now).

Thanks @mclemente, we can move the discussion to that PR if there is something else in your mind.

josmardias commented 2 years ago

I'm reopening this issue because the current implementation doesn't match any of the suggested options.

mclemente commented 2 years ago

In other words, a movement would never change face. A movement holding SHIFT would always change face.

You have found out the modifier keys don't work at all. It was the first solution I've tried and this issue would've been resolved on the same day.

Just opened PR #26 that adds a setting to make auto rotation opt in per movement.

Your PR would make it so there would be two settings for a single feature. Even if I removed the Step Back setting and left yours, it would be hard-coded to Z, which would clash with the AZERTY layout and wouldn't be good for the QWERTZ layout either.

Also, there might be games where disabling the rotation entirely is just as important as disabling it for a single movement. And for that, Z isn't a good key to be held while pressing WASD.

I'm reopening this issue because the current implementation doesn't match any of the suggested options.

The setting was removed in favor of the Toggle Token Rotation keybinding, which serves the same purpose and gives more control to users when to not rotate their tokens.

josmardias commented 2 years ago

We need a feedback on screen to know the current toggle state. That's one of the main pain points on the current implementation.

mclemente commented 2 years ago

You get a notification when you toggle it.

Your players aren't seeing this? image

Also, I'm fixing the tooltip so both say "Rotation".

josmardias commented 2 years ago

Hum, maybe they were complaining about not knowing the current state without toggling it. But if there is this notification I think it's ok.

Btw I'm not using this feature anymore, I'm playing with my local install reverted to my changes from that PR. My players prefer to either use "z" + mouse drag for auto rotation or SHIFT scroll + WASD for manual.