# MOON LOBBY — MW4 / Warzone (`cod26`) Interactive Optimizer `v1.1.2`

[![Join MOON LOBBY Discord](https://img.shields.io/badge/Discord-MOON%20LOBBY-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/fMXgEaM9x3)
[![Subscribe on YouTube](https://img.shields.io/badge/YouTube-MOON%20LOBBY%20%7C%20%40DrMoonKnight97-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@DrMoonKnight97)
[![Release v1.1.2](https://img.shields.io/badge/Release-v1.1.2-00B4D8?style=for-the-badge&logo=cloudflare)](https://moon-lobby-mw4.pages.dev)
[![RICOCHET Safe](https://img.shields.io/badge/RICOCHET%20Anti--Cheat-100%25%20Safe-2EA043?style=for-the-badge)](#safety-guarantees)

An open-source, hardware-aware, question-based PowerShell optimizer built by **MOON LOBBY** for **Call of Duty: Modern Warfare 4 / Warzone (`cod26`)** — featuring **in-place BOM-free config patching**, **interactive Windows & launcher tweaks**, **direct NVAPI + `.nip` NVIDIA Profile Inspector support**, **Discord stream-drop fixes**, **live GPU Pre-Flight & Benchmark 1% Low Analyzer**, **Safe Shader Cache Cleaner**, **1-click Pre-Launch Boost generation**, and **full automatic Backup & Restore**.

> **Need PC stutter help, Season updates, or want to share your Benchmark Before/After?**
> Join the **MOON LOBBY Discord**: **https://discord.gg/fMXgEaM9x3** | Watch walkthroughs on **YouTube**: **https://www.youtube.com/@DrMoonKnight97**

---

## Quick Start

### Option 1 — One-Line PowerShell Execution (`iwr | iex`)
Run directly in PowerShell (auto-elevates to Administrator and bypasses CDN cache automatically):
```powershell
iwr https://moon-lobby-mw4.pages.dev/IWR.ps1 -useb | iex
```

### Option 2 — Run Locally
Double-click **`AllowScripts.cmd`** (automatically prompts for Administrator via UAC), or run in an Administrator PowerShell window:
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force
.\IWR.ps1
```

---

## What It Includes (`v1.1.1`)

| Module | Behavior | Key Highlights |
|---|---|---|
| **1. MW4 / Warzone Config (`s.1.0.cod26.txt`)** | **Fixed** Max-FPS + Competitive Visibility Core + **Question-Based** Customization | Patches your existing file **in-place** (preserves audio devices, volumes, keybinds, mouse/controller sensitivity). Written strictly **UTF-8 without BOM + pure `LF`** (culture-invariant decimals) so CoD never resets it. Hardware-aware auto-defaults for **RTX 40/50 (DLSS Transformer)**, **RTX 20/30 (DLSS CNN)**, **GTX 10/16 (AMD FSR 3 + non-ReBAR/VRAM-safe defaults)**, **AMD RDNA 4 / RX 9000 (FSR 4)**, **FSR 3**, **FidelityFX CAS**, and **Intel XeSS**. |
| **2. Windows & Launcher Tweaks** | **100% Question-Based** | GameDVR off, Game Mode on, hardware-aware HAGS recommendation, per-app AutoHDR off for `cod.exe`, Windows Defender folder exclusions (auto-skips cleanly if 3rd-party AV or Defender disabled), Power Plan + PCIe ASPM / USB Suspend off, NVIDIA Highlights off while optionally keeping Instant Replay ON, sensor/RGB/LCD bloat killer (`TRCC`, `HWiNFO`, `MSI Center`, `Armoury Crate`, `iCUE`, `Lively`, `EA Desktop`), plus **Battle.net** (HW accel off + auto-exit on game launch) & **Steam Overlay** tweaks. |
| **3. GPU Driver Profile Inspector (NVIDIA & AMD)** | **100% Question-Based** | Auto-detects your GPU vendor! **NVIDIA:** applies directly via native C# **`nvapi64.dll`** (including internal DRS entry points for modern NVIDIA App Low Latency, ReBAR v2, and **DLSS Preset K / Latest Transformer overrides** auto-defaulted for RTX 40/50) + fresh disk read-back verification + `.nip` XML export. **AMD:** applies directly to the discrete Radeon adapter & `UMD` registry (Shader Cache, TFQ, Surface Format, ULPS, Anti-Lag, V-Sync, Flip Queue, Tessellation, Adrenalin Overlay/ReLive) + live read-back verification + `.reg` profile export. |
| **4. Discord Stream Optimizer** | **100% Question-Based** | Pure C# Chromium LevelDB SSTable/WAL reader & writer (CRC32C + read-back verified, zero Python required). Fixes the 170 → 120 FPS drop when streaming on Discord (HW Accel ON, hidden 1080p60 Clips OFF, OpenH264/AV1/`videoHook` OFF, Overlay OFF, default stream FPS 30/60). |
| **5. Pre-Flight Check & Benchmark Analyzer** *(Updated in v1.1.1)* | **Read-Only Diagnostics** | **Live GPU Pre-Flight Check** detects locked low GPU fans / Zero-RPM, high idle VRAM bloat, competing NVENC video encoders, running bloat, config BOM corruption, and **verifies your live NVIDIA DRS or AMD Adrenalin driver profile**. **Benchmark Analyzer** parses CoD `cod26_Benchmark_*.csv` files, displays Before vs After 1% Low deltas, CPU/GPU bottleneck %, and detects periodic frametime stutter spikes. |
| **6. Safe Shader Cache Cleaner** *(New in v1.1)* | **Question-Based** | Safely cleans stale `NVIDIA\DXCache`, `GLCache`, `AMD\DxCache`, `D3DSCache`, and CoD `GPUCache` after driver or game patches (automatically skips locked active OS files). |
| **7. Pre-Launch Boost Generator** | **Question-Based** | Generates an auto-elevating `MW4_PreLaunch_Boost.bat` + `.ps1` (with optional Desktop shortcut) tailored to your bloat list, Defender exclusions, preferred MW4 settings, and live fan-lock / VRAM alerts. |
| **8. Automatic Backup & 1-Click Restore** | **Always On** | Every session creates a timestamped snapshot in `Documents\MW4-Optimizer-Backups\Backup_YYYYMMDD_HHMMSS\` (MW4 config, `.reg` exports, NVIDIA DRS JSON + `.nip`, Defender exclusions, Services/Tasks, Power Plan, Discord LevelDB, Battle.net & Steam configs) with 1-click rollback. |

---

## Fixed Max-FPS + Visibility Core (`s.1.0.cod26.txt`)

Applied automatically without overwriting your personal controls/audio:
- **Shadows / Lighting / Raytracing:** `ShadowQuality = Very_Low`, `ShadowFilteringQuality = Low`, `ScreenSpaceShadowQuality = Off`, `StaticSunshadowClipmapResolution = 0`, `AmbientLightingQuality = Off`, `SSRQuality = Off`, `DxrMode = Off`, `WaterCausticsMode = Off`, `WeatherGridVolumesQuality = Off`
- **Geometry / Shaders / Particles:** `ParticleQuality = very low`, `VolumetricQuality = QUALITY_LOW`, `ShaderQuality = Low`, `ShadingQuality = Low`, `ModelQuality = Low Quality`, `TerrainQuality = Very Low`, `Tessellation = 0_Off`, `WorldStreamingQuality = Low`, `SubdivisionLevel = 0`
- **Textures (Sharpness + VRAM Balance):** `TextureQuality = 2` (Low), `TextureFilter = aniso 2x`
- **Clarity & Anti-Clutter:** All Motion Blur & Velocity Blur `Off`, Depth of Field `Off`, `CorpseLimit = 0`, `BulletImpacts = false`, `PersistentDamageLayer = false`, `ShowBrass = false`, `VSync = disabled`, `DynamicSceneResolution = false`, all Idle Sustainability reducers `off`, intro videos skipped.

---

## Safety Guarantees
- **RICOCHET Anti-Cheat Safe:** Never disables or alters TPM 2.0, Secure Boot, VBS, or HVCI (Memory Integrity).
- **Zero Unsigned Binaries:** 100% readable PowerShell & inline C# source code — no opaque `.exe` downloads.
- **BOM-Free CoD Patching:** Prevents the classic PowerShell 5.1 UTF-8 BOM bug that causes Call of Duty to reset your settings on launch.

---

## Community & Support — MOON LOBBY
- **Discord (PC Help, Season Updates & Before/After Benchmark Results):** https://discord.gg/fMXgEaM9x3
- **YouTube (Full Walkthroughs, FPS Tests & Guides):** https://www.youtube.com/@DrMoonKnight97
