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

Input accumulation is off by default but the documentation states it is on by default #55037

Closed
m4nu3lf opened this issue Nov 16, 2021 · 8 comments

Comments

@m4nu3lf
Copy link
Contributor

m4nu3lf commented Nov 16, 2021

Godot version

da5c843

System information

OS: Arch Linux, CPU: Ryzen 5, GUP: RX 480

Issue description

The documentation states that input accumulation is enabled by default, but I'm pretty sure it isn't. I get many InputMouseMotion events every frame unless I explicitly call Input.set_use_accumualted_input(true).

Should we change the docs or the implementation?

Steps to reproduce

Create a scene with a node and attach a script. Add something like this:

func _input(event: InputEvent) -> void:
  if event is InputEventMouseMotion:
     print(Engine.get_drawn_frames())

You should see the same frame number show up multiple times.

@Calinou
Copy link
Member

Calinou commented Nov 16, 2021

I'm pretty sure input accumulation is supposed to be enabled by default. I wonder if #42220 changed anything in this regard. Can you reproduce this in 3.3.4?

@Calinou Calinou added this to the 3.4 milestone Nov 16, 2021
@m4nu3lf
Copy link
Contributor Author

m4nu3lf commented Nov 17, 2021

I can reproduce it with the latest commit 4508878
This is the code:

extends Spatial

func _ready() -> void:
	Input.set_use_accumulated_input(true)

func _input(event) -> void:
	if event is InputEventMouseMotion:
		print(Engine.get_frames_drawn())

Try to comment/uncomment the _ready() method to see the issue.

@Calinou
Copy link
Member

Calinou commented Nov 18, 2021

See also #54066.

@akien-mga
Copy link
Member

main/input_default.cpp has use_input_accumulation set to false, so it's indeed disabled by default. It used to be true but this was changed in #42220. It is however enabled by default in the editor (editor/editor_node.cpp sets it on).

I don't know if making it off-by-default was intentional. If so, maybe the documentation simply needs to be updated. What part of the documentation says that it's enabled by default?

@RandomShaper
Copy link
Member

I think that disabling it was not intentional. I've checked the code and can't find a reason why I changed that to false. However, at this point I'm not sure what the best action would be. Maybe consider it was just changed for 3.5 and just document it indeed?

@akien-mga
Copy link
Member

Yeah given that this was changed in 3.4, users are now used to the new default value, even if it wasn't intended. So I would keep it as is in 3.5, it's too late now to revert back (there might be bugs with input accumulation that we haven't caught during beta phase due to it being off by default).

So documenting it should be enough indeed. We could consider turning it back on for 3.6 with some extensive testing.

akien-mga added a commit to akien-mga/godot that referenced this issue Jul 3, 2022
This was actually disabled by mistake in 3.4 causing a regression, but since
this issue survived the whole 3.4.x series and it's now very close to 3.5,
it's too late to change it again.

We might consider it for 3.6 after some beta testing.

Fixes godotengine#55037.
@akien-mga
Copy link
Member

akien-mga commented Jul 7, 2022

Given the amount of regression reports we got which ended up due to input accumulation being mistakenly turned off in 3.4, I've been thinking about turning it back on for 3.5, even if it's quite late to do so now as discussed above.

Notably:

We'll have 3.5 RC 6 to try it out, which should have at least 10 days of testing as I'll be away on holiday :)
So we can assess whether testers seem to be fine with the change or not. And then eventually either flip it back to false if we find new issues with input accumulation and prefer to go back to the 3.4 behavior, or keep it true to get back the 3.1 - 3.3 behavior and (when relevant) improved input handling performance.

@akien-mga akien-mga removed this from the 3.x milestone Jul 7, 2022
@akien-mga akien-mga added this to the 3.5 milestone Jul 7, 2022
akien-mga added a commit to akien-mga/godot that referenced this issue Jul 7, 2022
Input accumulation was implemented and enabled by default in 3.1, and
I don't recall major complaints around it (or bugs were fixed).

In 3.4, godotengine#42220 added input buffering and apparently toggled input
accumulation off by mistake.

This led to multiple bug reports about degraded performance on Windows,
or simply unexpected behavior change (see linked issues in godotengine#55037).

Fixes godotengine#55037.
@akien-mga
Copy link
Member

Fixed by #62826.

akien-mga added a commit to akien-mga/godot that referenced this issue Jul 7, 2022
This was actually disabled by mistake in 3.4 causing a regression, but since
this issue survived the whole 3.4.x series and it's now very close to 3.5,
it's too late to change it again.

We might consider it for 3.6 after some beta testing.

Fixes godotengine#55037.

(cherry picked from commit 7de45b6)
Riordan-DC pushed a commit to Riordan-DC/godot that referenced this issue Jan 24, 2023
This was actually disabled by mistake in 3.4 causing a regression, but since
this issue survived the whole 3.4.x series and it's now very close to 3.5,
it's too late to change it again.

We might consider it for 3.6 after some beta testing.

Fixes godotengine#55037.
Riordan-DC pushed a commit to Riordan-DC/godot that referenced this issue Jan 24, 2023
Input accumulation was implemented and enabled by default in 3.1, and
I don't recall major complaints around it (or bugs were fixed).

In 3.4, godotengine#42220 added input buffering and apparently toggled input
accumulation off by mistake.

This led to multiple bug reports about degraded performance on Windows,
or simply unexpected behavior change (see linked issues in godotengine#55037).

Fixes godotengine#55037.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants