Fix the FOV issues with Bows, Sprinting and Spyglasses. #4045

Merged
Michieal merged 21 commits from Fix-FOV into master 2023-12-19 00:19:46 +01:00
Member

Tell us about your pull request! Reference related issues, if necessary

  • Create FOV Modifier API.

  • Make Bows work with the API.

  • Make Spyglasses work with the API.

  • Make sprinting work with the API.

Testing

Tell us how to test your changes!

Get a bow, some arrows and a spyglass.

Test Spyglass by using it. Should zoom in, and zoom out.

Test Sprinting by, well, sprinting. Should zoom out, and back in.

Test Bows by charging the bow, and firing an arrow. The FOV should zoom in, and reset back to the current FOV. Also test bows while sprinting.

Expected behavior:
Spyglasses override the FOV setting it to 8, regardless of other FOV modifiers. Sprinting increases the FOV, and should reset back to the default FOV when done. (In the latest master, Sprinting overrides the FOV and stays zoomed out, after "zooming in".) Bows zoom in while charging / held charged and zoom back out to normal when fired / released. Bows also zoom in while sprinting, but have the sprint's FOV as it's basis for the zoom. Ie., the zoom while sprinting is noticeably less than when standing still. All FOV effects should reset back to the default FOV when no FOV modifiers are applied.

Will search and create the fixes later.

Tell us about your pull request! Reference related issues, if necessary - [x] Create FOV Modifier API. - [x] Make Bows work with the API. - [x] Make Spyglasses work with the API. - [x] Make sprinting work with the API. ### Testing Tell us how to test your changes! Get a bow, some arrows and a spyglass. Test Spyglass by using it. Should zoom in, and zoom out. Test Sprinting by, well, sprinting. Should zoom out, and back in. Test Bows by charging the bow, and firing an arrow. The FOV should zoom in, and reset back to the current FOV. Also test bows while sprinting. Expected behavior: Spyglasses override the FOV setting it to 8, regardless of other FOV modifiers. Sprinting increases the FOV, and should reset back to the default FOV when done. (In the latest master, Sprinting overrides the FOV and stays zoomed out, after "zooming in".) Bows zoom in while charging / held charged and zoom back out to normal when fired / released. Bows also zoom in while sprinting, but have the sprint's FOV as it's basis for the zoom. Ie., the zoom while sprinting is noticeably less than when standing still. All FOV effects should reset back to the default FOV when no FOV modifiers are applied. Will search and create the `fixes` later.
the-real-herowl added this to the 0.86.0 - Another Look milestone 2023-12-05 01:07:01 +01:00
the-real-herowl added the
graphics
gameplay
#P4 priority: medium
player
labels 2023-12-05 01:07:35 +01:00
the-real-herowl force-pushed Fix-FOV from dea5adcc23 to 0f27869e10 2023-12-09 02:08:26 +01:00 Compare
Author
Member

really?! .... Redacted comment

really?! .... *Redacted comment*
the-real-herowl force-pushed Fix-FOV from 8387c0e63c to e5274b20db 2023-12-09 02:47:21 +01:00 Compare
the-real-herowl approved these changes 2023-12-10 00:36:27 +01:00
Dismissed
the-real-herowl changed title from WIP: Fix the FOV issues with Bows, Sprinting and Spyglasses. to Fix the FOV issues with Bows, Sprinting and Spyglasses. 2023-12-10 00:36:39 +01:00
Author
Member

Using a . instead of a : causes errors in other files... That the stack traceback doesn't state where the actual error is. It just gives a "... is a nil value" error.

Also getting a lot of warnings from the stone cutter and burning storage... (not sure though, if those have already been fixed?)

Using a `.` instead of a `:` causes errors in other files... That the stack traceback doesn't state where the actual error is. It just gives a "... is a nil value" error. Also getting a lot of warnings from the `stone cutter` and `burning storage`... (not sure though, if those have already been fixed?)
Michieal dismissed the-real-herowl’s review 2023-12-11 04:46:44 +01:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Michieal requested review from the-real-herowl 2023-12-11 04:57:25 +01:00
Author
Member

