sPOiDar / fvtt-module-stream-view

FoundryVTT module that provides a minimal UI view with automated camera work, ideal for streaming or recording games.
MIT License
12 stars 11 forks source link

[bug] Screen flicker when moving actor using Lock View module. #83

Open Oryan77 opened 4 months ago

Oryan77 commented 4 months ago

Describe the bug When using Stream View and the Lock View module together, Stream View (Automatic Camera Mode activated) doesn't seem to like moving an actor token across the map when a map has the option "Bounding Box" selected in the Scene Config setting. When the token moves across a map, the screen flickers. It seems to occur more when dragging/dropping farther distances. This flicker does not seem to occur in Directed or disabled mode.

Adjusting the Camera Animation Duration to a higher value seems to help a little, but the issue still happens most of the time.

To Reproduce Steps to reproduce the behavior:

  1. Activate Stream View and the Lock View modules.
  2. Go to Scene/Configure/Lock View tab
  3. Check "Bounding Box" (everything else can be default)
  4. Set Stream View camera mode to Activated.
  5. Drag a Player token across the screen and drop it. Stream View client screen will flicker.

Expected behavior Screen should not flicker when moving a token.

JavaScript Errors I do not see any errors.

Screenshots Here is a video of the flickering in action: https://drive.google.com/file/d/1wHt7T0IQsrnc85kbSSBY0DWeotH44WSI/view?usp=drive_link

Checklist

Environment (please complete the following information)

Additional context I ran a lot of tests trying to narrow this issue down. I assume it's an issue with Stream View, but I apologize if I'm wrong. The flicker seems to be a conflict of Lock View trying to keep the screen within the Bounding Box and Stream View correcting itself when it's forced to stay within the Bounding Box.

Oryan77 commented 1 month ago

Further testing on this issue has convinced me that the flickering has to do with Stream View always centering a Players actor token on screen when Camera Mode: Automatic is set. I think since the Lock View bounding box limits the map position, having the actor token always trying to center itself is causing the flickering .

Stream View wants to center actor tokens on screen even when Camera Mode: Disabled is activated. Maybe having an option in Stream View to completely disable any kind of token centering would resolve this issue?

sPOiDar commented 1 month ago

I'm not really familiar with the use-cases for Lock View - is the Bounding Box a static value? If so, can you not just set the scene Initial View Position to the same values as you would set in the Bounding Box? Does toggling the Initial View on Camera Disabled setting in Stream View change anything in this interaction?

Oryan77 commented 3 weeks ago

The Bounding Box in Lock View is a static value determined by the size of the Scene Dimensions set in the Grid tab of the Scene Configure window. You don't actually set the dimensions of the Bounding Box; you just check a box to turn it on/off.

I went ahead and set the scene's Initial View Position to the same width/height as the Scene Dimensions with a Zoom of "1". It didn't make a difference and stuttering still happens.

I tried toggling 'Initial View on Camera' but that did not seem to make a difference. It happens when activating Camera Mode: Automatic.

I'm wondering if there is a conflict with Stream View trying to keep all player owned tokens on screen when Bounding Box is active? Stream View will zoom in/out depending on where the token is dragged in order to keep all owned tokens in view on the screen. I realize now that the stutter does not happen if the view does not need to zoom in/out during Camera Mode: Automatic. When I drag the player token far enough across the map where the view needs to zoom out (or back in), I get the stutter as it tries to fit all owned tokens in the view.

Sorry, I thought it had to do with centering a single token, but now I believe it has to do with centering all owned tokens in the screen view.

Oryan77 commented 3 weeks ago

Sorry for the multiple comments, but I want to add that the flickering also happens when Camera Mode: Disabled is activated because Stream View is trying to keep the single moved actor token centered in the screen. So it flickers when Bounding Box is turned on.

It is definitely a 'centering' issue. Is there a way to deactivate "center token" and "center all owned tokens" with Stream View? I don't see that in the settings.

I also realize that it only flickers on the Stream View user login. If I move the token on the Stream View user window, it does not flicker on my GM login window even though it still centers the token on the GM screen. That's because the GM window is not restricted to the Bounding Box. I just wanted to mention that in case it is helpful.