How soulsmods/modengine2 works
Mod Engine 2 injects runtime modding support into supported Souls games. The principal flow is launcher configuration and game startup, followed by DLL initialization, settings/game detection, extension attachment, and runtime hooks, patches, and scripts. The graph also preserves documented profiling, crash reporting, debugging, and multi-mod loading capabilities. Edges are limited to relationships visible in excerpts, the SOURCE INDEX, or README; several extension internals are unsampled, so their implementation-level links are omitted.
Main entry points: mod_engine.cpp ModEngine runtime · main.cpp DLL entrypoint · launcher.cpp Mod launcher · crash_handler.cpp Crash handling
Components 22
Launch and configuration
- Mod launcher
launcher/launcher.cpp - Steam game location
launcher/steam_app_path.cpp - TOML settings
include/modengine/settings.h - Settings loading
src/modengine/settings_loader.cpp
Runtime core
- DLL entrypoint
src/main.cpp - Game detection
src/modengine/game_info.cpp - ModEngine runtime
src/modengine/mod_engine.cpp - Extension API
include/modengine/extension.h - Extension registry
src/modengine/extension_set.cpp - Hook management
src/modengine/hook_set.cpp - Memory scanning
include/modengine/util/memory_scanner.h
Extensions
- Mod file overrides
src/modengine/ext/mod_loader/archive_file_overrides.cpp - Multiple mod configuration
src/modengine/ext/mod_loader/mod_loader_extension.cpp - DS3 debug menu
src/modengine/ext/debug_menu/ds3/debug_menu_ds3.cpp
Creator tooling
- Optick profiling
src/modengine/ext/profiling/profiling_extension.cpp - Lua scripting
src/modengine/script_host.cpp - Script patch API
src/modengine/scripting/api_patch.cpp
Diagnostics
- Crash handling
src/modengine/crash_handler.cpp - Crash dump database
- ScyllaHide integration
src/modengine/ext/scylla/scyllahide_extension.cpp
Other components
- Game user
- Supported game
Connections 22
- Game user → Mod launcher: launches
- Mod launcher → Steam game location: locates game
launcher/launcher.cpp - Mod launcher → Supported game: starts with DLL
- Mod launcher → DLL entrypoint: passes configuration
- DLL entrypoint → Crash handling: starts handler
src/main.cpp - DLL entrypoint → Settings loading: loads settings
src/main.cpp - DLL entrypoint → Game detection: detects game
src/main.cpp - DLL entrypoint → ModEngine runtime: creates and attaches
src/main.cpp - Settings loading → TOML settings: parses TOML
- ModEngine runtime → Extension registry: loads extensions
src/modengine/mod_engine.cpp - ModEngine runtime → Mod file overrides: registers extension
src/modengine/mod_engine.cpp - ModEngine runtime → Optick profiling: registers extension
src/modengine/mod_engine.cpp - ModEngine runtime → ScyllaHide integration: registers extension
src/modengine/mod_engine.cpp - ModEngine runtime → DS3 debug menu: references extension
src/modengine/mod_engine.cpp - ModEngine runtime → Hook management: installs hooks
src/modengine/mod_engine.cpp - ModEngine runtime → Memory scanning: scans for patches
src/modengine/mod_engine.cpp - Extension API → Hook management: registers hooks
include/modengine/extension.h - Extension API → Memory scanning: exposes scanning
include/modengine/extension.h - ModEngine runtime → Script patch API: binds patch API
src/modengine/mod_engine.cpp - ModEngine runtime → Lua scripting: loads scripts
src/modengine/mod_engine.cpp - Crash handling → Crash dump database: initializes database
src/modengine/crash_handler.cpp - Crash handling → Game user: uploads reports