Simple hold-to-zoom feature for Starfield
Overview β’ Features β’ Installation β’ Usage β’ Configuration β’ Building β’ License
StarZoom is a native SFSE plugin for Starfield, built on CommonLibSF. Hold a key (keyboard or gamepad) in first- or third-person view and the camera's FOV smoothly zooms in; release it and the FOV eases back to normal.
It drives the game's own fFPWorldFOV:Camera/fTPWorldFOV:Camera settings
(via RE::INIPrefSettingCollection/RE::INISettingCollection) β the same
values the renderer itself reads for first-/third-person FOV β rather than
touching any camera/scene-graph memory directly. See
How it works below. The same mechanism optionally scales
fMouseHeadingSensitivity:Controls alongside it, so aim doesn't feel twitchy
at a narrower zoomed-in FOV.
By using this project you agree to comply with the CommonLibSF license, which is GPL-3.0-or-later WITH Modding Exception AND GPL-3.0 Linking Exception (with Corresponding Source). In short: if you distribute a compiled binary linked against CommonLibSF, you must also make the corresponding source available.
- Per-view toggle β zoom in first person only, third person only, or both.
- Smooth ease in/out β a smoothstep transition (zero velocity at both ends) instead of an abrupt cut, so the zoom never jolts when the hotkey is pressed, released, or tapped quickly mid-transition.
- Keyboard hotkey β any virtual-key code, configurable.
- Gamepad support β any XInput button bitmask also triggers the zoom (default: Left Stick button / LSB), independently of the keyboard hotkey.
- Config-driven β target FOV and transition speed are both adjustable without recompiling.
- Mouse sensitivity compensation β optionally scales sensitivity down while zoomed, in proportion to how much the FOV has narrowed, so aim doesn't feel twitchy at low zoom FOVs.
- Hot reload β press a key (default F3) in-game to apply
StarZoom.iniedits without restarting.
- Install SFSE, Address Library for SFSE Plugins and StarZoom.
- Copy
StarZoom.dllandStarZoom.iniintoData\SFSE\Plugins\in your Starfield install folder. - Launch the game via
sfse_loader.exe.
Hold the configured hotkey (default: C on keyboard, LSB/Left Stick button
on an XInput gamepad) in first- or third-person view to zoom in. Release it
to ease back to the normal FOV.
Edit StarZoom.ini next to the DLL (created with defaults on first launch if
missing):
| Key | Default | Description |
|---|---|---|
Hotkey |
67 |
Virtual-key code of the hold-to-zoom key (67 = C) |
GamepadButton |
64 |
XInput button bitmask that also holds-to-zoom (64 = Left Stick button / LSB; 0 disables) |
ZoomFOV |
60.0 |
FOV in degrees while the hotkey is held |
ViewMode |
2 |
Which view(s) the hotkey zooms in (0 = first person only, 1 = third person only, 2 = both) |
SmoothSpeed |
8.0 |
Ease-in/ease-out speed for the zoom transition (higher = snappier) |
ReloadKey |
114 |
Virtual-key code that reloads this file without restarting the game (114 = F3) |
ScaleMouseSensitivity |
1 |
Whether to scale mouse sensitivity down while zoomed (1 = on, 0 = off) |
SensitivityExponent |
2.5 |
How aggressively sensitivity is cut at a given zoom level (only while ScaleMouseSensitivity=1); 1.0 scales linearly with FOV, higher cuts harder |
Press the reload key (default F3) in-game after editing StarZoom.ini to
apply changes immediately β no restart needed.
For a full list of decimal keyboard and gamepad (XInput) codes, see the Keybind Reference PDF in the Files tab on this mod's Nexus page.
- XMake 3.0.0+
- C++23 compiler: MSVC (Build Tools for Visual Studio, no full IDE required) or Clang-CL
lib/commonlibsf (and its own nested lib/commonlib-shared dependency) is a
git submodule. Fetch it with:
git submodule update --init --recursivexmake buildThis produces StarZoom.dll under build/windows/x64/....
xmake project -k vsxmakegenerates a vsxmakeXXXX/ solution if you'd rather build/debug from the
Visual Studio IDE.
βββ src/
β βββ PCH.h Precompiled header (CommonLibSF + STL includes)
β βββ Plugin.cpp SFSE entry point (SFSE_PLUGIN_LOAD)
β βββ Config.h / .cpp StarZoom.ini load / defaults
β βββ Hooks.h / .cpp DXGI swapchain Present hook install
β βββ Input.h / .cpp Keyboard + XInput hotkey polling
β βββ FOVController.h / .cpp Per-frame FOV transition + INI setting write
βββ dist/StarZoom.ini Default config, shipped alongside the DLL
βββ lib/commonlibsf/ CommonLibSF (git submodule)StarZoom IAT-hooks the game's own import of CreateDXGIFactory2 (the
standard D3D12 bootstrap call) as a trigger to check
RE::CreationRendererPrivate::Renderer's own DXGI factory pointer β a
CommonLibSF-exposed, Address-Library-resolved pointer into the game's
renderer, and the actual source of truth. Once that pointer reports a real
factory, StarZoom hooks IDXGIFactory2::CreateSwapChainForHwnd on it to
catch the game's real swapchain the moment it's created, then hooks that
swapchain's Present for a per-frame callback. A background thread polls
the same renderer pointer directly as a fallback, with no timeout, in case
the import hook can't attach on a given Starfield build. See the comments in
Hooks.cpp for more detail.
This project is licensed under GPL-3.0-or-later WITH Modding Exception AND GPL-3.0 Linking Exception (with Corresponding Source).
