Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low physics FPS makes mouse wheel scrolling in GDScript inoperable after restarting the Editor #28385

Open
lukas-durica opened this issue Apr 24, 2019 · 12 comments

Comments

@lukas-durica
Copy link

lukas-durica commented Apr 24, 2019

Godot version:

Godot 3.1

OS/device including version:

NVIDIA GeForce GTX 1070

Issue description:

Higher Physics (tested with 700, but the number may be lower) FPS makes mouse wheel scrolling in GDScript inoperable after restarting the Editor

Steps to reproduce:
Create a new project
Project Settings > Physics > Common >Physics Fps > 700
Restart the Editor
Create new GDScript
Move cursor down, so you can scroll the script with the mouse wheel
But actually, you can't

Bugsquad edit (keywords for easier searching): mousewheel

@Calinou
Copy link
Member

Calinou commented Apr 24, 2019

As a workaround, try disabling Text Editor → Open Scripts → Smooth Scrolling in the Editor Settings.

@jamie-pate
Copy link
Contributor

jamie-pate commented Apr 25, 2019

This also affects OSX trackpads with normal Physics FPS speed?
You need to swipe really fast for scrolling to work, I suspect it's rounding the delta values down to 0.

Related? #28369

@Calinou Calinou added this to the 4.0 milestone Apr 16, 2020
Calinou added a commit to Calinou/godot that referenced this issue Oct 10, 2020
Fixing this bug doesn't appear to be trivial, so disabling
by default should alleviate the issue for now.

The way the current smooth scrolling algorithm works isn't really
conductive to a good user experience anyway.

This partially addresses godotengine#28385.
@Calinou
Copy link
Member

Calinou commented Jan 14, 2023

I can't reproduce this on 4.0.beta12 (Linux, using standard mouse wheel and 100% editor scale).

Physics FPS (now Physics Ticks per Second in the advanced Project Settings) does affect mouse wheel scrolling smoothness, but it still works when set to 240 or even 1000.

I can still reproduce this on 3.5.1, but only with Physics FPS set to 1000. Scrolling still works correctly with Physics FPS set to 240, which is likely the highest practical value you'll use in a real world project.

@Zireael07
Copy link
Contributor

@Calinou Can physics fps be limited to 300 or so to prevent people setting humongous values (I dimly recall some other things breaking with values like 800 or 1000)

@reduz
Copy link
Member

reduz commented Jan 14, 2023

I can't reproduce either.

@Calinou
Copy link
Member

Calinou commented Jan 15, 2023

@Calinou Can physics fps be limited to 300 or so to prevent people setting humongous values (I dimly recall some other things breaking with values like 800 or 1000)

Very high physics FPS values can make sense for simulation racing games (fast cars need high physics FPS to remain stable), but I agree there's little reason in going past 300, even for most simulation racing games.

Regarding things breaking with very high values, this can be resolved in 4.0 now that godotengine/godot-proposals#1893 is implemented there (it can be redone for 3.x too).

@KoBeWi
Copy link
Member

KoBeWi commented Feb 20, 2023

Also can't reproduce.

@KoBeWi KoBeWi closed this as completed Feb 20, 2023
@Calinou
Copy link
Member

Calinou commented Oct 6, 2023

Reopening, as I can reproduce this with lower physics ticks per second values (such as 1) in 4.2.dev6.

The underlying cause is the same as the previous issue with high physics FPS. Smooth scrolling shouldn't occur on physics step, but on process step (formerly idle step). This will also make it look smoother on high refresh rate monitors.

@Calinou Calinou reopened this Oct 6, 2023
@Calinou Calinou removed this from the 4.0 milestone Oct 6, 2023
@Calinou Calinou changed the title Higher Physics FPS makes mouse wheel scrolling in GDScript inoperable after restarting the Editor Low physics FPS makes mouse wheel scrolling in GDScript inoperable after restarting the Editor Oct 6, 2023
@DJKero
Copy link

DJKero commented Feb 13, 2024

@Calinou Can physics fps be limited to 300 or so to prevent people setting humongous values (I dimly recall some other things breaking with values like 800 or 1000)

Very high physics FPS values can make sense for simulation racing games (fast cars need high physics FPS to remain stable), but I agree there's little reason in going past 300, even for most simulation racing games.

Regarding things breaking with very high values, this can be resolved in 4.0 now that godotengine/godot-proposals#1893 is implemented there (it can be redone for 3.x too).

It depends on the type of game and the requirements of the project, but 1000hz can be nice to have so putting a hard cap before 1000 could be cumbersome for some projects in my opinion.

@Calinou
Copy link
Member

Calinou commented Feb 14, 2024

It depends on the type of game and the requirements of the project, but 1000hz can be nice to have so putting a hard cap before 1000 could be cumbersome for some projects in my opinion.

Godot can't clamp the mouse polling rate - it's decided by the OS. Also, I wasn't referring to dropping the polling rate below 1,000 Hz, but rather dropping it from a value above 1,000 Hz back to 1,000 Hz. Some modern mice can go up to 8,000 Hz, which uses a lot of CPU for little benefit (unless your display is 360 Hz or more). The sweet spot for 240 Hz display users is typically 2,000 Hz for instance, as this does reduce jitter measurably compared to 1,000 Hz on those displays.

@DJKero
Copy link

DJKero commented Feb 15, 2024

The sweet spot for 240 Hz display users is typically 2,000 Hz for instance, as this does reduce jitter measurably compared to 1,000 Hz on those displays.

Oh I didn't knew about that, it's good to know, do you have any resource that talks about the topic?
About this issue it is exactly what I was experiencing with my project, I did change the physics fps to default and restarted the editor and it works smoothly.

The underlying cause is the same as the previous issue with high physics FPS. Smooth scrolling shouldn't occur on physics step, but on process step (formerly idle step). This will also make it look smoother on high refresh rate monitors.

Is this happening in scene/gui/scroll_bar.cpp?

@Calinou
Copy link
Member

Calinou commented Feb 17, 2024

Oh I didn't knew about that, it's good to know, do you have any resource that talks about the topic?

BlurBusters has extensively researched this topic: https://forums.blurbusters.com/viewtopic.php?f=7&t=9785

Is this happening in scene/gui/scroll_bar.cpp?

Smooth scrolling is implemented in TextEdit (scene/gui/text_edit.cpp) which relies on ScrollBar. However, ScrollBar's implementation isn't exposed to scripting, so the only way to use it is currently in TextEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants