################################################################################
#                                                                              #
#             MARVEL RIVALS - PERFORMANCE & OPTIMIZATION LAUNCHER              #
#                                   (v2.1)                                     #
#                                                                              #
################################################################################

This automated launcher improves your Marvel Rivals experience by:
  1.  Checking for Administrator privileges (Required for system optimization).
  2.  Allowing you to select your Game Platform (Steam, Epic Games, Loading Bay).
  3.  Automatically finding your "MarvelRivals_Launcher.exe" game path.
  4.  Saving your preferences to "config.ini" so you only set it up once.
  5.  Cleaning system RAM (Working Sets, Standby Lists) before launch.
  6.  Launching your Platform first, waiting for it, then launching the Game.
  7.  PREVENTS FREEZING: Automatically disables "QuickEdit Mode" so clicking
      the window won't pause the script.

================================================================================
  CHOOSE YOUR VERSION
================================================================================

  [1] Start (Win 11).bat
      - Recommended for Windows 11 users.
      - Features modern animations, typewriter effects, and colored output.
      - Uses Windows Terminal if available.
      - Wait time: 8 seconds for launcher initialization.

  [2] Start (Win 10).bat
      - Recommended for Windows 10 or older systems.
      - Faster, lightweight, no animations.
      - Standard Command Prompt interface.
      - Wait time: 3 seconds for launcher initialization.

================================================================================
  HOW THIS HELPS PERFORMANCE ('More FPS, Less Stutter')
================================================================================
By automating these optimization steps, this launcher helps ensure:

  [+] More Stable Framerate
      By ensuring the game process has sufficient resources and memory availability,
      you experience fewer frame drops during intense gameplay.

  [+] Reduced Stuttering & Freezing
      Cleaning the RAM Standby List and Working Sets clears out cached data from
      other apps, freeing up maximum physical memory for the game. This
      significantly reduces stuttering caused by memory paging.

  [+] Smoother Gameplay
      A clean system state minimizes background interruptions, leading to a more
      consistent and responsive gaming experience.

  [+] Safe & Clean (Anti-Cheat Friendly)
      Uses official Microsoft tools (RAMMap). Modification is done to the
      System RAM, not game files. Runs BEFORE the game starts.

================================================================================
  SETUP & REQUIREMENTS
================================================================================

  [1] "bin" FOLDER REQUIRED
      Ensure you have a "bin" folder in the same directory as the scripts.

  [2] REQUIRED TOOLS INSIDE "bin"
      - fd.exe           (Used for fast game path detection)
      - RAMMap64.exe     (Used for RAM memory cleaning)

================================================================================
  HOW TO USE
================================================================================

  STEP 1: RUN AS ADMINISTRATOR
      > Right-click your chosen script (Win 10 or Win 11)
      > Select "Run as Administrator"

  STEP 2: FIRST RUN SETUP
      > Select your platform (Steam / Epic Games / Loading Bay).
      > Choose Launcher Discovery Method:
          - Auto-Search (Scans drives)
          - Default Location
          - Manual Input
      > Choose Game Discovery Method:
          - Auto-Search (Scans drives)
          - Manual Input
      > The script will save your settings to `config.ini`.

  STEP 3: PLAYING THE GAME (Subsequent Runs)
      > Just run the script (as Admin).
      > [Note] This is MUCH faster than the first run!
      > It uses your saved config, skipping the search/setup entirely.
      > It will:
          - Read your saved settings.
          - Clean your RAM.
          - Open your Platform Launcher (Steam/Epic/Loading Bay).
          - Wait for initialization (8s for Win 11 / 3s for Win 10).
          - Launch Marvel Rivals automatically.

================================================================================
  CONFIGURATION (config.ini)
================================================================================
If you need to change your launcher or game path, simply delete `config.ini` to
run the setup again, or edit it manually:

[Format Example]
PlatformPath=C:\Program Files (x86)\Steam\steam.exe
GamePath=E:\Games\Steam\steamapps\common\MarvelRivals\MarvelRivals_Launcher.exe

================================================================================
  TROUBLESHOOTING
================================================================================

  [!] "ACCESS DENIED"
      You must run the script as Administrator for RAMMap to work.

  [!] Script Freezes?
      We added a fix for this! The script now auto-disables "QuickEdit Mode"
      so clicking the window won't pause it anymore.

  [!] Game Not Found
      If Auto-Search fails, select "Manual Input" and paste the
      FULL path to your `MarvelRivals_Launcher.exe`.

Enjoy the game with optimized performance!