Jump to content

Is it possible to adjust the default IVA zoom/FOV via config?


Recommended Posts

Hey everybody, I work with a non-profit that's setting up a computer lab specifically for Kerbal to help kids learn about aviation/space using a Rotational Hand Controller (Logitech Extreme 3dPro Joystick) and Translational Hand Controller (3D Mouse). With the kids in mind I'm trying to simplify things as much as possible in terms of getting things set up in-flight with minimal adjustment.

When jumping into IVA I'm aware that you can use the scroll wheel to "zoom out" (whether it's sliding the camera back or adjusting the FOV I'm not sure), but I have two questions about how I could adjust this:

  1. Is it possible to adjust the default "zoom" value via a config/text file in the games folder structure? That way the view is always "zoomed" out as much as possible in IVA when you first jump into it.
  2. Even if the ZoomIn/ZoomOut keybinds are mapped to buttons on the joystick, the view can be zoomed in and out when using the exterior view, but the joystick buttons don't work to zoom the camera when in IVA, is there some way to fix this on my end?

For reference, below are two images, one of the Mk1 cockpit at its default zoomed in state, and then what I would like to use as the default with the more zoomed out state:

Current Default:JayGBSu.png

 

Desired Default:

guDxshg.png

Any assistance would be greatly appreciated, thanks!

Link to comment
Share on other sites

Have a look in this thread (near the end). There's a (relatively) easy way to manipulate field of view and view rotation limits, in it, if you can do simple config file editing or ModuleManager patches.
 

 

Edited by Stone Blue
Link to comment
Share on other sites

3 hours ago, Stone Blue said:

Have a look in this thread (near the end). There's a (relatively) easy way to manipulate field of view and view rotation limits, in it, if you can do simple config file editing or ModuleManager patches.
 

 

That sounds promising actually, I can't test it tonight but can look at it tomorrow.

Two questions:

  1. Using a completely stock game, does the game recognize the module you wrote out in that other thread? I just want to be sure before I try adding that in it's not mod-specific. I can edit text files but I don't know all the parameters that KSP recognizes on its own.
    MODULE
    	{
    		name = JSISetInternalCameraFOV
    		fov = 50
    	}
  2. In order to test that in something like the Mk1 cockpit, would testing internal.cfg changes require a game restart? Or would the game re-check the internal.cfg on part loading instead of game loading, allowing me to keep the game open to tweak the config more quickly?

Thanks for the quick reply!

Link to comment
Share on other sites

23 hours ago, Stone Blue said:

Have a look in this thread (near the end). There's a (relatively) easy way to manipulate field of view and view rotation limits, in it, if you can do simple config file editing or ModuleManager patches.
 

 

