[GH-ISSUE #1022] [Bug]: Bug in "Zoom camera in and out with scroll" #536

Closed
opened 2026-03-03 18:58:41 +03:00 by kerem · 6 comments
Owner

Originally created by @JiuZ-Chn on GitHub (Jun 30, 2023).
Original GitHub issue: https://github.com/PlayCover/PlayCover/issues/1022

I find that there's bug in this feature https://github.com/PlayCover/PlayTools/pull/73 for our beta version.

I try this in the game by this step:

  1. Zoom in the camera
  2. The game shows the network error
  3. The game meets bug like here:
    image

Describe the solution you'd like

Want bug fix in the new feature. At least a switch button to disable it.
Maybe this feature works on some games, it helps some player.

Anything else?

No

Issue Language

  • Yes my issue is written in English
Originally created by @JiuZ-Chn on GitHub (Jun 30, 2023). Original GitHub issue: https://github.com/PlayCover/PlayCover/issues/1022 ### Is your feature request related to a problem? I find that there's bug in this feature https://github.com/PlayCover/PlayTools/pull/73 for our beta version. I try this in the game by this step: 1. Zoom in the camera 2. The game shows the network error 3. The game meets bug like here: <img width="1038" alt="image" src="https://github.com/PlayCover/PlayCover/assets/21299239/25a1d34a-538d-4463-8d03-9a085534a908"> ### Describe the solution you'd like Want bug fix in the new feature. At least a switch button to disable it. Maybe this feature works on some games, it helps some player. ### Anything else? No ### Issue Language - [X] Yes my issue is written in English
kerem 2026-03-03 18:58:41 +03:00
Author
Owner

@JiuZ-Chn commented on GitHub (Jun 30, 2023):

@XuYicong Could you please help on this?

<!-- gh-comment-id:1614415525 --> @JiuZ-Chn commented on GitHub (Jun 30, 2023): @XuYicong Could you please help on this?
Author
Owner

@XuYicong commented on GitHub (Jun 30, 2023):

I suspect that the cause is the mouse poll rate too high, causing playcover sending too many touch events and crashing some critical game threads. But I am not sure if there are other causes.

<!-- gh-comment-id:1614420721 --> @XuYicong commented on GitHub (Jun 30, 2023): I suspect that the cause is the mouse poll rate too high, causing playcover sending too many touch events and crashing some critical game threads. But I am not sure if there are other causes.
Author
Owner

@JiuZ-Chn commented on GitHub (Jun 30, 2023):

This issue occurs when I zoom in/out to the maximum, If I just zoom in/out a little, there's no bug on it.

<!-- gh-comment-id:1614431549 --> @JiuZ-Chn commented on GitHub (Jun 30, 2023): This issue occurs when I zoom in/out to the maximum, If I just zoom in/out a little, there's no bug on it.
Author
Owner

@JiuZ-Chn commented on GitHub (Jul 15, 2023):

@XuYicong 这个视角问题可以通过禁用鼠标选项中的滚动时使用惯性来避免,或许是因为这个惯性的机制导致发了过多的信号给PlayCover。但是是否可以在PlayCover端进行修复呢?
image

<!-- gh-comment-id:1636683707 --> @JiuZ-Chn commented on GitHub (Jul 15, 2023): @XuYicong 这个视角问题可以通过禁用鼠标选项中的滚动时使用惯性来避免,或许是因为这个惯性的机制导致发了过多的信号给PlayCover。但是是否可以在PlayCover端进行修复呢? <img width="466" alt="image" src="https://github.com/PlayCover/PlayCover/assets/21299239/9fa748ce-c5f3-4c50-a3ad-e9044cba637a">
Author
Owner

@XuYicong commented on GitHub (Jul 15, 2023):

不确定原因是不是事件频率的问题,如果是的话理论上能修,可以跳过一些高频事件不处理。但也可能是其他原因,比如这个惯性导致的事件有一些特殊性质什么的。但我最近两个月事情比较多,这边只能鸽一鸽了orz

<!-- gh-comment-id:1636730953 --> @XuYicong commented on GitHub (Jul 15, 2023): 不确定原因是不是事件频率的问题,如果是的话理论上能修,可以跳过一些高频事件不处理。但也可能是其他原因,比如这个惯性导致的事件有一些特殊性质什么的。但我最近两个月事情比较多,这边只能鸽一鸽了orz
Author
Owner

@XuYicong commented on GitHub (Jun 3, 2024):

I think I found the cause of this. It's because the touch point coordinates become extremely large and eventually crashes Genshin's camera system.

When implementing the scaling, two touch points are used to simulate a pinch gesture. When zooming in, they move apart from each other; when zooming out, they move towards each other. Due to some stupid design choice of myself, the moving speed of the two points would decrease exponentially when zooming out, and INCREASE EXPONENTIALLY when zooming in.

That would lead to touch point coordinates increase to an unbelievable large number in a really short time. As large as 1e17, which is 100000000000000000 (1 followed by 17 zeros). Based on testing, when this number increases above 1e19, this issue would occur. FYI, the largest number a signed 64-bit integer can represent is roughly 9e18. That coordinate must be overflowing some 64-bit integer somewhere inside the system.

"distance" in the following image means the distance between the two touch points.

图片

<!-- gh-comment-id:2144677259 --> @XuYicong commented on GitHub (Jun 3, 2024): I think I found the cause of this. It's because the touch point coordinates become extremely large and eventually crashes Genshin's camera system. When implementing the scaling, two touch points are used to simulate a pinch gesture. When zooming in, they move apart from each other; when zooming out, they move towards each other. Due to some stupid design choice of myself, the moving speed of the two points would decrease exponentially when zooming out, and INCREASE EXPONENTIALLY when zooming in. That would lead to touch point coordinates increase to an unbelievable large number in a really short time. As large as 1e17, which is 100000000000000000 (1 followed by 17 zeros). Based on testing, when this number increases above 1e19, this issue would occur. FYI, the largest number a signed 64-bit integer can represent is roughly 9e18. That coordinate must be overflowing some 64-bit integer somewhere inside the system. "distance" in the following image means the distance between the two touch points. ![图片](https://github.com/PlayCover/PlayCover/assets/16048758/fd3f037d-4e3f-4492-8f1f-443609151159)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PlayCover#536
No description provided.