• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Max_Killjoy

General
May 1, 2018
2.357
0
Has anyone found a tweakable zoom variable in the config files?

I'd really like to be able to zoom out even another 50%, there are maps where I feel like I'm trying to read a book with my face pressed up against the page... in the dark...
 
I'm bumping this, has anyone found the relevant file or option? It looks like the setting is probably hardcoded in the Assembly dll (found a lot of UI and camera references using a decompiler) or the setting is saved in an asset bundle (of which there are... a lot).

I'm interesting in increasing the maximum amount we're able to zoom out by about 50%.
 
So... there definitely is not a user-accessible setting for that yet.

Those numbers are located on our game camera prefab. Being probably the least technical programmer on our team, I'm not sure how Unity Prefabs get built into the final package you download... One of you all might have a better answer for that!

However! I'm going to start exposing more of these through CombatGameConstants.json soon. I don't have an exact timeline for you on when I'll be able to fit this into a patch.

p.s. the name of the setting on the prefab is "MaxHeightAboveTerrain"... I don't know if that's helpful at all for people doing a decompiler search for it? (If you're so inclined, and don't want to wait)
 
[...]the name of the setting on the prefab is "MaxHeightAboveTerrain"[...]
Awesome, thank you!

edit: for those who can edit it, the setting is under BattleTech.CameraControl, on line 2357.

By default it reads:

// Token: 0x04003495 RID: 13461
[SerializeField]
private float MaxHeightAboveTerrain = 200f;​
 
Hmmm it would be interesting to know how to edit it. The value being used in-game is actually 520, which is the number on the prefab, and overrides that 200 default from code.
That makes sense, since editing it to 350f didn't have any effect. It seems that the code overriding it either isn't in Assembly-CSharp.dll or there's another routine populating MaxHeightAboveTerrain that dnSpy isn't detecting.

edit: I am outside my depths, someone with more reverse-engineering experience than me is needed to find where MaxHeightAboveTerrain is defined such that we can control it.
 
Last edited:
Sneak peek time!

Here is an early look at the new section being put into CombatGameConstants.json.

Please note: I've moved pretty much every camera variable into this file. I figure people will appreciate being able to edit a lot of this stuff, but some edits could possibly break the game, so as usual... use at your own risk :) Also, this is still very early in testing, so final format may be slightly different if bugs need to be fixed. Also I've already removed about 6 variables that weren't being used any more, and I might have missed more... o_O

"CameraConstants":
{
"MoveSpeed" : 90.0, /* acceleration of the camera */
"MaxSpeed" : 30.0, /* max top speed of the camera */
"MoveFalloff" : 0.7, /* this controls "friction" which slows the camera's momentum */
"ZoomSpeed" : 1500.0, /* how fast the camera zooms in and out, under player control */
"RotationSpeed" : 16.0, /* how fast the camera rotates via right mouse hold */
"RotationSpeedKeyboard" : 16.0, /* how fast the camera rotates via Q and E */
"TargetRotLerpFactor" : 0.05, /* how fast the camera will try to rotate to face its target during a camera sequence */
"EdgePushSize" : 0.025, /* the size of the "screen edge", where it will start pushing the camera */
"EdgeAutoZoomSize" : 0.05, /* the size of the "screen edge" when determining if the camera needs to refocus on an object */
"MinDistToFocalPoint" : 50.0, /* how close you can move the camera to its focal point */
"MinHeightAboveTerrain" : 20.0, /* minimum height the camera must be above terrain */
"MaxHeightAboveTerrain" : 520.0, /* maximum height the camera can reach above terrain, or to its focal point */
"MinAngle" : 10.0, /* how close you can get to looking flat toward the horizon - degrees */
"MaxAngle" : 75.0, /* how close you can get to looking vertically straight down - degrees */
"DefaultAngle" : 40.0, /* the starting vertical angle */
"DefaultFOV" : 35.0, /* default Field Of View that the camera will always return to from zoom-in cams */
"TutorialMoveTime" : 3.0, /* in first tutorial level... how long to pause after first successful "move" of camera before proceeding */
"TimeBetweenTutorials" : 1.0, /* ... time to pause before second tutorial */
"TutorialRotateTime" : 3.0, /* ... how long to pause after first successful "rotate" of camera before proceeding */
"TargetCamPosMultiplierSide" : 1.8, /* over-the-shoulder targeting cam - adjusts distance to the side of the firing mech */
"TargetCamPosMultiplierBack" : 4.5, /* over-the-shoulder targeting cam - adjusts distance back from the firing mech */
"TargetCamPosMultiplierHeight" : 1.2, /* over-the-shoulder targeting cam - adjusts distance up from the firing mech */
"TargetCamTime" : 0.4, /* time to move into over-the-shoulder cam */
"RestorePlayerCamTime" : 0.7, /* time for camera to move back to player controlled cam */
"MovementCamTime" : 1.25, /* time to move into position to show enemy moves (high angle) */
"ShowAttackCamTime" : 3.0, /* for non-cinematic zoom, time to move camera into final position */
"ShakyCamTime" : 4.0, /* for cinematic zoom on enemy movements, minimum time for the whole sequence (note, sequence can still be shorter than this) */
"ShakyCamOffset" : 0.5, /* max position change when showing "shaky" zoom-in cam */
"ShakyMoveCamHeightMultiplier" : 2.6, /* controls height when showing follow cam, and "fancy" melee cam */
"FollowCamGroundMin" : 1.5, /* settings for the follow cam... min height from ground */
"FollowCamIdealHeight" : 1.5, /* ... ideal height from ground */
"FollowCamMinDistMult" : 2.0, /* ... min and max follow dists (multiplied by height of unit) */
"FollowCamMaxDistMult" : 5.0,
"FollowCamTime" : 1.0, /* ... controls how "lazy" the camera is in follow mode. Max value of laziness is, of course, infinite */
"FollowCamDelayTime" : 1.0, /* ... at end of move, how long to pause before returning to player control */
"CutAngleTolerance" : 45.0, /* when you've zoomed in, and the angle is now greater than this amount, just cut back to player cam position instead of smoothing */
"FramingSafeMultiplier" : 1.5, /* used in low-level camera framing code, to figure out when to zoom to keep a point in frame */
"FramingZoomMultiplier" : 0.015, /* when auto-framing, this controls how far back to zoom */
"FrameRightMultiplier" : 2.0, /* framing constants, since the screen is not a square */
"FrameUpMultiplier" : 4.0,
"TimeToShowNewBlips" : 2.5, /* when zooming to newly revealed contacts, how long to show them */
"MeleeAttackCamMinHeight" : 85.0, /* used for non-cinematic purposes when showing units - for melee cam, as well as death cam */
"CamDelayDeath" : 4.0, /* this section controls delays for different events */
"CamDelayBuildingDeath" : 4.5,
"CamDelayFall" : 4.0,
"CamDelayLocationDestroyed" : 3.0,
"CamDelayCriticalHit" : 2.0,
"CamDelayComponentDestroyed" : 2.0,
"CamDelayPilotInjured" : 3.0,
"CamDelayPilotInspired" : 3.0,
"CamDelayMiscInfo" : 1.5,
"CamMultiplierSlowMove" : 10.0 /* this multiplier controls "slow start" camera zooms: mission begin, mission end, and non-cinematic player attack zooms */
},
 