@Stone Blue So I had time to test this today, but wasn't able to get any noticeable change in either the Mk1 Cockpit or the Cupola. Here's what I tried:

  1. I found the internal.cfg files for every (non-DLC) stock IVA here: \Kerbal Space Program\GameData\Squad\Spaces
  2. I modified both the cupolaInternal as well as the mk1CockpitInternal internal.cfg files with the changes you mentioned in the other IVA thread. Excerpts from the config files are below, text I added is shown in red (I only did the FOV change since I don't need to change how far the camera can turn):
    mk1CockpitInternal:
    Quote

    INTERNAL
    {
        name = mk1CockpitInternal
        MODEL
        {
            model = Squad/Spaces/mk1CockpitInternal/Mk1StandardIVA
            texture = CockpitGeneric, Squad/Spaces/sharedAssets/CockpitGeneric
            texture = CockpitGeneric_NRM, Squad/Spaces/sharedAssets/CockpitGeneric_NRM
        }
        MODEL
        {
            model = Squad/Spaces/OverlayMasks/Mk1StandardMask2
            position = 0.0, 0.0, 0.175
        }
        MODEL
        {
            model = Squad/Spaces/OverlayMasks/Mk1StandardBorder2
            position = 0.0, 0.0, 0.175
        }
        MODULE
        {
            name = InternalCameraTargetHelper
        }
        MODULE
        {
            name = JSISetInternalCameraFOV
            fov = 70
        }

        MODULE
        {
            name = InternalSeat
            seatTransformName = Seat1
            portraitCameraName = CockpitCam
            allowCrewHelmet = false
            kerbalEyeOffset = 0, 0.02, 0
            displayseatName = #autoLoc_6002190 //#autoLoc_6002190 = Pilot Seat
        }
        MODULE
        {
            name = InternalCameraSwitch
            colliderTransformName = DockingTrigger
            cameraTransformName = DockingCam
        }

    cupolaInternal:
    Quote

    INTERNAL
    {
        name = cupolaInternal
        MODEL
        {
            model = Squad/Spaces/cupolaInternal/model
        }
        MODEL
        {
            model = Squad/Spaces/OverlayMasks/CupolaMask
            rotation = 90, 180, 0
        }
        MODULE
        {
            name = InternalCameraTargetHelper
        }
        MODULE
        {
            name = JSISetInternalCameraFOV
            fov = 70
        }

        MODULE
        {
            name = InternalSeat
            seatTransformName = pilot_seat
            allowCrewHelmet = false
            portraitCameraName = pilot_camera
            displayseatName = #autoLoc_6002190 //#autoLoc_6002190 = Pilot Seat
        }
        MODULE
        {
            name = InternalCameraSwitch
            colliderTransformName = collider_window_center
            cameraTransformName = transform_window_center
        }

  3. Then I loaded up the game and put a Mk1 Cockpit and Cupola on the runway with no difference to IVA viewpoint, even after changing the fov to 90 in the config (and restarting the game).
  4. In the Mk1 Cockpit internal.cfg I changed the kerbalEyeOffset values to see if any changes were coming through, but even changing all three values to 2 resulted in no notable change.
  5. Double checked to see if any changes are coming through by changing the position values for the Navball to 10 each and saw no notable change in-game (after a restart)

After those 5 tests I'm left wondering if the change is actually being pushed through, based off what I saw in the other thread it seems like I'm modifying the correct file, but I'm not seeing any difference when comparing to screenshots of the default view. If there's some other file I should be modifying please let me know.

Link to comment
Share on other sites

4 hours ago, Zanaten said:

After those 5 tests I'm left wondering if the change is actually being pushed through, based off what I saw in the other thread it seems like I'm modifying the correct file, but I'm not seeing any difference when comparing to screenshots of the default view. If there's some other file I should be modifying please let me know.

Sorry... Dont know if you saw my edit in that other thread, but you have to install RasterPropMonitor Adopted for those two added modules to work. They are from RPM, *NOT* stock modules.
Once you install it, those edits you quoted should work.
If you do NOT want the added RPM IVAs, modded *or* modified stock IVAs, you should be able to delete the GameData/JSI/RPMModPatches folder. If you want to keep the modified stock IVAs, just delete the /PatchesMod folder inside that one.

Link to comment
Share on other sites

Edit: Nevermind, it seems like the kerbalEyeOffset is now working correctly for me. Thanks for all your help!

@Stone Blue Sorry I had missed that, that's unfortunate as I'm trying to not use any mods. I appreciate you helping me sort that out though. One final related question which you might know the answer to, in the internal.cfg for some of the IVA's there's a kerbalEyeOffset value (kerbalEyeOffset = 0, 0.02, 0 for mk1CockpitInternal). I had tried adjusting that in hopes it would give me the effect I'm looking for but nothing I change in the internal.cfg seems to change things in the game. Do I have to use the ModuleManager even to make value changes in the config? I just can't figure out why none of the changes I'm making in the .cfg seem to be going through.

Thanks.

Edited by Zanaten
Link to comment
Share on other sites

1 hour ago, Zanaten said:

Do I have to use the ModuleManager even to make value changes in the config? I just can't figure out why none of the changes I'm making in the .cfg seem to be going through.

Are you restarting the game after making changes?   I suspect changes to the .cfg might not take effect until after reloading the game.

My experience has been you do not need MM to make changes to the .cfg.  I used to have to go into it to bind a few keys on a MacBook.  (That has been addressed, now can do it from settings..)

Link to comment
Share on other sites

Okay, so I wanted to follow up on this because I got it working well enough for my own purposes and wanted to share what I did.

Thanks to @Stone Blue sharing a post they helped with previously, I was able to find the internal.cfg config files that control the IVA's for different parts in \Kerbal Space Program\GameData\Squad\Spaces. I noticed in some of the internal.cfg files there was a line "kerbalEyeOffset" in the InternalSeat Module. By adjusting those Offset values you can move the camera around relative to the cockpit. I had also noted Stone Blue included a "hideKerbal = head" line though I have no clue if that's actually needed for the stock game, as the game seems to hide the head by default if your camera is far enough back.

Here is an excerpt from the Mk1 Cockpit internal.cfg file where I modified the kerbalEyeOffset = X (left-right), Y (up-down), Z (forward-back) values to change the camera position.

Quote

MODULE
    {
        name = InternalSeat
        seatTransformName = Seat1
        portraitCameraName = CockpitCam
        allowCrewHelmet = false
        kerbalEyeOffset = 0, -0.04, -0.08
        hideKerbal = head
        displayseatName = #autoLoc_6002190 //#autoLoc_6002190 = Pilot Seat
    }


Original IVA viewpoint for Mk1 Cockpit:
JayGBSu.png

Adjusted IVA viewpoint for Mk1 Cockpit:
R8CqE9G.png

Now when entering IVA view the user is able to see their instruments without needing to make any adjustments to their view, just press C and the view is automatically in the right spot. I'll be adjusting some of the other part's IVA's and doing further testing to make sure the Kerbal heads don't load and cause any issues. Thanks all for your input and help in getting me to this point, it will make using interiors a lot more fun and less work for the kids I'm building missions for!

Link to comment
Share on other sites

59 minutes ago, Zanaten said:

I had also noted Stone Blue included a "hideKerbal = head" line though I have no clue if that's actually needed for the stock game, as the game seems to hide the head by default if your camera is far enough back.

Yeah, what happens there, is, as long as the camera location is *inside* the model mesh of the Kerbal's head, you will never see the head.
Basically, only the *outside* skin of the mesh gets drawn... the *inside* is, well, invisible from the inside. So, if the camera is *just* in front of the mesh, you dont see the head, until you rotate the camera to one side, to the extreme edge of FOV... if you see the eyeballs, or part of the head appear, that means the camera location is placed in-front of, or too close to, the front of the Kerbal's head-mesh.

Good job on figuring that all out. And, yes, on each and every IVA, when they get created, depending on the "space" in the IVA model, and the props used, and placement of them, a good creator will adjust the camera offset properly.



 

Link to comment
Share on other sites

31 minutes ago, Stone Blue said:

Yeah, what happens there, is, as long as the camera location is *inside* the model mesh of the Kerbal's head, you will never see the head.

I've done some 3D Modeling in the past, so I'm familiar with the backface of models not being rendered by games. It actually seems like the head is unloaded when  I switch between the exterior view and IVA because if I turn the view full left or right, I can see the head for just a brief moment when entering IVA before it disappears. If it didn't get unloaded I'd still see the inside of the mouth, and I think also the Kerbal's pupils which I believe are a fully enclosed mesh clipping with the eyeball.

So the main thing I was wondering @Stone Bluewas if  the "hideKerbal = head" text string is something supported by stock Kerbal or if that relates to the mods you discuss in the other thread. It seems like the game is unloading the Kerbal's head anyway, but if the text string does force that state I'm definitely keeping it in the configs.

Link to comment
Share on other sites

@Zanaten so I just looked at both the KSP API Docgen, and the RPM source code.
Unfortunately, it does look like its an RPM key, and not stock :(

Heres the relevant keys available for the stock InternalSeat module, from the official API:

https://kerbalspaceprogram.com/api/class_internal_seat.html

Edited by Stone Blue
Link to comment
Share on other sites

8 minutes ago, Stone Blue said:

@Zanaten so I just looked at both the KSP API Docgen, and the RPM source code.
Unfortunately, it does look like its an RPM key, and not stock :(

Heres the relevant keys available for the stock InternalSeat module, from the official API:

https://kerbalspaceprogram.com/api/class_internal_seat.html

Thanks for sharing that, some bad news regarding what I'm trying to do, I just realized that the viewpoint for female Kerbal's is lower than the male's, which means that all the adjustments I made are obsolete if it's a female Kerbal.

The good news is if I have the kids use female Kerbal's:

1. It's better for representation as the number of women in aviation/aerospace is a tiny percentage compared to men.
2. The viewpoint is already lower, which is what I was generally adjusting anyway.

So I wanted to take note of that in case others ever want to shift the default view around. It's possible to do through config's, but be aware that it will adjust the view for both female and male Kerbal's which is different between the two.

Link to comment
Share on other sites

1 hour ago, Zanaten said:

Thanks for sharing that, some bad news regarding what I'm trying to do, I just realized that the viewpoint for female Kerbal's is lower than the male's, which means that all the adjustments I made are obsolete if it's a female Kerbal.

Good points on having only female kerbals used ;)

There *might* be a way to change the female viewpoint to equal the male one... meaning you *might* be able to mae your offsets universal across the two.

If you open the Settings. cfg, in the main KSP folder, go down to line 281, or search for "female", in it.
It should take you to 4 lines regarding female eye offset... the last, scale offset caught my eye (pun intended? :P)
Looks like its defaulted to 2.03... you *could* try playing with that (I would start by setting it to 1.00 ??)... to see if you get it close to equalling whatever the default is for the males..??

Or try setting the Z_OFFSET to 0.00... it looks like its set for ~3.4 CM??.. I assume offset that much from the male position..??

Again, this is spitballing, as I havent tested or played with editing it. I also do not know if this is strictly for EVA view, IVA view, or both..??

Edited by Stone Blue
Link to comment
Share on other sites

On 3/11/2022 at 8:08 PM, Stone Blue said:

If you open the Settings. cfg, in the main KSP folder, go down to line 281, or search for "female", in it.
It should take you to 4 lines regarding female eye offset... the last, scale offset caught my eye (pun intended? :P)

@Stone Blue Huge thanks for directing me to that file, I've got it all figured out now. The offset isn't as straightforward as I had hoped, zeroing the Female offset out doesn't automatically match the Male Kerbal viewpoint.However, I have it set so that the viewpoints are practically identical, with just the tiniest height difference between the two but it's close enough for my needs.

While I mentioned previously how to adjust the viewpoint in IVA, if you're wanting to match the location of the female and male viewpoints, you need to adjust the Y Offset and set the Offset Scale to 1. Here are the settings I used in the settings.cfg file:

Quote

FEMALE_EYE_OFFSET_X = 0
FEMALE_EYE_OFFSET_Y = 0.076
FEMALE_EYE_OFFSET_Z = 0.03378779
FEMALE_EYE_OFFSET_SCALE = 1

A side note about the camera clipping with Kerbal's heads:

When going from an external view to an IVA, the Kerbal's head is unloaded. When in IVA and switching seats/command parts the Kerbal's head is NOT unloaded, so you can sometimes see the model for the pupil floating in front of the camera. This is hidden by hitting C to go back to external view, then C again to re-enter IVA which will unload the Kerbal's head.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...