-
Notifications
You must be signed in to change notification settings - Fork 58
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
Increase FOV when moving fast (Issue#716) #812
base: master
Are you sure you want to change the base?
Conversation
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.
I agree that the second approach would be better, since it avoids the need for one extra variable.
I also looked through the rest of your code.
defer mutex.unlock(); | ||
return fovMod; | ||
} | ||
|
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.
Why not just make fovMod atomic?
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.
Question: Why does it have to be atomic, when other, similar, variables (like eyeVel or eyePos) are not atomic either?
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.
If it's only ever used by the update and render functions, then you are right, it doesn't need to be thread safe.
I have a few issues with how FOV is handled in this PR:
Already, this commit is promising, and makes the game feel better! It just needs a different approach to implementation that can work in multiple scenarios, such as falling, flying, etc. |
Also, if possible, you should add an option to lower the amount of FOV change, like how Minecraft has a slider. |
Thanks!
|
Sure, can add! I thought it would be a bit much to put that as a specific option, but it could be nice |
I do think that vertical speed should have a larger threshold, perhaps half of the terminal velocity so it doesn't change when you drop down a single block. |
Don't worry about motion sickness for now, we can always smooth things out with interpolation. |
|
||
fn fovSpeedAddFormatter(allocator: main.utils.NeverFailingAllocator, value: f32) []const u8 { | ||
return std.fmt.allocPrint(allocator.allocator, "#ffffffFoV Speed Widening: {d:.0}°", .{value}) catch unreachable; | ||
} |
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.
I'm not happy with the naming here. How do other games call this option?
Also the naming is inconsistent: The function is called fovSpeedAdd
, the option is called speedFovAdd
and the user sees FoV Speed Widening
.
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.
I'm not happy with the naming here. How do other games call this option?
Also the naming is inconsistent: The function is called
fovSpeedAdd
, the option is calledspeedFovAdd
and the user seesFoV Speed Widening
.
Good point. I'll check what other games do as nothing comes to mind right now.
Not sure why I skipped over the naming inconsistencies. Will fix, thanks!
What do you think of the points brought up by Ikabod-kee? I imagine you have the final say, right? :D
Ikabod is good at explaining how these kind of things feels, and how they might be improved. In the current state of this PR I think the FOV transition feels weird and disorienting. Coupling FOV directly to velocity might help with this (furthermore it would fix the bug that your FOV still increases when running into a block). But I don't think that this is capturing the essence of what this effect is supposed to do. It's not about conveying to the player how fast they are, in RL your FOV also doesn't change if you move faster. I think it's more about conveying the effects that you normally can't see, like the power level of the character or the acceleration force on your body. If you think about it, FOV correlates with the distance between the eyes and the screen. So changing FOV is equivalent to moving the player head in relation to the screen, which is equivalent to acceleration, like if you sit in a car and the acceleration pushes you back in your seat. So maybe it would be the most realistic to change FOV depending on acceleration in the direction of the camera, instead of velocity. Now I haven't seen any game that does it, but it might be worth a try? |
Yeah, think about it like the wind blowing past you. :) |
That sounds really cool, actually. I'll experiment a little. Thanks for all the input you two! |
Hm, I wonder if we could simulate the distortion due to the refractive index of air changing in front of your face due to compression. |
Picked up this issue: #716
I added a smooth FOV transition when the player goes from walking to sprinting, and vice-versa.,
This is a draft PR, because I am unsure if:
I think it should probably be the second, especially because the FOV vs FOVExtra in the renderer file is a little awkward.