The Cam Delays might actually work to remove some of the hiccups in the sequence of a mech taking serious damage or being destroyed... just personally, I'd rather have that play out at closer to normal speed, it just feels laggy rather than dramatic to me.
 
@HBS_TwoCents lol now you drop this, I just spent 4-5 hours modding that camera height. https://www.nexusmods.com/battletech/mods/160?tab=description

Two question.

  1. There is a very clear, ugly fog-line drawn a fixed distance from the camera. You can see it here: https://staticdelivery.nexusmods.com/mods/2388/images/160/160-1527278294-2076956669.jpeg can you open up the variable that sets the distance at which this is drawn? I'd love to push it waaaay back or eliminate it entirely.
  2. Even with all the dynamic camera stuff disabled, we still get the camera yanked from our control when new enemies appear on the sensor. Can you please open that variable up, or if not, give us the function name that controls it? edit: this may be what you at HBS call the Reveal-a-tron.
Thanks mate!
 
Last edited:
@HBS_TwoCents lol now you drop this, I just spent 4-5 hours modding that camera height. https://www.nexusmods.com/battletech/mods/160?tab=description

Two question.

  1. There is a very clear, ugly fog-line drawn a fixed distance from the camera. You can see it here: https://staticdelivery.nexusmods.com/mods/2388/images/160/160-1527278294-2076956669.jpeg can you open up the variable that sets the distance at which this is drawn? I'd love to push it waaaay back or eliminate it entirely.
  2. Even with all the dynamic camera stuff disabled, we still get the camera yanked from our control when new enemies appear on the sensor. Can you please open that variable up, or if not, give us the function name that controls it? edit: this may be what you at HBS call the Reveal-a-tron.
Thanks mate!

D'oh! Well, at least you have the camera height working right now... my change still has to go into a build, through a full QA cycle, and get packaged up with other changes, before it makes it out to y'all.

Answers:
  1. I have no clue, but I forwarded this to our technical artist to see what he has to say.
  2. That is a bug - it's just not correctly checking that setting in the settings menu. I appreciate the reminder... it got me looking into that bug, and I think I found where it's happening.
    1. If you do want to try to mess with this... I don't actually know the extents of your magical modding powers, but there is a function called TurnEventNotification.OnFirstContact(MessageCenterMessage message). If you could somehow stop that from firing at all, the camera wouldn't zoom over; but, you'd also lose the notification that says "Enemy Contact"
    2. Alternately, you could look for CameraControl.SetMovingToGroundPos(Vector3 i_dest, float screenRatio = 0.95f). If you stopped that, it would fix this issue; but it would also break the ability to middle-click on a spot to focus on it, or click on screen edge indicators, or objectives. Probably the first change would be less invasive.
btw we are all super impressed by what the mod community has been able to pull off so far!
 
p.s. the Reveal-a-tron actually just reveals a part of the fog of war... like when an objective says "I've detected enemy units" and you get a little patch of fog cleared for a moment, so you can see the enemies there.