### Adding FOV Slider to Options

Scripts and codes that enhances or changes the GUI in the engine.

#### Adding FOV Slider to Options

Jason Campbell
Posts: 232
Joined: Fri Feb 13, 2015 2:51 am

Not much of a resource but it seems that some players want this option and I've seen some complaints, 'Why no FOV options?'

Anyway it's real simple and only really adds the ability to raise the FOV, 9 above it's default from 65 to 74. It's 74 because any further and you see the end of the FPS arms. I chose the ability to go from 50 to 74 in the slider. It's easily altered from the GUI editor by clicking the slider and altering the range within the properties.

Step 1:

FOV_Slider.zip

Step 2:

Open game/art/datablocks/player.cs

in datablock PlayerData(DefaultPlayerData) find:

cameraDefaultFov = 55.0;cameraMinFov = 5.0;cameraMaxFov = 65.0;

and change it to this:

cameraDefaultFov = $pref::Player::currentFov; // ChangecameraMinFov = 5.0;cameraMaxFov = 75; // Change Step 3: Open game/scripts/client/default.bind.cs find: function turnOffZoom(){ ServerConnection.zoomed = false; setFov(ServerConnection.getControlCameraDefaultFov()); Reticle.setVisible(true); zoomReticle.setVisible(false); // Rather than just disable the DOF effect, we want to set it to the level's // preset values. //DOFPostEffect.disable(); ppOptionsUpdateDOFSettings();} and change it to: function turnOffZoom(){ ServerConnection.zoomed = false; setFov($pref::Player::CurrentFOV);  // Change   Reticle.setVisible(true);   zoomReticle.setVisible(false);   // Rather than just disable the DOF effect, we want to set it to the level's   // preset values.   //DOFPostEffect.disable();   ppOptionsUpdateDOFSettings();}

Hopefully that will do it. Load up a level and hit Ctrl-O and knock yourself silly with an almost useless slider!

#### Re: Adding FOV Slider to Options

thehsvdude
Posts: 1
Joined: Fri Feb 02, 2018 3:09 am
Got an Issue where it makes weapons unselectable in 3.10

#### Re: Adding FOV Slider to Options

Duion
Posts: 929
Joined: Sun Feb 08, 2015 1:51 am

I have a FOV slider as well in Uebergame and added eye offset so the first person hands ends are not visible, but the start to be visible still at over 100 FOV or so.
Default FOV should really be 90, since that is what most modern games use, 60-70 just looks bad.

We should really consider changing the default FOV to 90 and the resolution to a widescreen one since always opening a 4:3 window with 60 FOV just looks amateurish and so much different to what people are used to. The slider may also be useful.

#### Re: Adding FOV Slider to Options

Bloodknight
Posts: 135
Joined: Tue Feb 03, 2015 8:58 pm
There is quite a lot of science behind FOV settings, in practice, this should be able to be set by default using discoverable data regarding platform and screen size particularly. In general, it's a first-person game problem, other game types don't have the same, of course, years of evolution later gamers have turned the science into an exploit and constantly widen the FOV so they can see more. Ideally (or at least for MP games) the server should set some form of max but I've no idea how the heck you'd get the server to enforce client rendering.

As for the original resource, I've always been of the opinion that some of these settings should be held in a separate configurable file rather than hard-coded into the script functions/datablocks.

#### Re: Adding FOV Slider to Options

Jason Campbell
Posts: 232
Joined: Fri Feb 13, 2015 2:51 am

thehsvdude wrote:Got an Issue where it makes weapons unselectable in 3.10

That is weird, I can't really think what would cause that. The resource is fairly useless anyway, to be honest. It was more of an exercise for me. As he mentioned, Duion has a working slider in Ubergame and his project is open source so that would probably be a better thing to get working. Plus his GUI is very polished and seems to be better then most I've seen.

@
Duion
If the player model is the paintball player, could it go more then 100?

#### Re: Adding FOV Slider to Options

Duion
Posts: 929
Joined: Sun Feb 08, 2015 1:51 am

My paintball player works up to 120 FOV since he uses true first person, so it always fits, the only issue is maybe you will be clipping into your chest or so when looking down.
The first person arms are just put on your screen, so you will be able to see the ends if your FOV gets too high, but I fixed that with eye offset in the weapon image datablock.

#### Who is online

Users browsing this forum: No registered users and 1 guest