JonnyBro / beatrun

Fork of infamous parkour addon for Garry's Mod
https://beatrun.jonnybro.ru
Do What The F*ck You Want To Public License
245 stars 39 forks source link

[Bug] FOV issues with some weapons #179

Closed LostTrackpad closed 5 months ago

LostTrackpad commented 7 months ago

Describe the bug FOV behavior appears to not work right with some zoom types (?) after #159 and some subsequent related commits.

To Reproduce Steps to reproduce the behavior:

  1. Launch the game and start any map with the Beatrun gamemode
  2. Equip the Camera weapon (Spawnmenu -> Weapons -> Other)
  3. Try and zoom in (RMB + move your mouse forwards). Notice that it won't zoom in.

Expected behavior The Camera weapon should be able to zoom in.

Screenshots/Videos Top is idle standing state, middle is aiming down sights, bottom is aiming down sights with patched FOV behavior. Not aiming down sights at proper 120 FOV. Aiming down sights. Still keeping non-ADS FOV and glitches out viewmodel. Aiming down sights with the FOV behavior patched to work as it should. Notice how it zooms to ~90 FOV and the viewmodel no longer glitches out.

Additional information:

Additional context Beatrun FOV was set to 120, though I don't think this is relevant.

Weapon used in screenshots is a TFA Base weapon.

LostTrackpad commented 7 months ago

Okay I figured it out: The Camera weapon (and some weapon bases that use a similar zoom in method, and the HL2 zoom) tries to set CalcView() FOV but since we're setting it to 120 constantly, it can't, and so...this bug happens.

LostTrackpad commented 7 months ago

Oops, accidentally closed the issue.

JonnyBro commented 7 months ago

HL2's zoom was never intended to work

LostTrackpad commented 7 months ago

HL2's zoom was never intended to work

Okay well maybe not the HL2 zoom, but anything else that (apparently to me anyway) uses the same zoom method.

(Would mean that the HL2 zoom has to be completely disabled while keeping everything else working somehow though...)

JonnyBro commented 5 months ago

I'll take a look into this on weekends. I think I'll just disable HL2's zoom.

LostTrackpad commented 5 months ago

~Note: I can't even test this right now, GMod keeps crashing for some reason (on x86-64 branch). Maybe I'll try the 32-bit executables and the normal branch, but not much hope.~

HL2 zoom is already disabled in Beatrun normally, it just somehow started working when I tried to fix this (Lua refresh being weird I suppose).

Also another thing I forgot after finding out about it ~2 weeks ago: ARC9 weapons need special handling in the fix because switching away from them causes your FOV to jerk back to fov_desired's value again* (for example, 120 (beatrun_fov) > 100 (my fov_desired))

It's like 9PM as I write this over here, I'll correct this later if I figure anything out.

*The current FOV behavior in Beatrun, hilariously, actually fixes this!

LostTrackpad commented 5 months ago

@JonnyBro I think you can unpin this issue now. In case you forgot.

JonnyBro commented 5 months ago

Oh yea, thanks