How aurirex/gtfo_thearchive works
Purpose and deliverables
TheArchive is a Windows/.NET mod suite for GTFO. It is split into three mod assemblies: shared runtime/framework (TheArchive.Core), player-facing QoL/cosmetic features (TheArchive.Essentials), and Discord/Steam presence integration (TheArchive.RichPresence). The solution entry point is TheArchive.sln; each assembly has its own module entry class:
• TheArchive.Core/MainArchiveModule.cs
• TheArchive.Essentials/ArchiveEssentialsModule.cs
• TheArchive.RichPresence/ArchiveRichPresenceModule.cs
Bootstrap and loader boundary
Core owns startup and abstracts game-mod loader integration. Bootstrap code discovers/loads modules and types, while loader adapters isolate BepInEx and MelonLoader-specific concerns:
• TheArchive.Core/ArchiveBootstrap.cs
• TheArchive.Core/Core/Bootstrap/ArchiveModuleChainloader.cs
• TheArchive.Core/Loader/BIE_LoaderWrapper.cs
• TheArchive.Core/Loader/ML_LoaderWrapper.cs
The game/loader invokes the mod assembly; Core then establishes logging, module loading, initialization timing, and shared services before feature modules run.
Module discovery and lifecycle
Modules implement Core contracts and are annotated with dependency, incompatibility, and initialization metadata. The chainloader/type loader is the principal reflection boundary; it converts discovered assemblies/types into module metadata and schedules initialization based on game readiness interfaces.
• TheArchive.Core/Core/IArchiveModule.cs
• TheArchive.Core/Core/Bootstrap/TypeLoader.cs
• TheArchive.Core/Core/Bootstrap/ModuleInfo.cs
• TheArchive.Core/Interfaces/IInitAfterGameDataInitialized.cs
This design permits Essentials and RichPresence to remain separate products while sharing Core’s lifecycle and compatibility rules.
Feature and patch framework
Core supplies an attribute-driven feature system. Feature classes declare enablement, settings, update hooks, and game-method patches; FeatureManager centrally activates/deactivates them and applies runtime behavior. Patch attributes define prefixes, postfixes, transpilers, constructors, and IL manipulation, forming the boundary to GTFO/Unity internals.
• TheArchive.Core/Core/FeaturesAPI/FeatureManager.cs
• TheArchive.Core/Core/FeaturesAPI/Feature.cs
• TheArchive.Core/Core/Attributes/Feature/Patches/ArchivePatch.cs
• TheArchive.Core/Core/Attributes/Feature/Patches/IsPrefix.cs
Essentials is primarily a catalog of these features across accessibility, audio, HUD, fixes, progression, QoL, security, and special behavior, e.g.:
• TheArchive.Essentials/Features/Hud/HudToggle.cs
• TheArchive.Essentials/Features/Fixes/InteractionFix.cs
• TheArchive.Essentials/Features/Security/AntiGearHack.cs
Settings, persistence, and UI
Feature settings are modeled by Core and exposed through reusable settings/component abstractions. Enabled-feature state and archive settings are persisted locally; the documented default storage is under LocalLow, with a configurable save location. Settings UI is an internal mod/game UI integration, not a web interface.
• TheArchive.Core/Core/ArchiveSettings.cs
• TheArchive.Core/Core/Settings/EnabledFeatures.cs
• TheArchive.Core/Core/FeaturesAPI/FeatureSettingsHelper.cs
• TheArchive.Core/Core/FeaturesAPI/Settings/FeatureSetting.cs
Localization and game data integration
Localization is a Core service layer with module- and feature-scoped data, backed by checked-in JSON assets. Core also centralizes GTFO data-block access, build/rundown constraints, interop, and implementation selection—key compatibility boundaries against changing game builds.
• TheArchive.Core/Core/Localization/LocalizationCoreService.cs
• TheArchive.Core/Core/Localization/ModuleLocalizationService.cs
• TheArchive.Core/Core/Managers/DataBlockManager.cs
• TheArchive.Core/Core/Interop/Interop.cs
Rich presence and external services
RichPresence is an optional module built on Core’s feature/settings model. It manages Discord client state and GTFO/Steam presence changes, using bundled Discord Game SDK material rather than a server-side service in this repository.
• TheArchive.RichPresence/Core/Managers/ArchiveDiscordManager.cs
• TheArchive.RichPresence/Core/Managers/PresenceManager.cs
• TheArchive.RichPresence/Features/Presence/DiscordRichPresence.cs
• TheArchive.RichPresence/DiscordGameSDK/README.md
Build and distribution
Projects target game-profile references configured outside source (GameFolder.props) and require generated interop assemblies from a mod-manager profile. A separate MSBuild solution generates Thunderstore manifests from project metadata:
• TheArchive.Core/TheArchive.Core.csproj
• TheArchive.Essentials/TheArchive.Essentials.csproj
• TheArchive.RichPresence/TheArchive.RichPresence.csproj
• BuildTasks/ManifestGenerator/ManifestGeneratorTask.cs
Main entry points: TheArchive.Core.csproj Mod projects · ArchiveModuleChainloader.cs Module chainloader · FeatureManager.cs Feature manager · PresenceManager.cs Discord presence manager
Components 20
Core Runtime
Shared lifecycle, feature, and game integration framework.
- Core module entry
TheArchive.Core/MainArchiveModule.cs - Bootstrap · Establishes shared services and initialization timing.
TheArchive.Core/ArchiveBootstrap.cs - Module chainloader
TheArchive.Core/Core/Bootstrap/ArchiveModuleChainloader.cs - Module contracts & metadata · Defines module dependencies, compatibility, and readiness rules.
TheArchive.Core/Core/IArchiveModule.cs - Reflection type loader
TheArchive.Core/Core/Bootstrap/TypeLoader.cs - Feature manager · Activates and deactivates attribute-driven features.
TheArchive.Core/Core/FeaturesAPI/FeatureManager.cs - Patch attributes · Declares runtime patches against GTFO and Unity methods.
TheArchive.Core/Core/Attributes/Feature/Patches/ArchivePatch.cs - Settings & enabled state · Models feature settings and persisted enablement.
TheArchive.Core/Core/ArchiveSettings.cs - Local settings storage · Defaults to LocalLow with configurable save location.
- Localization services · Provides module- and feature-scoped localized data.
TheArchive.Core/Core/Localization/LocalizationCoreService.cs
Mod Modules
Separately shipped feature assemblies.
- Essentials module entry
TheArchive.Essentials/ArchiveEssentialsModule.cs - QoL feature catalog · Accessibility, HUD, fixes, progression, security, and QoL features.
TheArchive.Essentials/Features/Hud/HudToggle.cs - RichPresence module entry
TheArchive.RichPresence/ArchiveRichPresenceModule.cs - Discord presence manager · Synchronizes GTFO and Steam state with Discord presence.
TheArchive.RichPresence/Core/Managers/PresenceManager.cs
Game & External SDK
Loader, game, and Discord integration boundaries.
- Loader adapters · Isolates BepInEx and MelonLoader concerns.
TheArchive.Core/Loader/BIE_LoaderWrapper.cs - GTFO data & interop · Centralizes data-block access, build constraints, and interop.
TheArchive.Core/Core/Managers/DataBlockManager.cs - Discord Game SDK · Client SDK material; no server-side service.
TheArchive.RichPresence/DiscordGameSDK/README.md
Build & Distribution
- TheArchive solution
TheArchive.sln - Mod projects · Target game-profile references and generated interop assemblies.
TheArchive.Core/TheArchive.Core.csproj - Thunderstore manifest generator
BuildTasks/ManifestGenerator/ManifestGeneratorTask.cs
Connections 24
- TheArchive solution → Mod projects: builds
- Mod projects → Core module entry: produces
- Mod projects → Essentials module entry: produces
- Mod projects → RichPresence module entry: produces
- Mod projects → Thunderstore manifest generator: supplies metadata
- Loader adapters → Core module entry: invokes
- Core module entry → Bootstrap: starts
- Bootstrap → Module chainloader: initializes
- Module chainloader → Reflection type loader: discovers through
- Reflection type loader → Module contracts & metadata: builds metadata from
- Module chainloader → Essentials module entry: loads
- Module chainloader → RichPresence module entry: loads
- Module contracts & metadata → Module chainloader: governs lifecycle
- Essentials module entry → QoL feature catalog: registers
- QoL feature catalog → Feature manager: uses
- RichPresence module entry → Discord presence manager: registers
- Discord presence manager → Feature manager: uses feature model
- Feature manager → Patch attributes: applies
- Feature manager → Settings & enabled state: reads settings
- Settings & enabled state → Local settings storage: persists to
- Feature manager → Localization services: uses
- Patch attributes → GTFO data & interop: targets game internals via
- Discord presence manager → GTFO data & interop: observes game state via
- Discord presence manager → Discord Game SDK: updates client presence