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
Support controlling Free Look via input bindings (motion controls, gamepad, etc!) #8747
Conversation
This comment has been minimized.
This comment has been minimized.
|
Yeah may as well change the names while we're at it, I doubt many people change the freelook bindings so them getting reset shouldn't be a big deal.
Also, in testing I found the mouse rotation to be far too sensitive now, so much as to be completely unusable. |
|
I took another stab at the freelook hotkey buttons in the UI. However, if that is too radical of a change, I can switch them back to a single group. Thank you for reviewing @Techjar . About the mouse sensitivity, were you able to get an expression you liked? I need to retry the behavior on master but thought it was just as sensitive. |
|
The poorly named (my fault) "Axis X/Y" (relative mouse movement) mappings all had os-specific smoothing worked into them to make them semi-usable for analog sticks. |
|
To be clear I also tried binding my Wiimote gyro to the freelook rotation and it went absolutely nuts at the tiniest movements. |
This comment has been minimized.
This comment has been minimized.
|
Well |
|
If someone is able to test the latest version with a real gyro, that'd be helpful. With OpenTrackDSUServer and a circular motion, I'm getting multiple arcs for in game rotations, despite PadTest showing a 180 turn. Uncertain if this is normal behavior for Dolphin (I see the same thing in Citra with OOT's first-person view) or a bug in my DSU server. I was expecting 1:1 mapping. At least in my mind, this is the only thing keeping this PR from being WIP still. |
|
I can give a try with the DualShock 4 motion sensors. Just to be clear, what is the expected behavior? |
|
@mbc07 - I'm actually trying to figure out the expected behavior. I don't own / haven't setup any gyro based controllers so I don't know what the normal behavior is. If you move a DS4, do you get a 1:1 mapping in Dolphin? For this freelook feature, when using my new DSU server, I see a 1:1 mapping in "PadTest" but not in Dolphin or Citra. I would assume "PadTest" is correct but I have no other controllers to confirm.. EDIT: To put it in a less verbose way, does this feature feel correct with a gyro-based controller? |
|
I gave it a test and apart from some inverted axes (more on that later) it seems to work as it should. I used a DualShock 4 v2 (the one where the light bar is visible from the touchpad) with DS4Windows 2.0.16. I booted Zelda Wind Waker and started messing with the free look controls as soon as the player has control of Link (right after him waking up). Up and down movement is working fine, however, roll and yaw movements are inverted. For yaw, assigning Yaw Right to Yaw Left and Yaw Left to Yaw Right on the hotkey settings was enough to correct that. Roll, however, I couldn't figure out. With Roll Left assigned to Roll Left and Roll Right assigned to Roll Right, the free-look camera was inverted (it actually rotated left when you rolled the controller right and vice versa). Then I tried to invert the bindings, just like I did with Yaw, and while that works, some time later the Roll movements goes inverted again (I couldn't figure out what triggers that). TL;DR it works as it should if you invert the Yaw assignments, except for Roll, which is prone to do the inverted movement even after trying to account for that by inverting the bindings... |
|
Thanks for testing @mbc07 ! I actually forgot you can use a Wiimote and luckily had one to test and I'm seeing similar behavior. I will need to look and see why that is.. |
d96b7c7
to
04d6375
Compare
|
@mbc07 - I've updated this to fix some things, drift should be gone and 1:1 motion is now as expected. It should also fix the axis inversion you were experiencing. One thing I'm seeing is some odd roll rotation with the Wiimote. I don't think I'm adding it with my movement. Do you see any surprising behavior with your DS4? As an aside, I need to tweak the mouse movements some more. If anyone gets some working defaults, let me know! |
|
Sorry for the delay. Tested again with the DualShock 4 and everything is working as it should, without needing to invert any axes. Hasn't tested mouse movement, though... |
b6ec8c1
to
01e9db6
Compare
|
I followed @jordan-woyak 's recommendation and added a "RelativeMouse" input that doesn't do smoothing and deprecates the "Axis" for mouse movement. Still trying to get mouse movement to match master. That's the only blocker at this point. |
7ea8dfd
to
d6322d6
Compare
|
@mbc07 - if you don't mind, at your earliest convenience, please test this again. I rebased with master which required some changes due to the new freelook control types! From what I can tell, everything works appropriately but it'd be nice to get a second look. |
|
@iwubcode just gave a try and noticed the UI has some oddities:
Other than that, everything is working as intended, just like the last time I tried this PR (tested with a DualShock 4 on Wind Waker)... |
… fix orbital and fps implementations
…or motion based controllers
|
Thanks to @Filoppi for noticing that the I went back to the basics and now update the FreeLook input every 1/60th of a second. It seemed to work from my testing with Wiimote DSU. If we're dropping input, I can't notice, it still 'feels' fine. I also made a change to have the movement consider the delta time. That will help if we ever move this to a separate thread that runs faster or slower (may also help with the accelerometer? I haven't tested yet). Because of this change, I also re-tested gamepad and keyboard/mouse. I believe I have things working very close to master. @MayImilae / @mbc07 / @MichaelJW / @Miksel12 - sorry to nag you all again. But if some of you can do a sanity check, it would be very helpful. I really hope I didn't break anything! |
Ideally you'd want to divide a fixed value by the emulation speed IMO, or the possible huge differences in timings between frames (e.g. one frame could take 16ms, the next one 3ms, while you still run at 60 overall) would add jerk to the camera movement. But of course it's fine as it is now and that change would require Freelook to update once per video frame independently of the emulation speed. Great changes overall. |
|
@iwubcode There seems to be quite a lot of drift now on my DS4 and it seems like it is harder to control. I did a sanity check on master which showed the correct behaviour. On a somewhat related note, when I press on default with my DS4 as DSU selected input, it switches back to keyboard and mouse as selected input and configures the default mappings for keyboard. I would think it would be better if Dolphin didn't configure anything if the selected input doesn't have default mappings. I was half way into mapping my DS4 when I remembered I could just click on default, only to see my mappings replaced with keyboard mappings. |
Off topic but "Default" restores the default profile, a profile also includes a specific default device, and in the case of the "Default" profile, the default device is the first one in the list of devices, which is always the keyboard and mouse device. |
I see, misconception on my part. |
Drats, ok. Thank you for testing. It's gotta be the DS4 poll rate is higher than the Wiimote. I wasn't able to find a solution that I was happy with keeping FreeLook at 200hz without introducing another thread or spinning. Maybe I'll have to add another thread for now with a What do you mean checked with master? You mean there's an issue with the mouse controls too? |
If you are going to add to this PR, I think it would be much better to just calculate the absolute rotation from within DSU, and add it as an input, then move FreeLook to the CPU thread and multiply the delta time you just added by the game speed. But really, as a simple solution you can just run the hotkeys at 200Hz, it's not gonna break anything. |
Well, the problem seems that the input is only updated in However, assuming we could get around that something like what you said would be the ideal solution.
I was thinking the thread would eat a lot more cycles but I guess I could try this. Key presses will occur more frequently which might effect sensitivity though |
No, I haven't played around with gyro for some time so I wasn't sure if the behaviour I saw was purely from your update or maybe a faulty DS4. |
Not exactly sure what you mean. DSU is the only device backend that has got a "velocity" input which you need to multiply by delta time and add to some total sum of a rotation. |
|
@Miksel12 - at your earliest convenience, I updated the poll rate to 5ms. Please try again and see if it's any better? |
|
Controls great again and no drift. |
…(in case we decide to move this somewhere else in the future)
…ion for FreeLook motion devices
| Other, | ||
| Rotation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't "Other" be always the last one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it another try, and the drift problems are MUCH improved and the UI all still works and looks fine from the previous changes.
LGTM!
|
Multiple Approvals and Tests. I also tested it and it was an improvement. |
I've always thought Free Look was such a cool and underutilized feature. In an effort to make it more mainstream, I've removed the shackles of requiring to use the mouse. Now you can assign motion controls (or gamepad) to the Free Look rotation movement.
Rotation Free Look settings (mouse, gamepad, DSU or bluetooth emulated wiimote!)