Also, what do you think about making the Sprinting FOV be 1.25 instead of 1.1?

Also, what do you think about making the Sprinting FOV be 1.25 instead of 1.1?
Member

pls do that

pls do that
the-real-herowl approved these changes 2023-12-12 01:32:30 +01:00
Dismissed
the-real-herowl dismissed the-real-herowl’s review 2023-12-12 01:34:16 +01:00
Reason:

Found a crash

the-real-herowl approved these changes 2023-12-12 03:49:50 +01:00
Dismissed
the-real-herowl left a comment
Owner

Turned out the crash was my fault. Anyway, I pushed one more fix.

Now, regarding sprinting FOV: In my opinion 1.1 is good. It's subtle but visible even at 72 FOV (I normally use something like 120 FOV). 1.2 and higher factors is very visible, and while it looks OK for 72 FOV (even though very visible), it breaks down totally for higher FOV (like 120).

Turned out the crash was my fault. Anyway, I pushed one more fix. Now, regarding sprinting FOV: In my opinion 1.1 is good. It's subtle but visible even at 72 FOV (I normally use something like 120 FOV). 1.2 and higher factors is very visible, and while it looks OK for 72 FOV (even though very visible), it breaks down totally for higher FOV (like 120).
Author
Member

Turned out the crash was my fault. Anyway, I pushed one more fix.

Now, regarding sprinting FOV: In my opinion 1.1 is good. It's subtle but visible even at 72 FOV (I normally use something like 120 FOV). 1.2 and higher factors is very visible, and while it looks OK for 72 FOV (even though very visible), it breaks down totally for higher FOV (like 120).

Ahh, I see. Well, the reason I suggested the higher amount, was to convey the feeling of speed. with the subtle amount, people unconsciously think that that they are going slower because it "feels like" they are. I've had others tell me that when they sprint in MCL they are going slower than when they sprint in MC. But, numerically, that's not the case. But, you really cannot tell how fast you are going in a game, because you don't have the peripheral vision like you do in real life.

