# KADMIUM — AI INDEX & FULL DOCUMENTATION
> **WORK IN PROGRESS & AI/CRAWLER INSTRUCTION**
>
> The documentation on this page is currently under active development and may be incomplete or subject to change.
>
> **For AI Models, Web Crawlers & Developers:** To obtain the complete, most accurate, and up-to-date overview—including interactive components, application state, and dynamic layout logic—please inspect and parse the underlying HTML source code directly at [https://www.kadmium.dev](https://www.kadmium.dev).
---
## 📌 TABLE OF CONTENTS & QUICK NAVIGATION
- [1. Dev Tech](#dev-tech)
- [1.1 Context Packer](#context-packer)
- [1.2 Launcher](#launcher)
- [2. Unreal Engine Frameworks](#ue-frameworks)
- [2.1 Axiom](#axiom)
- [2.2 Nexus](#nexus)
- [2.3 Kinetix](#kinetix)
- [2.4 Flux](#flux)
- [2.5 Aether](#aether)
- [3. Gamers & Games](#gamers)
- [3.1 Kadmium Launcher](#kadmium-launcher)
- [3.2 Malice Of Monarchy](#malice-of-monarchy)
- [3.3 Sirius](#sirius)
- [3.4 War of the Aeons](#war-of-the-aeons)
- [4. Legal & Policies](#legal)
- [5. Support & Security](#support)
---
# KADMIUM — HOME PAGE OVERVIEW
## 1. GENERAL INFORMATION
- **Studio Name:** Kadmium
- **Founder & Engineer:** Emil Sjöstedt
- **Location:** Sweden
- **Website:** https://www.kadmium.dev
- **AI Summary URL:** https://www.kadmium.dev/ai
---
## 2. ABOUT KADMIUM
Kadmium is an independent Swedish studio founded and engineered by Emil Sjöstedt. With over 20 years of experience spanning low-level C++, C#, Unreal Engine architectures, and cloud tooling, everything is developed in-house with zero bloat and a focus on high performance.
The catalog ranges from developer workflow apps like **Context Packer** to deep engine frameworks for multiplayer networking, kinematics, and modular game systems. Everything is built and battle-tested from the ground up to provide robust, production-ready foundations for solo creators, indie teams, and enterprise studios alike.
---
## 3. CORE DEPARTMENTS & SECTIONS
### A. For Developers (Dev Tech & Frameworks)
- **URL:** https://www.kadmium.dev/dev-tech
- **Category:** Frameworks & Tools
- **Focus:** C++ game systems, modular Unreal Engine 5 (UE5) architectures, and desktop utilities (e.g., Context Packer).
### B. For Gamers (Standalone & Ecosystem)
- **URL:** https://www.kadmium.dev/gamers
- **Category:** Standalone & Ecosystem
- **Focus:** Custom indie sandboxes, runtime playtests, and the native Kadmium Launcher client.
---
## 4. CONTACT & EMAIL DIRECTORY
### General / Support / Press
- **General Inquiries & Emil:** emil@kadmium.dev
- **Support & Bug Reports:** support@kadmium.dev
- **Press & Media:** press@kadmium.dev
### Licensing / Finance / Security
- **Custom Licensing & Enterprise:** legal@kadmium.dev
- **Billing & Invoices:** finance@kadmium.dev
- **Security & Vulnerability Reports:** security@kadmium.dev
---
## 5. EXTERNAL LINKS & STORE FRONTS
- **Gumroad Store:** https://kadmium.gumroad.com/
---
## 6. LEGAL & FOOTER NAVIGATION
- **EULA:** https://www.kadmium.dev/legal/eula
- **Software & Source Code License Agreement:** https://www.kadmium.dev/legal/software-source-code-license-agreement
- **Privacy Policy:** https://www.kadmium.dev/legal/privacy-policy
- **Terms of Service:** https://www.kadmium.dev/legal/terms-of-service
- **Security:** https://www.kadmium.dev/security
- **Contact & Links:** https://www.kadmium.dev/contact
---
## 7. DISCLOSURES & COPYRIGHT
- **Copyright:** © 2026 Kadmium. Handcrafted by Emil Sjöstedt. All rights reserved.
- **AI Disclosure:** Documentation and product copy were refined with AI assistance. The underlying codebase, architecture, and logic are 100% handcrafted and tested by Kadmium.
## KADMIUM — DEVELOPER TECHNOLOGY HUB
### 1. SECTION OVERVIEW
- **Hub Title:** Developer Technology Hub
- **Category:** Kadmium Ecosystem
- **Page URL:** https://www.kadmium.dev/dev-tech
- **Summary:** Tools, specs, binaries, and source code licenses for developers.
---
### 2. FEATURED PRODUCTS & TOOLS
#### A. Context Packer
- **Category / Tag:** AI Developer Tool / AI Tooling
- **URL:** https://www.kadmium.dev/dev-tech/context-packer
- **Description:** Aggregates, sanitizes, and structures source code into LLM-ready markdown for Claude, ChatGPT, or local models.
- **Included Components:** Visual Studio 2022 extension (`.vsix`), standalone WinUI 3 desktop app, and headless core library (`.dll`).
- **Key Features:** Instant drag & drop staging, workspace privacy sanitization (`[REDACTED_USER]`), and Obsidian vault exports.
- **Licensing & Pricing:**
- Free binaries available.
- Indie Source Code License: $25.
- Studio Source Code License: $90.
#### B. Game Launcher (Kadmium Game Launcher)
- **Category / Tag:** Distribution Platform / Platform
- **URL:** https://www.kadmium.dev/dev-tech/launcher
- **Description:** Secure native WinUI 3 desktop client featuring differential patching, Google OIDC auth, and cloud sync.
- **Included Components:** Desktop client, self-healing bootstrapper, crash reporter, and Creator Studio suite.
- **Architecture:** Zero-trust cloud setup backed by Google Drive CDN delivery and Firebase Firestore integration.
- **Deployment Use Case:** Built for independent studios managing automated game patches, updates, and telemetry.
# KADMIUM — CONTEXT PACKER OVERVIEW
## 1. PRODUCT OVERVIEW
- **Product Name:** Context Packer
- **Category:** AI Developer Tool / AI Tooling
- **Summary:** Automatically scans, aggregates, and sanitizes source code into structured, LLM-ready Markdown context for Claude, ChatGPT, Gemini, or Obsidian note graphs.
---
## 2. EDITIONS & LICENSING
### Compiled Software (Ready Tools)
- **Visual Studio 2022 Extension (`.vsix`)**
- **Price:** $0 (Free)
- **Environment:** Visual Studio 2022 (v17.0+, 64-bit) on Windows 10/11.
- **Capabilities:** Docks directly next to Solution Explorer, provides instant drag & drop context packing, custom file filters, and integrates into `Tools -> Options -> Context Packer`.
- **Best For:** C#, C++, and Unreal Engine developers wanting IDE-integrated context packing.
- **Standalone Desktop App (`.exe`)**
- **Price:** $0 (Free)
- **Environment:** Windows 10 (Build 17763+) and Windows 11 (64-bit); no IDE installation required.
- **Capabilities:** Drag & drop from File Explorer, visual package history with contextual actions (Open, Reveal in Explorer, Remove), and direct drag-out to browser chats.
- **Best For:** Developers using VS Code, Rider, Sublime, or managing notes for Obsidian vaults.
- **Packer Core Engine (`.dll`)**
- **Price:** $0 (Free)
- **Target Framework:** `.NET 8.0` & `.NET Standard 2.0`.
- **Capabilities:** Precompiled headless shared library (`Packer.Core.dll`) featuring core recursive scanning, token-threshold warnings, automatic chunking (>3M chars), and local Windows username scrubbing (`[REDACTED]`).
- **Best For:** Engineers building custom CLI automations, custom UI front-ends, or pipeline scripts.
### Source Code Solutions
- **Indie Tier License**
- **Price:** $17.50 (Regular $25 — 30% Launch Discount until Sep 14, 17:00 CEST with code `LAUNCH26`).
- **Scope & Rights:** Solo developers and small teams up to 5 seats with gross revenue under $100k USD/year. Inspect, modify, compile, and embed into non-competing internal tools (no standalone resale or asset distribution).
- **Included:** Full C# solution (`PackerTool.sln`) with Core, WinUI 3, VSIX, and xUnit test suites.
- **Studio / Enterprise Tier License**
- **Price:** $84 (Regular $120 — 30% Launch Discount until Sep 14, 17:00 CEST with code `LAUNCH26`).
- **Scope & Rights:** Unlimited internal seats for organizations and studios with gross revenue over $100k USD/year. Allows internal tool customization and studio-wide deployment (no commercial redistribution).
- **Included:** Full C# solution (`PackerTool.sln`) with Core, WinUI 3, VSIX, and xUnit test suites.
---
## 3. LIVE WEB DEMO FEATURES
- **Output Formats:** LLM Tree (Token-optimized Code Blocks) and Note Tree (Obsidian Wiki-Links `[[#File:]]`).
- **Prompt Injection:** Custom "Mission Context" field to prepend tasks directly to generated Markdown.
- **Privacy Engine:** Simulated automatic path sanitization converting local user profiles (e.g., `C:\Users\Emil\...`) to `C:\Users\[REDACTED]`.
---
## 4. KEY FEATURES
- **Instant Drag & Drop Staging:** Drop individual source code files, folders, or entire project structures directly from Windows File Explorer or Visual Studio Solution Explorer.
- **Dual Output Engines:** Switch seamlessly between LLM-optimized Markdown code blocks with a directory tree or Obsidian-compatible vaults with double brackets (`[[#File:...]]`).
- **Workstation Privacy & Offline Execution:** Completely self-contained with zero outbound network traffic. Built-in sanitization engines detect and redact local Windows usernames across all filepaths and generated headers before context is exported.
- **Engine & Language Presets:** Built-in filters optimized for Unreal Engine (`.uplugin`, `.uproject`, `.usf`, `.ush`), Visual Studio, C++, C#, XAML, and config files.
- **Context & Prompt Injection:** Feed task descriptions, debugging goals, or architecture requirements directly into the document header before code generation.
- **Direct Web Drag-Out & Chunking:** Drag generated `.txt` packages directly from the interface into the browser chat window, with automatic chunking if the code exceeds 3 million characters.
---
## 5. STRETCH ROADMAP
- **Phase 01: Base Engines & Masking (Released / $0 Base Engine)**
- **Architecture:** C# recursive file scanner, memory-efficient token estimation, and async chunking (>3M characters).
- **Ecosystems:** WinUI 3 standalone executable, Visual Studio 2022 `.vsix` add-in, and headless `Packer.Core.dll`.
- **Privacy Guard v1:** Local Windows user directories are automatically replaced with `[REDACTED]` in directory headers and code snippets.
- **Phase 02: Custom Secret Shield ($50 Target)**
- **Entropy & Pattern Detection:** Automatic detection of OpenAI (`sk-...`), GitHub Personal Tokens (`ghp_...`), and AWS secret keys.
- **Custom Regex Rules:** Add your own blacklists and salt patterns via `Settings -> Security` to mask internal URLs or project codenames.
- **Pre-Prompt Inspection:** Highlights detected credentials in red before generating context packages to prevent accidental leaks.
- **Phase 03: Extended Obsidian MD ($200 Target)**
- **Callout Blocks:** Auto-format structural commentary using Obsidian tags like `[!note]`, `[!warning]`, and `[!summary]`.
- **YAML Frontmatter Injection:** Configurable key-value frontmatter staging for seamless metadata indexing inside Obsidian Graph View.
- **Template Presets:** Save and export reusable packing schemas tailored specifically for research notes or bug report documentation.
- **Phase 04: Backlog & CLI Automations ($350 Target)**
- **CLI Automation Binary:** Headless command-line binary for CI/CD context compilation and pre-commit security audits.
- **Community Driven:** Highest upvoted feature requests from GitHub / Discord get prioritized for official release.
---
## 6. COMPATIBILITY & TECHNICAL SPECS
| Client / Component | Environment & Target | Recommended Use Case |
| :--- | :--- | :--- |
| **Visual Studio 2022 Extension** | v17.0+ (64-bit), Windows 10/11 | C#, C++, and Unreal Engine developers working inside the IDE |
| **Standalone Desktop Client** | WinUI 3, Windows 10 (Build 17763+) & 11 | Developers using VS Code, Rider, Sublime, or Obsidian vaults |
| **Core Shared Engine** | .NET 8.0 & .NET Standard 2.0 (`Packer.Core.dll`) | Headless CLI automations, custom front-ends, and build pipelines |
| **Complete Source Solution** | C# Solution (`PackerTool.sln`) + xUnit Tests | Full internal customization, architecture inspection, and compliance |
---
## 7. FREQUENTLY ASKED QUESTIONS
- **Why does Windows SmartScreen appear on first launch?**
Context Packer is developed and distributed by an independent solo engineer without a corporate EV code-signing certificate (which typically costs $500+/year). The desktop binary runs completely unpackaged and self-contained, makes zero external network calls, and the full C# source code is publicly inspectable and verifiable.
- **What is the difference between the Indie and Studio source licenses?**
- **Indie Source:** Grants internal rights to inspect, modify, compile, and embed the tooling for solo creators and small teams up to 5 seats with gross annual revenue under $100,000 USD.
- **Studio / Enterprise:** Grants site-wide internal rights with unlimited seats for established studios and organizations exceeding $100,000 USD in annual revenue.
- **Are the pre-compiled binaries free to use in commercial projects?**
Yes. The compiled Visual Studio extension, the standalone WinUI 3 application, and the pre-built headless DLL are completely free for both personal and commercial production use.
- **What is your refund policy on source code?**
Due to the irrevocable nature of downloadable digital goods, all source code sales are final and strictly non-refundable. The compiled applications are provided for free so you can fully test functionality before purchasing source access.
# KADMIUM — OMNI FRAMEWORK OVERVIEW
> **Note:** This page is a work in progress. Omni Framework will be available soon.
# KADMIUM — AXIOM FRAMEWORK TECHNICAL MANUAL
*Status: Work in Progress | Target Platform: Epic Games Store / FAB*
---
## 1. FRAMEWORK OVERVIEW
- **Product Name:** Axiom Framework
- **Category:** Backend Orchestration & UE5 Networking Architecture
- **Summary:** Full-stack backend orchestration, Epic Online Services (EOS) session binding, and authoritative server match architecture for Unreal Engine 5. Decouples complex multi-cloud services into plug-and-play engine subsystems.
---
## 2. HIGH-LEVEL FRAMEWORK DECOMPOSITION
### Cloud & Identity
- `UAxiomAPISubsystem` (Profile / LiveOps)
- `UAxiomEditorAuth` (In-Engine Loopback)
- Dual-Pipeline Google OAuth → Firebase → EOS
- zlib Compressed World Autosaves
### EOS & Online Services
- `UAxiomSessionSubsystem` (Lobby / P2P)
- `UAxiomVoiceSubsystem` (RTC & Radio)
- `UAxiomAntiCheatSubsystem` (EAC Hooks)
- Automatic Matchmaking Fallbacks
### Server & Match Flow
- `UAxiomGameModeComponent` (Reconnection)
- `UAxiomMatchFlowComponent` (Tags / Timer)
- `UAxiomSpawnComponent` (Budgeted FIFO)
- `UAxiomTeamsComponent` (Auto-Balancer)
---
## 3. CORE MODULES & TECHNICAL DETAILS
### Module 1: Cloud Authentication & Identity Pipeline
- **Architecture:** Dual-Token Architecture
- **Description:** Axiom bridges third-party web authentication directly to Unreal Engine's Epic Online Services without requiring third-party SDK bloat. It leverages a dual-exchange token pipeline, turning Google OAuth ID tokens into Firebase auth tokens and mapping them directly to EOS Connect IDs (`EOS_ECT_OPENID_ACCESS_TOKEN`).
#### Core Systems
- **In-Engine Loopback Server:** During PIE, `UAxiomEditorAuth` starts an embedded HTTP listener on port 8888 (`FHttpServerModule`). The system intercepts the browser callback directly inside Unreal, eliminating manual token pasting.
- **Environment Swapping:** Switch seamlessly between `Mock` (offline mock tokens), `Emulator` (local Firestore/Auth emulator on 127.0.0.1:8080), and `Production` via `UAxiomAPISettings`.
- **Compressed Cloud Persistence:** Automated world state serialization using `zlib`-compressed Base64 payloads sent to Cloud Functions, coupled with runtime LiveOps version polling.
#### Implementation: EOS Token Binding
```cpp
// Bind Firebase access token directly into EOS external OpenID provider
FOnlineAccountCredentials Credentials;
Credentials.Id = TEXT("");
Credentials.Token = InFirebaseToken;
FString EOSTokenType = LexToString(EOS_EExternalCredentialType::EOS_ECT_OPENID_ACCESS_TOKEN);
Credentials.Type = FString::Printf(TEXT("externalauth:%s"), *EOSTokenType);
Identity->Login(0, Credentials);
```
---
### Module 2: EOS Networking, Lobbies & Voice RTC
- **Architecture Layer:** OnlineSubsystemEOS Layer
- **Description:** Encapsulates the complex native `IOnlineSessionPtr` and `IOnlineVoicePtr` interfaces into clean event-driven game instance subsystems, providing declarative session matchmaking, presence synchronization, and voice room routing.
#### Capabilities
- **Automated Matchmaking Fallback:** Queries for open advertised lobbies matching filter requirements. If no suitable match is returned within the query limit, it transparently creates and advertises a new host session.
- **Direct ClientTravel Resolution:** Extracts the EOS P2P or dedicated server resolved connection string automatically upon successful session joining and triggers `ClientTravel(ConnectString, TRAVEL_Absolute)`.
- **Networked Voice RTC:** Native integration with EOS Voice RTC services, featuring radio channel routing (`SetRadioChannel`) and talking state delegates.
#### Implementation: Matchmaking Queue Logic
```cpp
void UAxiomSessionSubsystem::OnFindLobbiesComplete(bool bWasSuccessful)
{
if (bWasSuccessful && MatchmakingSearch->SearchResults.Num() > 0)
{
// Join first compatible lobby
FAxiomSessionInfo TargetLobby;
TargetLobby.InternalResult = MatchmakingSearch->SearchResults[0];
JoinAxiomSession(TargetLobby);
}
else
{
// Fallback: Provision new host session
TMap<FString, FString> DefaultSettings;
DefaultSettings.Add(TEXT("IsMatchmakingLobby"), TEXT("True"));
CreateAxiomSession(DefaultSettings, false);
}
}
```
---
### Module 3: Authoritative Game Flow & Reconnection
- **Architecture Layer:** Dedicated Server Logic
- **Description:** GameMode components built specifically for authoritative headless dedicated servers and listen hosts, handling player reconnection states, empty-server automated shutdown cycles, and tag-driven match timers.
#### Architectural Features
- **Ghost Pawn Reconnection:** Tracks pawns left behind by disconnected players inside `DisconnectedPawns`. Returning players authenticate their PUID, safely destroy their default pawn, and instantly repossess their original character state.
- **Automated Server Lifecycle:** Tracks player count via `GameModePostLoginEvent` / `LogoutEvent`. If empty for longer than 5 minutes, it forces a world state serialization and shuts down the instance gracefully to preserve cloud infrastructure costs.
- **Tag-Driven Match Timing:** Replicated time management supporting live adjustments (`AdjustTime`) and broadcasting match completion events via `FGameplayTag` (e.g. `Match.EndReason.TimeOut`).
#### Implementation: Ghost Pawn Possession Handler
```cpp
bool UAxiomGameModeComponent::TryReconnectPlayer(APlayerController* ReturningPlayer, const FString& PUID)
{
if (APawn** FoundPawn = DisconnectedPawns.Find(PUID))
{
if (*FoundPawn && !(*FoundPawn)->IsPendingKillPending())
{
if (ReturningPlayer->GetPawn())
{
ReturningPlayer->GetPawn()->Destroy();
}
ReturningPlayer->Possess(*FoundPawn);
DisconnectedPawns.Remove(PUID);
return true;
}
}
return false;
}
```
---
### Module 4: Budgeted Batched Deferred Spawner
- **Architecture Component:** `UAxiomSpawnComponent`
- **Description:** Eliminates CPU frame-time spikes during massive world generation or reinforcement waves. Actors are scheduled into thread-safe FIFO queues, spawned deferred across frames within hard millisecond budgets, and injected with deterministic data payloads before initialization.
#### Key Mechanics
- **Frame-Time Budgeting:** Monitors elapsed execution time via `FPlatformTime::Seconds()`. Instantiation yields back to the main thread immediately if `TimeBudgetMs` (e.g. 2.0 ms) is exceeded.
- **Round-Robin Multi-Queues:** Maintains thread-safe FIFO queues (`TQueue<FAxiomSpawnRequest>`) per unique SpawnID/Zone, preventing a single region from starving the rest of the world.
- **Zero Idle Overhead:** Tick is completely disabled (`bCanEverTick = false`). The internal timer loop activates only upon receiving spawn requests and fully shuts down once all queues are flushed.
#### Implementation: Deferred Payload Injection Loop
```cpp
// 1. Instantiate deferred actor without running BeginPlay()
AActor* NewActor = World->SpawnActorDeferred<AActor>(Request.ActorClass, Request.SpawnTransform);
if (NewActor)
{
// 2. Inject deterministic GUID & custom payload data prior to execution
if (NewActor->GetClass()->ImplementsInterface(UAxiomSpawnable::StaticClass()))
{
IAxiomSpawnable::Execute_OnDeferredSpawnSetup(NewActor, Request.Guid, Request.Payload);
}
// 3. Finalize spawn - BeginPlay() runs with all dependencies in place
NewActor->FinishSpawning(Request.SpawnTransform);
}
```
---
## 4. SUBSYSTEM & COMPONENT SPECIFICATION MATRIX
| Module / Class | Type | Architectural Role |
| :--- | :--- | :--- |
| `UAxiomAPISubsystem` | GameInstance Subsystem | Handles Google/Firebase Auth token verification, REST API communication, GA4 analytics, and zlib world state autosaving. |
| `UAxiomSessionSubsystem` | GameInstance Subsystem | Manages EOS lobby lifecycles, player presence, search query filters, and automated matchmaking queues. |
| `UAxiomGameModeComponent` | Actor Component (Authority) | Tracks ghost pawn states for returning players, quorum-based voting tally, and empty server shutdown timeouts. |
| `UAxiomSpawnComponent` | Actor Component (Authority) | Time-budgeted deferred actor batch spawner driven by round-robin FIFOs with zero idle tick overhead. |
| `UAxiomIdentityComponent` | Actor Component (Replicated) | Binds PUID and display names to player states with server-handshake confirmation through `IAxiomGameModeInterface`. |
# KADMIUM — TECHNICAL ARCHITECTURE: NEXUS FRAMEWORK
## 1. PRODUCT OVERVIEW
- **Product Name:** Nexus Framework
- **Status:** Work in Progress — Will be available on Epic Games (FAB)
- **Target Engine:** Unreal Engine 5
- **Summary:** Advanced input abstraction, hardware HOTAS/pedal integration via embedded SDL3, CommonUI layer stack orchestration, draggable OS-style desktop canvas, and Slate-accelerated grid inventory rendering.
---
## 2. HIGH-LEVEL ARCHITECTURAL DECOMPOSITION
### Hardware Input & SDL3
- **Core Subsystem:** `UNexusInputConfigManager`
- **Polling Mechanism:** Embedded SDL3 Runtime Polling
- **Device Identification:** Hardware GUID-to-Slot Mapping
- **Key Binding Capacity:** 10,000+ Dynamic Generic Keys
### Axis Math & Modifiers
- **Core Modifier:** `UNexusInputModifierOffset`
- **Axis Calibration:** Symmetrical Clamped Scaling
- **Processing Chain:** Deadzone & Sensitivity Chains
- **Visual Scopes:** Live Subpixel Slate Scopes
### Layered UI & Desktop
- **Core Manager:** `UNexusUIManager` & CommonUI
- **Stack Control:** Tagged Layer Stack Navigation
- **Desktop System:** `UNexusDesktopWidget` Windows
- **Depth Management:** Global Dynamic Z-Order Elevation
### Slate Grid & Pre-Processor
- **Grid Rendering:** `UNexusGridPainter`
- **Draw Call Optimizations:** Batched MakeBox Draw Calls
- **Raw Input Processor:** `FNexusInputProcessor`
- **Navigation:** Gamepad Virtual Mouse Cursor
---
## 3. MODULE DETAILED SPECIFICATIONS
### Module 1: Hardware Device Binding via Embedded SDL3 [Subsystem Poller]
- **Overview:** Unreal Engine's default raw input often fails when handling multi-device flight simulator setups (dual sticks, throttle quadrants, rudder pedals) due to unstable device index assignments upon reboot. Nexus solves this by linking an embedded SDL3 layer, assigning persistent slot indexes based on hardware device GUIDs, and dynamically generating 10,000 Generic USB Controller keys.
- **Persistent GUID Slot Mapping:** `GetOrCreateSlotForGUID()` converts SDL joystick hardware identifiers to immutable slot IDs, ensuring flight stick axes never swap places with throttle axes.
- **Pre-Processor Input Injection:** `FNexusInputProcessor` listens to raw analog states each tick and dispatches them straight into Slate via `FSlateApplication::ProcessAnalogInputEvent`.
- **Virtual Mouse Emulation:** Seamlessly converts analog joystick or d-pad vectors into software mouse cursor movements and synthetic pointer click events for complete hands-on-stick UI control.
- **Implementation — Dynamic EKeys Registration (`Nexus.cpp`):**
```cpp
// Programmatically register massive index ranges for direct HOTAS bindings
for (int32 i = 1; i <= 10000; ++i)
{
FName AxisName = FName(*FString::Printf(TEXT("GenericUSBController_Axis%d"), i));
if (!EKeys::GetKeyDetails(AxisName).IsValid())
{
FText DisplayName = FText::Format(NSLOCTEXT("NexusInput", "AxisFormat", "Ax {0}"), i);
EKeys::AddKey(FKeyDetails(AxisName, DisplayName, FKeyDetails::Axis1D));
}
FName BtnName = FName(*FString::Printf(TEXT("GenericUSBController_Button%d"), i));
if (!EKeys::GetKeyDetails(BtnName).IsValid())
{
FText DisplayName = FText::Format(NSLOCTEXT("NexusInput", "BtnFormat", "Key {0}"), i);
EKeys::AddKey(FKeyDetails(BtnName, DisplayName, FKeyDetails::GamepadKey));
}
}
```
### Module 2: Mathematical Modifiers & Symmetrical Calibration [EnhancedInput Modifier]
- **Overview:** Flight throttles and dual-action rudder pedals often require custom deadzones, inversion, and physical center-offset calibration. Nexus extends Unreal's `UInputModifier` with non-destructive offsets, normalization scalars, and live visual monitoring widgets.
- **Offset Normalization:** Calibrates uncentered physical throttles without losing throw range. `Scalar = 1.0f / (1.0f + SafeOffset)` scales the remaining output range to preserve linear response curves.
- **Priority Pipeline Ordering:** Modifiers sort into a strict execution order: Offset (1) → DeadZone (2) → Scalar Sensitivity (3) → Output Negate Inversion (4).
- **Subpixel Live Feedback:** `UNexusAxisEditorWidget` reads un-modified raw hardware inputs in parallel with post-calculation outputs, animating comparison progress bars in real-time.
- **Throttle & Center Offset Formulation:**
```text
SafeOffset = Clamp(Offset, -0.99, 1.0)
Scalar = 1.0 / (1.0 + SafeOffset)
Output = Clamp((RawValue + SafeOffset) * Scalar, -1.0, 1.0)
```
- **Implementation — Input Modifier (`NexusInputModifierOffset.cpp`):**
```cpp
FInputActionValue UNexusInputModifierOffset::ModifyRaw_Implementation(
const UEnhancedPlayerInput* PlayerInput, FInputActionValue CurrentValue, float DeltaTime)
{
FVector Val = CurrentValue.Get<FVector>();
EInputActionValueType Type = CurrentValue.GetValueType();
if (bInvertThrottle)
{
Val.X = 1.0f - Val.X;
}
else
{
Val.X = FMath::Clamp((Val.X + Offset) * Scalar, -1.0f, 1.0f);
}
return FInputActionValue(Type, Val);
}
```
### Module 3: CommonUI Layer Stack & Draggable Desktop [UI Framework]
- **Overview:** Built around Epic's `CommonUI`, Nexus organizes viewports into priority-driven Gameplay Tag slots: `UI.Stack.Game` (HUD), `UI.Stack.Menu` (Menus), and `UI.Stack.Modal` (Dialogs). In addition, it features an OS-style desktop canvas for floating, draggable windows with automatic mouse routing.
- **Data-Asset Driven Widgets:** UI elements are configured via `UNexusUIDataAsset`, combining soft class pointers, destination slots, and instance limits to allow async streaming.
- **Dynamic Z-Order Elevation:** Clicking on any floating container (`UNexusDraggableWidget`) increments a global depth counter and re-sorts its canvas slot, bringing the window forward.
- **Automatic Mouse Cursor Management:** `RefreshCursorState()` polls open widget stacks; if an active widget requests `ECommonInputMode::Menu`, mouse control and viewport lock toggle automatically.
- **Implementation — Floating Window Initialization (`NexusDesktopWidget.cpp`):**
```cpp
UNexusDraggableWidget* UNexusDesktopWidget::SpawnFloatingWindow(
UNexusUIDataAsset* ContentData, TSubclassOf<UNexusDraggableWidget> WindowClass, FNexusUIParams Params)
{
if (!DesktopCanvas || !WindowClass || !ContentData) return nullptr;
UNexusDraggableWidget* NewWindow = CreateWidget<UNexusDraggableWidget>(this, WindowClass);
if (NewWindow)
{
NewWindow->InitWindowContent(ContentData, Params);
if (UCanvasPanelSlot* CanvasSlot = DesktopCanvas->AddChildToCanvas(NewWindow))
{
CanvasSlot->SetAutoSize(true);
CanvasSlot->SetAnchors(FAnchors(0.5f, 0.5f));
CanvasSlot->SetAlignment(FVector2D(0.5f, 0.5f));
GlobalFloatingZOrder++;
CanvasSlot->SetZOrder(GlobalFloatingZOrder);
}
ActiveFloatingWindows.Add(NewWindow);
}
return NewWindow;
}
```
### Module 4: Low-Level Slate Grid Painter & Drag-Drop [Rendering Core]
- **Overview:** Instead of instantiating hundreds of heavy `UUserWidget` borders to render spatial inventory grids (such as Flux containers), `UNexusGridPainter` bypasses UMG widget trees entirely by writing primitives directly into Slate draw lists via `NativePaint()`.
- **Batched Slate MakeBox:** Draws entire grid matrices, valid masks, and borders inside a single GPU draw call using pre-allocated layout transforms, removing overhead.
- **Hover Matrix State Shading:** Draws color overlays (green valid / red obstructed) underneath dragging items by sampling the bitmask without modifying underlying widgets.
- **90-Degree Drag Rotation Pivot:** `ToggleRotation()` calculates rotated tile offsets on active `UNexusDragDropOperation` instances, preserving cursor placement.
- **Implementation — Low-Level Slate Render Pass (`NexusGridPainter.cpp`):**
```cpp
int32 UNexusGridPainter::NativePaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId,
const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
{
const FSlateBrush* WhiteBrush = FCoreStyle::Get().GetBrush("WhiteBrush");
const FSlateBrush* BorderBrush = FCoreStyle::Get().GetBrush("Border");
float TileSize = UNexusUILibrary::GetGlobalTileSize();
for (int32 Y = 0; Y < GridHeight; ++Y)
{
for (int32 X = 0; X < GridWidth; ++X)
{
int32 Index = (Y * GridWidth) + X;
bool bIsValid = RawMask.IsEmpty() || (RawMask.IsValidIndex(Index) && RawMask[Index] == '1');
if (bIsValid)
{
FPaintGeometry PaintGeom = AllottedGeometry.ToPaintGeometry(
FVector2D(TileSize, TileSize),
FSlateLayoutTransform(FVector2D(X * TileSize, Y * TileSize))
);
// Draw background fill & crisp border with minimal overhead
FSlateDrawElement::MakeBox(OutDrawElements, LayerId, PaintGeom, WhiteBrush, ESlateDrawEffect::None, FillColor);
FSlateDrawElement::MakeBox(OutDrawElements, LayerId + 1, PaintGeom, BorderBrush, ESlateDrawEffect::None, LineColor);
}
}
}
return LayerId + 2;
}
```
---
## 4. SUBSYSTEM & COMPONENT SPECIFICATION MATRIX
| Class / Struct | Type | Architectural Role |
| :--- | :--- | :--- |
| `UNexusInputConfigManager` | LocalPlayer Subsystem | Maintains hardware joystick states via SDL3, manages input overrides, and drives virtual mouse cursor emulation. |
| `UNexusUIManager` | GameInstance Subsystem | Orchestrates CommonUI modal stacks, async widget streaming, desktop canvases, and viewport input state switching. |
| `UNexusSettingsSubsystem` | GameInstance Subsystem | Serializes engine scalability CVars, resolutions, audio levels, and custom keybindings to persistent save slots. |
| `UNexusGridPainter` | Slate / UMG Widget | Renders spatial 2D inventory grids and hover state overlays via lightweight, batched Slate draw primitives. |
| `UNexusDraggableWidget` | CommonActivatableWidget | Window wrapper offering title-bar click dragging, focus trapping, and dynamic depth elevation. |
# Kinetix Framework // Technical Documentation
*Kadmium Frameworks // Technical Architecture*
**Note:** This page is work in progress. Will be available on Epic games - FAB.
---
Multi-threaded ballistic physics solver, GPU-driven Niagara Data Channel rendering, real-time procedural boolean destruction via Geometry Scripting, and physical debris decomposition for Unreal Engine 5.
---
## High-Level System Architecture
### 1. Ballistics & Solver
* `UKinetixSolver` (Subsystem Ticker)
* Multi-Threaded `ParallelFor`
* Double-Sided Raycast Thickness
* Trajectory Telemetry Readouts
### 2. GPU Visualizer
* `AKinetixVisualizer` Pipeline
* `NiagaraDataChannel` C++ Writer
* Zero Actor Spawn Overhead
* Multi-Context MetaSound Hooks
### 3. Boolean Destruction
* `UKinetixImpactHandler`
* Asynchronous Task Mesh Booleans
* Dynamic Cylinder/Sphere Cutters
* Cooldown Collision Re-Baking
### 4. Decomposition & Debris
* Island Component Splitting
* Static Overlap Anchor Tests
* `AKinetixDebrisActor` Pooling
* Mass-Scaled Dynamic Lifetimes
---
## Module 1: Ballistic Solver [ParallelFor]
*Core Subsystem*
Kinetix eliminates per-bullet actor overhead by driving thousands of active rounds inside `UKinetixSolver` via `FTSTicker`. Aerodynamic drag, gravity acceleration, intercept homing guidance, and thread-safe sweep traces run inside an asynchronous `ParallelFor` loop, yielding serial execution only for state mutators and collision events.
### Core Subsystems
* **Parallel Raycast Dispatch:** Projectiles evaluate spatial movement in parallel batches. `ThreadHits` buffers thread-safe line traces across frame intervals without blocking the main game thread.
* **Back-Face Thickness Tracing:** Calculates true material traversal distance. When an entry hit occurs, a reverse trace runs from the opposite side of the actor's bounds to determine actual penetration depth scaled by `UKinetixPhysicalMaterial::BulletResistance`.
* **Three-Phase Collision Branching:** Rounds dynamically evaluate terminal ballistic outcomes: glancing angles trigger **Ricochet** reflections; excess energy triggers **Penetration**; exhausted force results in **Embedded Lodging**.
### Kinetic Energy & Penetration Decay
```
SpeedRatio = Velocity.Size() / Config.MaxSpeed
CurrentPenetrationPower = InitialPenetrationPower * (SpeedRatio²)
EffectiveThickness = PhysicalDistance * PhysicalMaterial.BulletResistance
```
### Parallel Ballistic Dispatch Loop
```cpp
// KinetixSolver.cpp
ParallelFor(ActiveProjectiles.Num(), [&](int32 Index)
{
FKinetixProjectileInstance& Projectile = ActiveProjectiles[Index];
const FKinetixProjectileConfig& Config = Projectile.Config;
if (Projectile.bIsStuck) return;
// A. Ballistic Trajectory Integration
Projectile.AccumulatedForce += Gravity * (Config.Mass * Config.GravityScale);
Projectile.Velocity += (Projectile.AccumulatedForce / Config.Mass) * DeltaTime;
Projectile.Velocity = Projectile.Velocity.GetClampedToMaxSize(Config.MaxSpeed);
// B. Kinetic Energy Curve
float SpeedRatio = Projectile.Velocity.Size() / Config.MaxSpeed;
Projectile.CurrentPenetrationPower = Config.InitialPenetrationPower * (SpeedRatio * SpeedRatio);
// C. Thread-Safe Trace Sweep
FVector Start = Projectile.Position;
FVector End = Start + (Projectile.Velocity * DeltaTime);
ThreadDidHit[Index] = GetWorld()->LineTraceSingleByChannel(
ThreadHits[Index], Start, End, Config.CollisionChannel, Params
);
});
```
---
## Module 2: Niagara Data Channel [GPU Streaming]
*Zero-Actor Overhead*
Instead of spawning individual actor components or particle systems per projectile, `AKinetixVisualizer` uses native C++ Niagara Data Channel (NDC) writers. World-space telemetry buffers are pushed directly to GPU compute shaders at `TG_PostUpdateWork`, rendering thousands of traces in a single draw call.
### Visual Architecture
* **Scoped Direct Memory Injection:** `FNDCScopedWriter` writes position, velocity vectors, and unique project IDs directly into raw Niagara data arrays without intermediate copying or reflection.
* **Contextual Audio & VFX Routing:** Data assets map physical materials to MetaSounds and Niagara emitters across specific event contexts: Entry impact, Ricochet reflection, and Exit blowouts.
* **NetID Client Reconciliation:** When a server authorizes bullet termination, `ForceKillProjectile()` uses matching NetIDs to snap client visual buffers to exact impact points and clears the NDC particle pipe.
### NDC Buffer Writer Implementation
```cpp
// KinetixVisualizer.cpp
FNDCScopedWriter<FProjectileNDCWriter> ScopedWriter(NDCWriter);
FNiagaraDataChannelSearchParameters SearchParams;
if (ScopedWriter->BeginWrite(GetWorld(), ActualChannel, SearchParams, PublishCount, true, true, true))
{
int32 Index = 0;
for (const FKinetixProjectileInstance& Proj : ActiveProjectiles)
{
if (!Proj.bIsStuck)
{
ScopedWriter->WritePosition(Index, Proj.Position);
ScopedWriter->WriteVelocity(Index, Proj.Velocity);
ScopedWriter->WriteProjectileID(Index, Proj.NetID);
ScopedWriter->WriteVisualID(Index, Proj.VisualsAsset ? Proj.VisualsAsset->VisualID : 0);
Index++;
}
}
}
```
---
## Module 3: Dynamic Destruction [Async Booleans]
*Runtime Mesh Deformation*
Kinetix achieves real-time physical bullet holes and structural gouges by leveraging Unreal Engine's Geometry Scripting pipeline. Inbound projectile cuts are batched into pooled compute meshes and executed asynchronously across worker threads, preserving 60+ FPS during sustained automatic gunfire.
### Key Mechanics
* **Dynamic CSG Cutters:** Constructs procedural subtraction primitives: `AppendSphereLatLong` for explosive blast craters, or `AppendCylinder` aligned along the bullet travel vector for through-holes.
* **Background Thread CSG:** `ApplyMeshBooleanAsync()` runs subtraction passes on worker tasks via `UE::Tasks::Launch`. Completed topology is swapped back onto `UDynamicMeshComponent` on the GameThread.
* **Batched Collision Re-Baking:** Cooking complex physics hulls on every frame drops framerate. Kinetix buffers updates and executes `UpdateCollision()` via an asynchronous debounce timer (`CollisionBakeCooldown`).
### Asynchronous Mesh Boolean Subtraction
```cpp
// KinetixImpactHandler.cpp
// Execute procedural mesh subtraction on background worker thread
UE::Tasks::Launch(UE_SOURCE_LOCATION, [this, ComputationMesh, Cutter, Impacts]() mutable
{
FGeometryScriptMeshBooleanOptions BoolOptions;
BoolOptions.bFillHoles = true;
BoolOptions.OutputTransformSpace = EGeometryScriptBooleanOutputSpace::TargetTransformSpace;
// Apply CSG Subtraction against dynamic cutter primitives
UGeometryScriptLibrary_MeshBooleanFunctions::ApplyMeshBoolean(
ComputationMesh, TargetDynamicMesh->GetComponentTransform(),
Cutter, FTransform::Identity,
EGeometryScriptBooleanOperation::Subtract, BoolOptions, nullptr
);
// Re-swap computed topology back to game thread
AsyncTask(ENamedThreads::GameThread, [this, ComputationMesh, Cutter]() mutable
{
UGeometryScriptLibrary_MeshDecompositionFunctions::CopyMeshToMesh(
ComputationMesh, TargetDynamicMesh->GetDynamicMesh(), DestMesh
);
TriggerBatchedCollisionBake();
});
});
```
---
## Module 4: Debris Decomposition [World Anchors]
*Island Decomposition*
When repeated ballistic impacts sever a structure into disconnected geometric islands, Kinetix decomposes the mesh in real-time. Surviving pieces are checked against world geometry for structural anchors; unanchored islands detach as physically simulated, networked debris actors.
### System Features
* **Component Island Splitting:** Executes `SplitMeshByComponents` to isolate detached geometric pieces. Each isolated chunk is queried for volume and bounding box bounds.
* **Static Overlap Anchor Testing:** Ground-based objects sweep surrounding boundaries for `ECC_WorldStatic` collisions. Chunks touching foundations remain static structures; floating pieces become active physics debris.
* **Mass-Scaled Dynamic Lifetimes:** `AKinetixDebrisActor` computes physical mass based on true geometric volume. Shards despawn in seconds, while massive broken pillars persist up to several minutes.
### Anchor Validation & Debris Spawning
```cpp
// KinetixImpactHandler.cpp
// Anchor Sweep: Verify if the chunk touches stable world static geometry
bool bIsAnchored = World->OverlapMultiByObjectType(
Overlaps, WorldCenter, TargetTransform.GetRotation(),
ECC_WorldStatic, FCollisionShape::MakeBox(ExpandedExtent), Params
);
if (bIsAnchored)
{
// Re-attach stable geometry back into parent main mesh
UGeometryScriptLibrary_MeshBasicEditFunctions::AppendMesh(MainMesh, Chunk, FTransform::Identity);
}
else if (OwnerActor->HasAuthority())
{
// Spawn active simulated physics debris
AKinetixDebrisActor* Debris = World->SpawnActor<AKinetixDebrisActor>(WorldCenter, Rotator);
Debris->PhysicsBox->SetBoxExtent(ChunkBounds.GetExtent());
Debris->PhysicsBox->SetSimulatePhysics(true);
Debris->SetDynamicLifetime(Debris->PhysicsBox->GetMass());
Debris->PhysicsBox->AddImpulse(LaunchDir * 500.0f, NAME_None, true);
}
```
---
## Subsystem & Component Specification Matrix
| Class / Struct | Type | Architectural Role |
| :--- | :--- | :--- |
| `UKinetixSolver` | World Subsystem | Maintains parallel projectile pipelines, double-sided raycast sweeps, and ballistic penetration calculations. |
| `AKinetixVisualizer` | Actor (PostUpdateWork) | High-performance Niagara Data Channel C++ writer streaming bullet telemetry directly to GPU compute shaders. |
| `UKinetixImpactHandler` | Actor Component | Manages runtime dynamic mesh geometry, background CSG booleans, and structural anchor tests. |
| `AKinetixDebrisActor` | Replicated Actor | Networked physics body representing severed mesh islands, driven by volume-calculated mass and predictive interpolation. |
| `UKinetixPhysicalMaterial` | Physical Material | Defines penetration resistance values (`BulletResistance`) used for armor degradation math. |
# Flux Framework // Technical Documentation
*Kadmium Frameworks // Technical Architecture*
**Note:** This page is work in progress. Will be available on Epic games - FAB.
---
Multiplayer state-transaction engine, shape-masked grid inventories, recursive item nesting, reflection-bound RPG stats, and input-routed flyweight gameplay actions for Unreal Engine 5.
---
## High-Level System Architecture
### 1. Grid & Spatial Inventory
* `UFluxInventoryComponent`
* `FFastArraySerializer` Deltas
* 1D String Shape Bitmasks
* Cross-Actor Proximity Swaps
### 2. Recursive Nesting
* Sub-Container Tree Hierarchy
* `UFluxInventorySubsystem`
* Dynamic Socket Attachment
* Async Mesh / Class Streaming
### 3. Reflection RPG Stats
* `UFluxStatComponent`
* Subsystem Heartbeat Pulse
* FProperty C++ Direct Injections
* LiveOps Data Asset Overrides
### 4. Flyweight Actions
* `UFluxActionComponent`
* Shared Replicated Subobjects
* Local Predictive / Multicast
* Line-of-Sight Interactions
---
## Module 1: Spatial Grid Inventory & Delta Replication [FastArray]
*Network Optimized*
Flux abandons conventional slot-array architectures in favor of spatial bitmask containers powered by `FFastArraySerializer`. This enables Tetris-style geometric item packing, 90-degree rotations, stack splitting, and authoritatively guarded cross-container transactions without replicating unchanged items.
### Key Innovations
* **Shape Bitmask Geometry:** Containers are not restricted to rectangles. Shapes use arbitrary width/height dimensions paired with a 1D bitmask string (`"111001"`), allowing non-Euclidean layouts like diagonal pockets or L-shaped vests.
* **Universal Move & Swap Pipeline:** `ExecuteUniversalMove()` handles intra-container moves, inter-container drops, stack merging, and two-way item swaps inside a single authoritative atomic routine with distance threshold guards.
* **Slate Mask Editor:** Features a dedicated in-editor property customization tool (`FFluxGridShapeCustomization`) that renders interactive checkbox grids directly in the Unreal Engine Details Panel.
### Geometric Collision Check (CanItemFit)
```cpp
// FluxInventoryLibrary.cpp
bool UFluxInventoryHelpers::CanItemFit(const FFluxContainer& TargetContainer, const FFluxItemInstance& Item, int32 TestX, int32 TestY)
{
FIntPoint ItemSize = Item.GetSize();
for (int32 y = 0; y < ItemSize.Y; ++y)
{
for (int32 x = 0; x < ItemSize.X; ++x)
{
int32 TargetX = TestX + x;
int32 TargetY = TestY + y;
// 1. Bitmask boundary verification
if (!TargetContainer.ContainerShape.IsValidSlot(TargetX, TargetY)) return false;
// 2. Spatial occupancy verification
int32 SlotIndex = TargetContainer.ContainerShape.GetIndex(TargetX, TargetY);
if (TargetContainer.OccupiedSlots.Contains(SlotIndex) && TargetContainer.OccupiedSlots[SlotIndex] != Item.ItemID)
{
return false;
}
}
}
return true;
}
```
---
## Module 2: Hierarchical Item Nesting & Equipment Streaming [Hierarchy]
*Data-Asset Driven*
Every item in Flux can act as a container provider. Equipping a tactical backpack, chest rig, or weapon automatically provisions dynamic sub-containers into the owning actor's replication hierarchy, complete with async visual asset loading and magazine resource binding.
### Core Architecture
* **Dynamic Sub-Containers:** When an item with `bProvidesInventory = true` is equipped, `ExpandItemContainers()` assigns deterministic child GUIDs and registers sub-pockets dynamically without hardcoded skeletal hierarchies.
* **Split Game-Logic & Visual Loading:** Dedicated servers instantiate gameplay actors and grant actions instantly via synchronous loads, while visual meshes stream asynchronously via `FStreamableManager` on non-dedicated clients.
* **Integrated Ammo Magazines:** `UFluxResourceComponent` binds directly to the first nested pocket of a weapon, consuming individual ammunition stack instances during firing cycles without requiring standalone inventory management.
### Async Visual Attachment Pipeline
```cpp
// FluxInventoryComponent.cpp
// Client-side async visual attachment post-stream
if (Owner->GetNetMode() != NM_DedicatedServer && !LoadedItem.ItemData->MeshOverride.IsNull())
{
UObject* LoadedMesh = LoadedItem.ItemData->MeshOverride.Get();
if (USkeletalMesh* SkelMesh = Cast<USkeletalMesh>(LoadedMesh))
{
USkeletalMeshComponent* SkelComp = NewObject<USkeletalMeshComponent>(Owner);
SkelComp->SetSkeletalMesh(SkelMesh);
SkelComp->SetLeaderPoseComponent(Owner->FindComponentByClass<USkeletalMeshComponent>());
SkelComp->RegisterComponent();
SpawnedEquipmentComponents.Add(ItemID, SkelComp);
}
}
```
---
## Module 3: Reflection-Bound Stats & Heartbeat Pulse [Reflection]
*Zero-Boilerplate Synchronization*
Flux completely decouples RPG numerical attributes from manual component tick wiring. Stats live within an optimized `FFastArraySerializer` collection, update over time via a centralized world heartbeat subsystem, and inject values directly into third-party component properties via raw Unreal C++ reflection.
### System Mechanics
* **Direct C++ Reflection Binding:** `BindStatToProperty()` locates `FFloatProperty` handles by name (e.g. `MaxSpeed` on `AetherMovementComponent`) and writes computed stat values directly to memory addresses upon recalculation.
* **Centralized World Pulse:** Components disable tick entirely. Instead, `UFluxStatSubsystem` executes an authoritative server pulse (default 1.0s), evaluating active `PulseTick` stats and regeneration rates in a single unified cache loop.
* **Directional Threshold Events:** Registers percentage boundaries (e.g. 20% stamina remaining). State monitors evaluate crossing direction to dispatch non-spamming edge-triggered tags like `Event.Stat.Stamina.Low`.
### Reflection Property Write Mechanism
```cpp
// FluxStatComponent.cpp
void UFluxStatComponent::NotifyStatChanged(const FFluxStat& Stat)
{
// Write directly into target memory via cached reflection handle
if (FFluxBindingCache* Binding = BindingRegistry.Find(Stat.StatTag))
{
if (UActorComponent* TargetComp = Binding->TargetComp.Get())
{
if (float* PropAddr = Binding->PropertyPtr->ContainerPtrToValuePtr<float>(TargetComp))
{
*PropAddr = Stat.CurrentValue;
}
}
}
CheckThresholds(Stat);
OnStatChanged.Broadcast(Stat.StatTag, Stat.CurrentValue);
}
```
---
## Module 4: Flyweight Gameplay Actions & Interactivity [Execution]
*Replicated Subobjects*
Instead of granting heavy duplicate actor instances per weapon or item, Flux implements the Flyweight pattern. Actions are lightweight, instanced `UObject` subobjects that replicate over specialized actor channels, receiving dynamic context payloads (multi-barrel instigations, input tags) during activation.
### Architectural Features
* **Execution Policy Bitmasks:** Each action configures execution policies via `EFluxActionExecutionFlags`: `LocalPredictive` (client-side prediction), `Server` (authoritative routing), or `NetMulticast`.
* **Input-to-Action Group Routing:** Decouples hardware input from hardcoded functions. An input tag (e.g. `Input.Fire`) queries `InputBindings` to activate all containers matching specific firing groups simultaneously.
* **Authoritative Raycast Interaction:** `UFluxInteractorComponent` tracks nearby overlapping targets on clients while performing authoritative distance checks and line-of-sight sweeps (`ECC_Visibility`) on servers before executing.
### Flyweight Subobject Channel Replication
```cpp
// FluxActionComponent.cpp
bool UFluxActionComponent::ReplicateSubobjects(UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags)
{
bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
// Instruct actor channel to replicate dynamic UObject actions
for (UFluxAction* Action : GrantedActions)
{
if (Action)
{
WroteSomething |= Channel->ReplicateSubobject(Action, *Bunch, *RepFlags);
}
}
return WroteSomething;
}
```
---
## Subsystem & Component Specification Matrix
| Class / Struct | Type | Architectural Role |
| :--- | :--- | :--- |
| `UFluxInventoryComponent` | Actor Component (Owner Only) | Manages local/external spatial containers, FastArray delta serialization, item rotations, and equipment streaming. |
| `UFluxInventorySubsystem` | World Subsystem | Maintains the global container registry, executes cross-component spatial moves, and applies runtime LiveOps stat overrides. |
| `UFluxStatComponent` | Actor Component (Replicated) | Contains numerical RPG attributes with modifier arithmetic, reflection property injection, and directional threshold events. |
| `UFluxStatSubsystem` | Tickable World Subsystem | Authoritative server heartbeat runner that evaluates periodic stat decay and regeneration across all registered components. |
| `UFluxActionComponent` | Actor Component (Replicated) | Flyweight action router with subobject channel replication, input group mapping, and predictive/server execution policies. |
| `UFluxInteractorComponent` | Actor Component | Proximity trigger monitor with authoritative server-side line-of-sight validation and external container toggling. |
# Aether Framework // Technical Architecture
*Kadmium Frameworks // Technical Architecture*
**Note:** This page is work in progress. Will be available on Epic games - FAB.
---
A modular C++ foundation plugin engineered for Unreal Engine 5. It decouples 6-DOF high-speed flight mechanics, planetary gravity fields, raycast suspension, and multi-vector flight assistance into deterministically predicted, client-side simulated networking layers via the Network Prediction Plugin (NPP).
---
## Deterministic Simulation Pipeline
```
[Autonomous Client] [Proxy Transport] [Fixed Simulation] [Presentation]
ProduceInput() ---> NetworkPrediction ---> SimulationTick() ---> FinalizeSmoothing()
(FAetherInputCmd) (KinematicMovers) (FAetherSimulation) (VisualComponent)
```
1. **Autonomous Client (`ProduceInput()`):** Samples local input, mouse vectors, and evaluates highest-priority gravity fields (`FAetherInputCmd`).
2. **Proxy Transport (`NetworkPrediction`):** Buffers frames for client-side prediction, replication, and authoritative server rollbacks (`KinematicMovers`).
3. **Fixed Simulation (`SimulationTick()`):** Calculates coupled counter-thrust, dynamic lift, G-force, and raycast suspension forces (`FAetherSimulation`).
4. **Presentation (`FinalizeSmoothing()`):** Interpolates detached visual meshes independently from fixed-rate physics substepping (`VisualComponent`).
---
## Landing Gear Dynamics & Suspension Formula
Raycast suspension utilizes progressive angular frequency ($\omega = 2\pi f$) with cubic compression multipliers:
### Dynamic Spring Constant & Force Calculation
```
Omega = 2 * PI * SpringFrequency
BaseStiffness = Mass * (Omega^2) * SuspensionLength
ProgressiveMultiplier = 1.0 + (Compression^3 * 2.0)
ActiveStiffness = BaseStiffness * ProgressiveMultiplier
SpringForce = (Compression * ActiveStiffness) - (AxisVelocity * ActiveDamping)
SpringForce = Clamp(SpringForce, 0.0, (MassPerGear * 980.0) * MaxSuspensionGs)
```
---
## Live Debug Screen Emulation
```text
=== AETHER MOVEMENT [AUTONOMOUS PROXY] ===
Speed: 4,280 / 5,000 cm/s • G-Force: 1.12 G
AoA (Angle of Attack): +2.45°
--------------------------------------------------
LinearCmd : X=1.00 Y=0.00 Z=0.00 (Coupled: ON)
AngularCmd: P=0.12 Y=-0.05 R=0.65 (Banking)
AimTarget : Dir=[0.88, 0.12, 0.45] • HorizonAlign: 94%
--------------------------------------------------
Active Gravity: Planet_Spherical (Priority 10)
Environment : Atmosphere Density = 1.00
Suspension : 3/3 Struts Contact (Rolling Mode)
```
---
## Module 1: Deterministic Network Prediction
*Core Networking*
Instead of relying on Unreal Engine's legacy `CharacterMovementComponent` or standard variable replication, Aether is implemented natively on top of the **Network Prediction Plugin (NPP)**. This guarantees fixed-timestep simulation on both dedicated servers and autonomous clients, featuring rollback and reconciliations when client predictions diverge from authoritative state.
### Execution Lifecycle
* **1. ProduceInput():** Runs autonomously on the client. Gathers raw inputs, samples the `UAetherAimDirectorComponent` forward vector, queries overlapping gravity fields, and packages everything into an immutable `FAetherInputCmd`.
* **2. SimulationTick():** Executed deterministically inside `FAetherSimulation`. Consumes the input command alongside current dynamic properties (`FAetherAuxState`) to compute the next physics snapshot (`FAetherSyncState`).
* **3. Smoothing & Presentation:** Meshes are detached during `BeginPlay()`. Smooth interpolation runs inside `FinalizeSmoothingFrame()`, decoupling high-framerate visual rendering from fixed simulation ticks.
### Reconciliation Budgeting
To prevent visual micro-stuttering across unstable network connections, reconciliation triggers only when threshold metrics are breached:
```cpp
DistSquared(Location, Auth.Location) > 100.0f || AngularDistance(Rotation, Auth.Rotation) > 0.05f
```
### Model Definition Binding
```cpp
// AetherSimulation.h
struct FAetherModelDef : FNetworkPredictionModelDef
{
NP_MODEL_BODY();
using StateTypes = TNetworkPredictionStateTypes<FAetherInputCmd, FAetherSyncState, FAetherAuxState>;
using Simulation = class FAetherSimulation;
using Driver = class UAetherMovementComponent;
static const TCHAR* GetName() { return TEXT("AetherMovement"); }
static constexpr int32 GetSortPriority() { return (int32)ENetworkPredictionSortPriority::KinematicMovers; }
};
```
---
## Module 2: 6-DOF Newtonian & Atmospheric Flight
*Simulation Engine*
Aether implements an aerospace flight model capable of operating across space environments and dense atmospheres without switching controllers.
### Core Subsystems
* **Coupled vs Decoupled 6-DOF:** In Coupled Mode, flight-assist thrusters apply active damping to cancel drift and counteract gravity vectors. Decoupled Mode retains pure Newtonian inertia for drift maneuvers.
* **Atmospheric Lift & AoA:** Dynamically computes Angle of Attack (`CurrentAOA`) based on the forward axis and velocity trajectory, applying counter-gravity lift scaled by atmospheric density.
* **Dynamic Dive Speed Bonus:** Diving along gravity vectors in dense atmospheres unlocks terminal velocities exceeding base engine limits, calculated as a function of ship mass and descent angle.
* **Mouse-Aim Flight Director:** Translates free-look mouse crosshairs into pitch and yaw rates while dynamically banking the vessel into turns (fighter bank-and-turn behavior).
### Atmospheric Aerodynamic Calculation
```cpp
// FAetherSimulation::SimulationTick
// Dynamic terminal velocity scaling during atmosphere dives
if (bHasGravity && Cmd->EnvironmentDensity > 0.01f)
{
float DiveDot = FVector::DotProduct(LocalVelocity.GetSafeNormal(), LocalGravity.GetSafeNormal());
if (DiveDot > 0.f)
{
float TerminalVelocityBonus = (Aux->MaxSpeed * Aux->DiveSpeedMultiplier) + (Aux->Mass * 0.1f);
EffectiveMaxSpeed += TerminalVelocityBonus * DiveDot;
}
}
```
---
## Module 3: Multi-Source Gravity Fields
*UAetherGravityComponent*
Eliminates the single Z = -980 cm/s² world-gravity limitation of Unreal Engine. Aether ships evaluate arbitrary gravity sources in real-time, prioritising local interiors (capital ships, hangars) over orbital bodies.
### Gravity Typologies
* **Spherical Gravity (Planets & Moons):** Computes force vectors directed toward the center of the actor with linear or smooth falloff zones between `InnerRadius` and `OuterRadius`.
* **Directional Gravity (Hangars & Stations):** Applies uniform acceleration along a local directional vector, allowing moving capital ships to maintain localized interior artificial gravity.
### Spherical Falloff Mathematical Model
```
Alpha = 1.0 - Clamp((Distance - InnerRadius) / (OuterRadius - InnerRadius), 0.0, 1.0)
F_gravity = DirectionToCenter * (MaxGravityStrength * Alpha)
```
---
## Module 4: Raycast Suspension & Surface Interaction
*UAetherLandingGearComponent*
Replaces rigid collision boxes with raycast-driven damped harmonic oscillators. This produces realistic suspension compression, touchdown cushioning, and surface friction for both terrestrial landings and orbital dockings.
### Suspension Characteristics
* **Progressive Stiffness:** Spring stiffness increases non-linearly using a cubic compression multiplier ($1 + 2x^3$) to absorb violent impacts and avoid hard bottoming-out.
* **Asymmetric Damping:** Damping values are automatically scaled down by 80% during wheel rebound ($v_{axis} < 0$) to keep tires or landing skids planted on uneven terrain.
* **Dual Ground Friction Models:** Supports `Rolling Mode` (transverse friction with low forward rolling resistance for wheeled rovers) and `Sticky Mode` (multidirectional drag for landing pads).
### Physics Implementation
```cpp
// UAetherMovementComponent::CalculateLandingGearForces
// Dynamic Spring Constant calculation based on natural frequency
const float Omega = UE_TWO_PI * Gear->SpringFrequency;
const float ScaledStiffness = MassPerGear * FMath::Square(Omega) * Gear->SuspensionLength;
const float ProgressiveMultiplier = 1.0f + (Compression * Compression * Compression * 2.0f);
const float ActiveStiffness = ScaledStiffness * ProgressiveMultiplier;
// Calculate final balanced suspension force
float SpringForce = (Compression * ActiveStiffness) - (AxisVelocity * ActiveDamping);
SpringForce = FMath::Clamp(SpringForce, 0.f, (MassPerGear * 980.f) * Gear->MaxSuspensionGs);
```
---
## State Contracts & Module Specs
| Struct / Component | Type | Primary Function & Sync Role |
| :--- | :--- | :--- |
| `FAetherSyncState` | NPP Replicated State | Reconciles location, orientation quaternion, linear velocity, G-force, and AoA during server rollback. |
| `FAetherAuxState` | NPP Auxiliary Data | Stores variable flight dynamics (Mass, Thrust ratings, Damping, DiveSpeedMultiplier). Triggers rollback only when modified. |
| `UAetherGravityComponent` | Actor Component | Generates spherical or directional vector fields with priority overrides for hangars and planets. |
| `UAetherLandingGearComponent` | Scene Component | Raycast suspension system with configurable damping ratios, progressive stiffness, and friction modes. |
# Kadmium Ecosystem // Gamers Hub
> **Note:** This page is work in progress. Information can be wrong.
Explore the official desktop client and browse our expanding library of games.
---
## Core Platform
### Kadmium Launcher
* **Category:** Desktop Client / Platform
* **Description:** Official client for launching games, managing automatic patches, and account sync.
* **Link:** [https://www.kadmium.dev/gamers/kadmium-launcher](https://www.kadmium.dev/gamers/kadmium-launcher)
* **Includes:** Automatic updates, library management, and zero-trust security.
* **Status:** Active Public Beta.
---
## Game Titles & Sandboxes
### 1. Malice Of Monrachy
* **Category:** Dark Fantasy / Sandbox
* **Description:** An immersive dark fantasy experience built on high-performance UE5 systems.
* **Link:** [https://www.kadmium.dev/gamers/malice-of-monrachy](https://www.kadmium.dev/gamers/malice-of-monrachy)
* **Engine:** Unreal Engine 5 custom modular framework.
* **Status:** Early Access playtests.
### 2. Sirius
* **Category:** Sci-Fi Sandbox / Simulation
* **Description:** Next-generation space exploration and physical vehicle building simulation.
* **Link:** [https://www.kadmium.dev/gamers/sirius](https://www.kadmium.dev/gamers/sirius)
* **Features:** Procedural star systems and custom physics.
* **Status:** Conceptual Prototyping.
### 3. War of the Aeons
* **Category:** Strategy / Action
* **Description:** Epic scale tactical combat encounters across dynamic shifting battlegrounds.
* **Link:** [https://www.kadmium.dev/gamers/war-of-the-aeons](https://www.kadmium.dev/gamers/war-of-the-aeons)
* **Features:** Large-scale unit coordination and tactical depth.
* **Status:** Planned Roadmap Title.
### 4. Project Horizon
* **Category:** Future Release / R&D
* **Description:** An upcoming secretive tactical project currently in early R&D phase.
* **Link:** [https://www.kadmium.dev/gamers/horizon](https://www.kadmium.dev/gamers/horizon)
* **Features:** Experimental systems and network protocols.
* **Status:** Pre-Production.
# Kadmium Developer Tech // Documentation
## Context Packer Suite
> Aggregates, sanitizes, and structures source code into LLM-ready markdown files for Claude, ChatGPT, Gemini, and Obsidian note trees. Select a module below to inspect implementation details, commands, and settings.
---
## Visual Studio 2022 Extension
* **Category:** IDE Extension (`.VSIX Package`)
* **Description:** Embedded directly into Visual Studio 2022 as a tool window. It allows developers to stage files, physical folders, or entire project trees straight from Solution Explorer into a packaged context document.
### Workflow Guide
1. **Open Panel:** Navigate to `View` → `Other Windows` → `Context Packer` to dock the panel anywhere in your workspace.
2. **Drag & Drop:** Highlight files, projects, or solution folders in Solution Explorer and drag them into the staging zone.
3. **Pack & Export:** Enter optional *Mission Context* instructions, select formatting mode, and click **PACK TO TXT**.
### Package Management
Generated packages appear in the bottom list:
* **Direct Chat Drag:** Drag item directly from the list into your web browser (ChatGPT, Claude).
* **Context Menu:** Right-click an item to *Open File*, *Open File Location*, or *Delete File*.
* **Reload Cache:** Click *Load Cache* to load existing packages from your local cache directory.
---
## WinUI 3 Standalone Desktop
* **Category:** Desktop App (`Windows App SDK`)
* **Description:** High-performance unpackaged Windows desktop client built for batch file collection without requiring an active IDE or Visual Studio installation.
### Key Capabilities
* **Native OS Drag-and-Drop:** Drag whole project folders from Windows Explorer. Recurses subfolders automatically while excluding build artifacts.
* **Direct Web Drag-Out:** Drag generated context items directly out of the application window into browser prompts.
* **Workstation Privacy:** Automatically detects and redacts developer workstation usernames from absolute file paths.
### Compilation from Source (Standalone Release)
```powershell
cd PackerTool/Packer.WinUI3
dotnet publish Packer.WinUI3.csproj -c Release -r win-x64 --self-contained true
```
---
## Packer.Core API & Headless Engine
* **Category:** Headless API (`.NET 8.0` / `.NET Standard 2.0`)
* **Description:** The shared headless execution library responsible for scanning paths, chunking large outputs (> 3,000,000 characters), and formatting structured Markdown trees.
### Data Models
```csharp
// Input model
public class FileItemModel
{
public string FileName { get; set; } = string.Empty;
public string FilePath { get; set; } = string.Empty;
}
// Output generated context model
public class PackerModel
{
public string FileName { get; set; } = string.Empty;
public string FullPath { get; set; } = string.Empty;
}
```
### Execution Example
```csharp
using Packer.Core.Interfaces;
using Packer.Core.Models;
using Packer.Core.Services;
IPackerEngine engine = new PackerEngine();
var files = new List<FileItemModel>
{
new() { FileName = "UserService.cs", FilePath = @"C:\repos\App\Services\UserService.cs" },
new() { FileName = "UserDto.cs", FilePath = @"C:\repos\App\Models\UserDto.cs" }
};
var (generatedFiles, warnings) = await engine.PackFilesAsync(
files: files,
baseName: "AuthModule_Context",
config: new PackerConfig(),
missionContext: "Refactor user authentication to support OAuth2.",
isObsidianFormat: false
);
foreach (var file in generatedFiles)
{
Console.WriteLine($"Output: {file.FullPath}");
}
```
---
## Context Output Structure
* **Category:** Output Schema (`Markdown & Obsidian`)
* **Description:** The engine produces structured Markdown files optimized for LLM attention spans and tokenizer parsing.
### Standard LLM Output Example
````markdown
# Project(s) Context
Generated: 2026-09-05 14:30
## Mission Context
Refactor user authentication to support OAuth2.
## Directory Structure
### Module: App
- `Services/UserService.cs`
- `Models/UserDto.cs`
## Source Code
# --- MODULE: APP ---
### File: UserService.cs
```csharp
public class UserService {
// Implementation
}
```