- C++ 88.9%
- Python 9.6%
- Just 0.4%
- PowerShell 0.4%
- CMake 0.3%
- Other 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .agents/skills | ||
| docs | ||
| extern | ||
| proxy | ||
| src | ||
| tests | ||
| tools | ||
| .clangd | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| CMakeLists.txt | ||
| justfile | ||
| LICENSE | ||
| NEXT_STEPS.md | ||
| README.md | ||
| RESEARCH.md | ||
stellaris-access
A Windows native-code accessibility mod for Stellaris (Paradox grand strategy, Clausewitz engine). A version.dll proxy placed next to stellaris.exe is loaded by Windows as the game starts and loads the mod DLL; the DLL hooks engine functions, synthesises keyboard navigation over views the engine doesn't make accessible, and routes UI text to a screen reader via Prism.
License: GPL-3.0-or-later (matches stellarstellaris-win, which we draw inspiration from). See LICENSE.
Status
Targets Stellaris Corona Borealis v4.6.0 (3d1a) on Steam. Keyboard navigation with screen-reader announcements covers:
- Front end: main menu, settings, save / load, new-game setup, empire picker, galaxy setup, start screen.
- Main HUD: Ctrl+Tab regions (map, top bar, notifications, sidebar, outliner, fleet panel, bottom bar), the system scanner as a keyboard pointer over the map, map modes, and the order menu.
- Windows: planet view, fleet view, Fleet Manager and Ship Designer, starbase, technology, traditions, government (council, factions, edicts and policies), leaders, contacts and diplomacy, archaeology, Situation Log, and the Databank.
- Popups: events, dialogs, advisor and tutorial windows.
- Tooltips: plain Space opens the focused element's full tooltip, with drill-down into its lines and linked concepts (Ctrl+Space stays the game's pause).
Several of these are new and still being hand-tested; see NEXT_STEPS.md for what is open.
Target build
Pinned to a specific Stellaris release; patterns derived against one build are not guaranteed to work on another. See RESEARCH.md for the version string, branch, and revision.
Requirements (build host)
- Windows 10/11 x64.
- Visual Studio 2022 Build Tools or newer (MSVC
cl.exefor x64). Tested with Build Tools 2026 / Dev18. - CMake 3.25+.
- Ninja on
PATH(winget install Ninja-build.Ninja). - just on
PATH(winget install Casey.Just). gitwith submodule support.
Build
The preferred entry point is just. The recipes wrap cmake and source vcvarsall.bat x64 internally, so any shell works — no Developer PowerShell needed.
git submodule update --init --recursive
just build # Release (default)
just debug # Debug
just relwithdebinfo
just clean # wipe build/
just rebuild # clean + build
The first invocation generates build/ with the Ninja Multi-Config generator (Debug / Release / RelWithDebInfo share one folder), which also emits compile_commands.json for clangd.
If you'd rather skip just, the underlying commands are:
cmake -G "Ninja Multi-Config" -B build
cmake --build build --config Release
…run from a Developer PowerShell (or after sourcing vcvarsall.bat x64).
Output lands in build\bin\:
accessibility.dll— the mod itself.accessibility.pdb— debug symbols for the DLL. Built in every config (Release included) so Paradox'sCrashReporter.execan resolve frames inside our code. Ship it next to the DLL.version.dll— the import proxy.stellaris.exeimportsversion.dll, and Windows looks in the game folder beforeSystem32, so our copy is loaded as the game starts. It forwards every export to the realSystem32\version.dlland loadsaccessibility.dllfrom beside itself; the mod then waits for the game window before it starts.
No nvdaControllerClient.dll is needed: Prism's NVDA backend talks to NVDA over compiled-in RPC. (An old copy left in the game dir from an earlier SRAL-based build is unused and can be deleted.)
Daily play
just install. This builds, thencmake --installsversion.dll+accessibility.dll+ PDB into the game dir, next tostellaris.exe. No game file is edited, so a game update does not undo it.- Launch Stellaris the way you always do (Steam or the Paradox launcher). Accessibility comes on once the game window appears.
- Press an arrow key in the front-end menu — your screen reader (NVDA / JAWS / Windows Narrator / SAPI) should announce the focused button's label.
just uninstallremoves the three files again.
To switch the mod off without uninstalling — say a launch keeps crashing — create an empty file named accessibility.disabled next to version.dll; the game then starts unmodded.
Dev iteration
just run builds, installs into the game folder as above, then starts stellaris.exe directly and returns to the shell immediately. With the dev marker %LOCALAPPDATA%\StellarisAccess\devserver present, just reload builds again and swaps the new accessibility.dll into the running game.
Logs
The DLL writes two log files under %LOCALAPPDATA%\StellarisAccess\ (both append-mode, one block per attach):
stellaris-access.log— general operational events. Read this first when something is wrong (failed hooks, missed AOB patterns, speech init failures). The speech backend Prism picked is logged asspeech backend (init): <name>, and again (rebind) whenever output fails and the mod re-picks one — e.g. after you start your screen reader with the game already running.stellaris-access-speech.log— one line per utterance (per chunk, for text over 700 bytes), written when the mod hands it to the speech thread, recording exactly the text the backend receives. Useful for auditing what the mod is saying.
Troubleshooting
| Symptom | Likely cause |
|---|---|
[install] Stellaris is running and holds version.dll |
Close the game (just stop) and re-run, or just reload to swap only accessibility.dll into it. |
| Game starts but the mod never loads | Read %LOCALAPPDATA%\StellarisAccess\version-proxy.log: it says whether the proxy attached and why it skipped the mod (kill switch, accessibility.dll missing, wrong host). |
| Mod loads but no speech | No screen reader / TTS engine Prism recognises is running. Check the log for speech backend / prism_init failed. NVDA, JAWS, and other screen readers Prism supports should work, with SAPI as the fallback. |
| The game will not start at all | Create an empty accessibility.disabled next to version.dll (or just uninstall), then check stellaris-access.log for a FAULT line. |
Project layout
.
├── CMakeLists.txt # root build
├── extern/
│ ├── minhook/ # x64 inline hooks (submodule)
│ ├── prism/ # screen-reader / TTS abstraction (submodule)
│ └── spdlog/ # logging (submodule)
├── proxy/
│ ├── CMakeLists.txt
│ ├── version.def # the 17 version.dll export names
│ ├── version_proxy.cpp # forwards to System32\version.dll, loads + dev-reloads accessibility.dll
│ └── gfvibh_thunk.asm # tail-jump for the undocumented GetFileVersionInfoByHandle
└── src/
├── CMakeLists.txt
├── dllmain.cpp # sa_core_start / sa_core_stop, called by the proxy
├── logger.{hpp,cpp} # spdlog → %LOCALAPPDATA%\StellarisAccess\*.log
├── speech.{hpp,cpp} # speech chokepoint: Prism on its own thread (writes speech.log)
├── pattern_scan.{hpp,cpp} # AOB scanner over .text of stellaris.exe
├── hooks.{hpp,cpp} # bring-up order for every nav module
├── localisation_hook.{hpp,cpp} # sa::loc::resolve(key) → UTF-8 current-language text
├── input_pump.{hpp,cpp} # single CGui::HandelInput detour, dispatches to preprocessors
├── markup_strip.{hpp,cpp} # strip Paradox bitmap/colour markup before speaking
├── coop_sp_setup_nav.{hpp,cpp} # lifecycle gate for SP/coop setup overlays
├── menu_nav.{hpp,cpp} # in-game ESC menu + front-end main menu
├── settings_nav.{hpp,cpp} # settings overlay (tabs, spinners, scrollbars, edit boxes)
├── setup_nav.{hpp,cpp} # new-game setup view
├── picker_nav.{hpp,cpp} # empire-preset picker (two-pane, tree)
├── tooltip_nav.{hpp,cpp} # Alt+I tooltip drilldown
└── engine/ # shared primitives every nav module pulls in
├── constants.hpp # engine ABI: offsets, addresses, SDLK keycodes
├── mem.hpp # resolve() + read_at<T> + CString/CPdxArray helpers
├── hook.hpp # MH_CreateHook wrapper with logging
├── event.hpp # for_each_keydown<Fn> walker + KeyDown view
└── button.{hpp,cpp} # button activate / drive_hover / discover_label
See AGENTS.md for contributor instructions, the architecture guide for implementation details and RESEARCH.md for engine-ABI reverse-engineering notes.
Out of scope
In-game surfaces (outliner, topbar, popups, map labels, planet/tech/diplomacy views), save-game introspection, mod-manager integration, multi-language polish, cross-version pattern resilience. See NEXT_STEPS.md for the post-MVP backlog.
Acknowledgements
- MattMills/stellarstellaris-win — closest prior art for a C++ hooking DLL in Stellaris.
- khalladay/hooking-by-example — x64 trampoline / hooking reference.
- TsudaKageyu/MinHook, ethindp/prism, gabime/spdlog — vendored as submodules.