Improved Mouse Look Camera Smoothing#2441
Improved Mouse Look Camera Smoothing#2441Interkarma merged 37 commits intoInterkarma:mouse-smoothingfrom
Conversation
|
Something I like about this change is the mouselook sensitivity feels equivalent with smoothing on or off. In the current implementation, mouselook sensitivity must be set differently based on smoothing. This also raises a minor issue. Anyone with current smoothing on will experience a slower-feeling mouselook sensitivity once change goes live. Multiplying |
A stronger refactoring than previous commits. The Init method is no longer needed and has been eliminated. Other classes may safely change Yaw and Pitch members directly now because getter/setters have been improved (the change to SerializablePlayer.cs is no longer needed). General code cleanup.
|
Thanks for the feedback! One idea would be to inform players with an in-game popup message. The popup message could explain the change and ask the user if they'd like to apply correction scaling to their mouse sensitivity (YES/NO). The invocation of this popup could be controlled by the presence/absence of a DaggerfallUnityVersion field in the settings.ini file. If settings.ini does not contain that field then you know it was generated by a version prior to 0.14.5, therefore display the popup for sensitivity upscaling--but only if MouseLookSmoothing = True because those are the users who are affected. Versions 0.14.5+ would record DaggerfallUnityVersion in settings.ini. Having this information could potentially be useful in the future for other unforeseen reasons as well. If a user plays with 0.14.5+ and then goes back to an older version they will experience a mouse sensitivity increase but I don't think that's as big a deal. |
No need for anything like that. I'll communicate change via patch notes and socials, then support anyone who doesn't get the memo. Please don't make style-only changes to existing code such as Stripping this PR down to bare essentials of improved smoothing calculation, what's the minimum number of lines changed could this be accomplished in? |
|
Understood, Gavin. I'll look at putting together a minimum change version
later today.
…On Wed, Oct 12, 2022 at 4:24 AM Gavin Clayton ***@***.***> wrote:
One idea would be to inform players with an in-game popup message.
No need for anything like that. I'll communicate change via patch notes
and socials, then support anyone who doesn't get the memo.
Please don't make style-only changes to existing code such as PitchMin to
PITCH_MIN. I prefer contributors to match the style of original author
and only make changes with a clear functional purpose.
Stripping this PR down to bare essentials of improved smoothing
calculation, what's the minimum number of lines changed could this be
accomplished in?
—
Reply to this email directly, view it on GitHub
<#2441 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3QEP2UYRVAFN36ESWWC5J3WCZYSPANCNFSM6AAAAAARAPKGB4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
New camera smoothing implemented with minimal changes to existing code.
|
Minimal changes version is now up.
…On Wed, Oct 12, 2022 at 1:22 PM Rob Hewitt ***@***.***> wrote:
Understood, Gavin. I'll look at putting together a minimum change version
later today.
On Wed, Oct 12, 2022 at 4:24 AM Gavin Clayton ***@***.***>
wrote:
> One idea would be to inform players with an in-game popup message.
>
> No need for anything like that. I'll communicate change via patch notes
> and socials, then support anyone who doesn't get the memo.
>
> Please don't make style-only changes to existing code such as PitchMin
> to PITCH_MIN. I prefer contributors to match the style of original
> author and only make changes with a clear functional purpose.
>
> Stripping this PR down to bare essentials of improved smoothing
> calculation, what's the minimum number of lines changed could this be
> accomplished in?
>
> —
> Reply to this email directly, view it on GitHub
> <#2441 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A3QEP2UYRVAFN36ESWWC5J3WCZYSPANCNFSM6AAAAAARAPKGB4>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Specified a default smoothing of 0.5
|
Code changes for mouse smoothing slider are now up.
The enable mouse smoothing checkbox has been eliminated and the
MouseLookSmoothing field in settings.ini is now a float.
DFU 0.14.5+ should probably examine that field to see if it has a boolean
value. If so, then False would import as 0.0 and True as 0.5, or some other
value you think is appropriate.
It could have been left for backwards compatibility and a different field
name chosen for the slider such as MouseLookSmoothingFactor. What do you
think?
…On Wed, Oct 12, 2022 at 7:37 PM Rob Hewitt ***@***.***> wrote:
Minimal changes version is now up.
On Wed, Oct 12, 2022 at 1:22 PM Rob Hewitt ***@***.***> wrote:
> Understood, Gavin. I'll look at putting together a minimum change version
> later today.
>
> On Wed, Oct 12, 2022 at 4:24 AM Gavin Clayton ***@***.***>
> wrote:
>
>> One idea would be to inform players with an in-game popup message.
>>
>> No need for anything like that. I'll communicate change via patch notes
>> and socials, then support anyone who doesn't get the memo.
>>
>> Please don't make style-only changes to existing code such as PitchMin
>> to PITCH_MIN. I prefer contributors to match the style of original
>> author and only make changes with a clear functional purpose.
>>
>> Stripping this PR down to bare essentials of improved smoothing
>> calculation, what's the minimum number of lines changed could this be
>> accomplished in?
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#2441 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/A3QEP2UYRVAFN36ESWWC5J3WCZYSPANCNFSM6AAAAAARAPKGB4>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
|
SettingsManager will sync with player's live settings by removing old values and adding new values based on defaults. The best approach is simply to add the new setting with a different name to defaults.ini.txt and remove the old setting. There's no need to retain old values for backwards compatibility, this will be automatic if player runs an older version of the game. Something like Thanks for your PR. I'll review when I can. It won't make it into 0.14.5, as that version is already in testing. I'll aim to get it into 0.14.6. |
Clarify looking instead of general mouse use
To better cover a useable range of values.
None / Lowest / Low / Medium / High / Highest
PR code is now in a "production-ready" state, pending review
|
This is looking good so far, thank you for all the work on this one. :) I'll aim to complete review and have it merged ahead of next release. I'll let you know if any issues are found. |
|
|
||
|
|
||
| private static class ToggleMouseSmoothing | ||
| /*private static class ToggleMouseSmoothing |
There was a problem hiding this comment.
You should remove obsolete code altogether, if people are interested in old code they can have a look at Git history ;)
There was a problem hiding this comment.
Fair point. I'm rather guilty of this myself. :)
This submission contains a reworking of the camera smoothing code located in PlayerMouseLook.cs. The purpose of this reworking is primarily to increase behavioral parity between the "smoothing" and "no smoothing" modes. Moving the mouse an inch in a certain direction should give identical yaw/pitch deltas (ultimately) for both modes, it's just that one mode is progressive and the other is immediate.
Note: To increase or decrease the camera smoothing effect you may edit the following value (located near top of class):
float smoothing = 0.5f;
For example, a value of 0.3f will give a very subtle smoothing effect and a value of 0.8f will give a very pronounced smoothing effect (at the cost of less responsiveness/higher latency). I have chosen a value of 0.5f because I feel it is suitable for production. It is possible that the "Mouse Smoothing" checkbox could be replaced with a slider ranged 0.0 to 0.9, in future releases.