CommonLibSSE NG is a fork of CharmedBaryon's CommonLibSSE-NG, itself a fork of CommonLibSSE, which tracks upstream updates but adds a number of enhancements. It supports Skyrim Special Edition (SE), Skyrim Anniversary Edition (AE), and Skyrim Virtual Reality (VR).
To develop a C++ project that uses CommonLibSSE, you'll want to have this code available for discovery, and included as a build dependency by your build manager. Below are examples using the xmake or cmake managers.
Tip
For examples & templates see the wiki: https://github.com/alandtse/CommonLibVR/wiki/Projects-using-CommonLib
Assuming you have a folder with your mod material, this can be converted to a git repository, for which this repo can be added as a submodule, allowing git to manage updates, paths, names, versions... To do this:
Use the folder to initialize a git repository:
PS E:\Git\foo-bar> git init
Initialized empty Git repository in E:/Git/foo-bar/.git/Add this CommonLibSSE repo as a git submodule, specifying the ng branch,
and storing it in lib/commonlibsse-ng folder:
PS E:\Git\foo-bar> git submodule add -b ng https://github.com/alandtse/CommonLibVR.git lib/commonlibsse-ng
Cloning into 'E:/Git/foo-bar/lib/commonlibsse-ng'...
remote: Enumerating objects: 66210, done.
remote: Counting objects: 100% (2526/2526), done.
remote: Compressing objects: 100% (197/197), done.
remote: Total 66210 (delta 2397), reused 2335 (delta 2329), pack-reused 63684 (from 1)
Receiving objects: 100% (66210/66210), 18.99 MiB | 19.58 MiB/s, done.
Resolving deltas: 100% (51252/51252), done.
PS E:\Git\foo-barTip
If your submodule ended up in a location where the rest of the code can't find it, you can remove & re-add submodules, see https://stackoverflow.com/a/1260982
At this point, git is tracking changes to your code in your machine. You can add a cloud-based remote for backup, distribution, or collaboration; instructions are here for GitHub or CodeBerg.
To update your project's submodules you can use:
PS E:\Git\foo-bar> git submodule update --init --recursiveIf using the Xmake build system, you can add a build dependency and a custom rule suitable for SKSE plugins by adding this to your DLL target recipe:
target("my_plugin")
set_kind("shared") --specifies this is a DLL
add_deps("commonlibsse-ng") --adds the dependency
add_rules("commonlibsse-ng.plugin", { --adds a custom build rule, whose details are in CommonLibSSE
name = "my_plugin",
author = "Dovahkiin",
description = "SKSE64 plugin using CommonLibSSE-NG"
})If using the CMake build system, you can add the following in CMakeLists.txt to compile and link successfully:
find_package(CommonLibSSE REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC CommonLibSSE::CommonLibSSE)CommonLibSSE NG has support for Skyrim SE, AE, and VR, and is able to create builds for any combination of these runtimes, including all three. This makes it possible to create SKSE plugins with a single DLL that works in any Skyrim runtime, improving developer productivity (only one build and CMake preset necessary) and improving the end-user experience (no need to make a choice of multiple download options or select the right DLL from a FOMOD). For Skyrim AE, both versions before 1.6.629 and those after are supported in a single DLL (both struct layouts are supported).
Builds that target multiple ABI-incompatible runtimes provide the necessary (but minimal) abstractions needed to work transparently regardless of the Skyrim edition in use. All functionality and classes from all runtimes is always available for potential use, with the necessary support for probing the features available. This allows single plugins that dynamic alter their behavior to take advantage of the specific features of a single Skyrim edition (e.g. VR features) when that runtime is present.
Read about multi-targeting, and how you can take advantage in your project.
Historically, plugins needed to define SKSEPlugin_Version or SKSEPlugin_Query to be detected as SKSE plugins. To
simplify code and ensure both functions are generated for correct cross-runtime compatibility, this is made code-free in
CommonLibSSE NG. Just replace add_library with add_commonlibsse_plugin in CMakeLists.txt and CMake will create
your shared library target, configure CommonLibSSE linkage, and auto-generate this content and inject it into the
plugin.
find_package(CommonLibSSE REQUIRED)
add_commonlibsse_plugin(${PROJECT_NAME}
SOURCES ${headers} ${sources})Read more on the project wiki.
Clang 13.x and newer are supported when built for MSVC ABI compatibility (versions built natively for Windows). It is even hypothetically possible, with the proper setup, to cross-compile with Clang from a Linux host (testing and instructions for this are pending). Note that currently linking must still be done with the Microsoft linker, pending fixes to SKSE itself.
Read more on the project wiki.
Improvements have been made to the way in which the Skyrim executable module is accessed for the sake of memory relocation and handling of Address Library IDs. This makes it easier to run CommonLibSSE-based plugin code outside of the context of a Skyrim process so that unit testing is possible. It is even possible to handle a minimal level of functionality from the engine by loading in a Skyrim executable module programmatically during testing, allowing, for example, tests to be run within a single test suite that vary between SE, AE, and VR executables.
Read more on the project wiki.
Warning
These are not part of this repository and are not currently maintained.
Older versions of CommonLibSSE, specifically CharmedByron's, are (were) available as a vcpkg port and as a Conan package. These are not maintained as part of this project.
See how to use CommonLibSSE NG in your project.
CommonLibSSE NG migrates the build system to Ninja, resulting in faster parallel builds than NMake.
- Ability to define offsets and address IDs for objects which can exist in only a subset of runtimes, while being able dynamically test for feature support before using those offsets.
- Completely regenerated RTTI and vtable offsets, now with consistent naming and access across all runtimes.
- Updated GitHub Actions CI workflows to build for all likely target runtime combinations.
- Fully extensible native function binding traits (enables custom script object bindings in Fully Dynamic Game Engine).
- Better support for the CLion IDE.
Dependencies are managed via vcpkg. See vcpkg.json for the complete list.
Core Dependencies:
- fmt 12.1+
- rapidcsv 8.9+
- spdlog 1.16+
- xbyak 7.28+
- catch2 3.1.0+ (for testing)
- directxmath 2025-04-03 - DirectX Math library
- directxtk 2025-10-27 - DirectX Toolkit
Build Tools:
- Visual Studio 2022 - Desktop development with C++
- CMake 3.19+
- Vcpkg
- CommonLib is incompatible with SKSE and is intended to replace it as a static dependency. However, you will still need the runtime component.