Maybe something like a conditional based on the base FOV. The FOV is a setting in minetest, so we should be able to grab it. (Noting that the initial idea I had of using .get_fov() doesn't actually return the fov...)

> Turned out the crash was my fault. Anyway, I pushed one more fix. > > Now, regarding sprinting FOV: In my opinion 1.1 is good. It's subtle but visible even at 72 FOV (I normally use something like 120 FOV). 1.2 and higher factors is very visible, and while it looks OK for 72 FOV (even though very visible), it breaks down totally for higher FOV (like 120). Ahh, I see. Well, the reason I suggested the higher amount, was to convey the feeling of speed. with the subtle amount, people unconsciously think that that they are going slower because it "feels like" they are. I've had others tell me that when they sprint in MCL they are going slower than when they sprint in MC. But, numerically, that's not the case. But, you really cannot tell how fast you are going in a game, because you don't have the peripheral vision like you do in real life. Maybe something like a conditional based on the base FOV. The FOV is a setting in minetest, so we should be able to grab it. (Noting that the initial idea I had of using `.get_fov()` doesn't actually return the fov...)
Author
Member

Fixes #3574

Fixes #3574
Member

I want it to be set to 1.25 so it actually feels like you are running

I want it to be set to 1.25 so it actually feels like you are running
Member

I was killed by a slime and this happened

2023-12-12 15:31:37: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mcl_fovapi' in callback on_respawnplayer(): ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: attempt to call a nil value 2023-12-12 15:31:37: ERROR[Main]: stack traceback: 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: in function 'remove_all_modifiers' 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:69: in function <...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:68> 2023-12-12 15:31:37: ERROR[Main]: ...test.minetest/files/Minetest/builtin/common/register.lua:26: in function <...test.minetest/files/Minetest/builtin/common/register.lua:12>

I was killed by a slime and this happened `2023-12-12 15:31:37: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mcl_fovapi' in callback on_respawnplayer(): ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: attempt to call a nil value 2023-12-12 15:31:37: ERROR[Main]: stack traceback: 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: in function 'remove_all_modifiers' 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:69: in function <...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:68> 2023-12-12 15:31:37: ERROR[Main]: ...test.minetest/files/Minetest/builtin/common/register.lua:26: in function <...test.minetest/files/Minetest/builtin/common/register.lua:12>`
the-real-herowl requested review from the-real-herowl 2023-12-12 18:48:14 +01:00
the-real-herowl dismissed the-real-herowl’s review 2023-12-13 02:16:39 +01:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

I was killed by a slime and this happened

2023-12-12 15:31:37: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mcl_fovapi' in callback on_respawnplayer(): ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: attempt to call a nil value 2023-12-12 15:31:37: ERROR[Main]: stack traceback: 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: in function 'remove_all_modifiers' 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:69: in function <...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:68> 2023-12-12 15:31:37: ERROR[Main]: ...test.minetest/files/Minetest/builtin/common/register.lua:26: in function <...test.minetest/files/Minetest/builtin/common/register.lua:12>

Should be fixed now. As well as a bunch of other possible crashes.

> I was killed by a slime and this happened > > `2023-12-12 15:31:37: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mcl_fovapi' in callback on_respawnplayer(): ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: attempt to call a nil value > 2023-12-12 15:31:37: ERROR[Main]: stack traceback: > 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:214: in function 'remove_all_modifiers' > 2023-12-12 15:31:37: ERROR[Main]: ...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:69: in function <...test/games/mineclone2_pr/mods/PLAYER/mcl_fovapi/init.lua:68> > 2023-12-12 15:31:37: ERROR[Main]: ...test.minetest/files/Minetest/builtin/common/register.lua:26: in function <...test.minetest/files/Minetest/builtin/common/register.lua:12>` Should be fixed now. As well as a bunch of other possible crashes.
Michieal force-pushed Fix-FOV from 2db2747dbd to 5926ca6915 2023-12-14 19:17:33 +01:00 Compare
Author
Member

Updated.

Updated.
Author
Member

Missing: FOV change when using an Enderpearl or Chorus Fruit. Both of them reset the player's velocity when used. (So it cancels out sprinting, or is supposed to.)

Missing: FOV change when using an Enderpearl or Chorus Fruit. Both of them reset the player's velocity when used. (So it cancels out sprinting, or is supposed to.)
the-real-herowl force-pushed Fix-FOV from 5926ca6915 to 8a5058e032 2023-12-18 23:51:14 +01:00 Compare

Missing: FOV change when using an Enderpearl or Chorus Fruit. Both of them reset the player's velocity when used. (So it cancels out sprinting, or is supposed to.)

They don't reset velocity though. It's a different problem, we're done with this PR.

> Missing: FOV change when using an Enderpearl or Chorus Fruit. Both of them reset the player's velocity when used. (So it cancels out sprinting, or is supposed to.) They don't reset velocity though. It's a different problem, we're done with this PR.
the-real-herowl approved these changes 2023-12-18 23:57:12 +01:00
Author
Member

Missing: FOV change when using an Enderpearl or Chorus Fruit. Both of them reset the player's velocity when used. (So it cancels out sprinting, or is supposed to.)

They don't reset velocity though. It's a different problem, we're done with this PR.

okay. I just saw it on another issue, while looking for "fixes #". cool. merging now.

> > Missing: FOV change when using an Enderpearl or Chorus Fruit. Both of them reset the player's velocity when used. (So it cancels out sprinting, or is supposed to.) > > They don't reset velocity though. It's a different problem, we're done with this PR. okay. I just saw it on another issue, while looking for "fixes #". cool. merging now.
Michieal merged commit 56ebb5ac09 into master 2023-12-19 00:19:46 +01:00
Michieal deleted branch Fix-FOV 2023-12-19 00:20:09 +01:00
Sign in to join this conversation.
No reviewers
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#4045
No description provided.