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

Camera Speed Broken #598

Closed
ShanuJackal opened this issue Jul 18, 2023 · 13 comments
Closed

Camera Speed Broken #598

ShanuJackal opened this issue Jul 18, 2023 · 13 comments

Comments

@ShanuJackal
Copy link

ShanuJackal commented Jul 18, 2023

Camera speed is completely broken, showing NaN as its value when you try to use the scroll wheel. It is unable to be changed. It also breaks other camera controls unable to be used as a result. Reloading does not work, You must close the tab and open a new one to be able to control the camera again. I tried using the backslash and shift keys to change camera speed, but nothing happened.

@PFedak
Copy link
Collaborator

PFedak commented Jul 23, 2023

What OS/browser are you using? Can you get this to happen consistently on any game map or just specific ones? We can add some defensive logic around the camera speed but I haven't seen this before.

@ShanuJackal
Copy link
Author

ShanuJackal commented Jul 23, 2023

Windows 11 Pro 22H2, Mozilla Firefox; it happens on all maps

Tested on Chrome, works there

@Miepee
Copy link

Miepee commented Jul 28, 2023

On Arch Linux + Firefox there's a similar issue, where the camera speed is very slow. I can change the slider for it, but it does nothing. Chromium again does not inhibit any of these issues.

@magcius
Copy link
Owner

magcius commented Jul 28, 2023

Bizarre. I do try to normalize the deltaY parameter that comes out of the mouse wheel event, so I wonder why Firefox is so much slower for it https://github.com/magcius/noclip.website/blob/master/src/InputManager.ts#L199-L203

@magcius
Copy link
Owner

magcius commented Jul 31, 2023

So far, I've been unable to reproduce this with Firefox on Windows. I'd be curious if anyone can help me debug it. My best guess is that an invalid wheel event is making it in without a deltaY property and screwing things up. If you disable all extensions, does that fix the issue?

@Miepee
Copy link

Miepee commented Jul 31, 2023

No, even with all extensions disabled the camera speed is still messed up.
How would I be able to help with debugging, without needing to compile from source? is there a way to see mouse variables in the statistic tabs?

@magcius
Copy link
Owner

magcius commented Jul 31, 2023

I was mostly interested in the bug where the camera speed becomes NaN. If the camera speed slider is doing nothing, that seems like it could be a different bug. One thing to check is to make sure that the camera speed is making it all the way to the camera controller. Check main.viewer.cameraController.keyMoveSpeed in the F12 Console. When the slider is at the low end, it should be 1, and when it's at the high end, it should be 200.

@Miepee
Copy link

Miepee commented Jul 31, 2023

Default is at 60, low end is at 1, high end is at 200

@magcius
Copy link
Owner

magcius commented Aug 1, 2023

Yeah, that's working correctly. The bizarre thing is that from there, all the code using the camera speed is our own math, and I can't imagine any way Firefox could be messing this up.

@Miepee
Copy link

Miepee commented Aug 1, 2023

Just noticed: this could potentially be size or multi monitor related.
Firefox maximized on one monitors -> slow
Firefox stretched to cover both monitors -> less slow
Firefox stretched to be longer than both my monitors -> even less slow.

At least it feels like it. Still wouldn't explain why the camera speed doesn't have any effect tho.

EDIT: forgot to add, i've got a 1920x1080 and a 1680x1050 monitor.

@magcius
Copy link
Owner

magcius commented Dec 16, 2023

@Miepee is this about the camera speed when traveling using WASD, or about the speed of rotation when clicking and dragging with the mouse?

@Miepee
Copy link

Miepee commented Dec 16, 2023

The latter.

@magcius
Copy link
Owner

magcius commented Dec 16, 2023

OK, then I believe you're seeing the same issue as #624, unrelated to the original reporter's issue. It appears to be an issue with Firefox's pointer lock implementation on Linux.

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