Skip to content

GameDev-Sunshine/Deadlock-Hero-Build-Cleaner

Repository files navigation

Deadlock Hero Build Cleaner

Clean, inspect, and repair Deadlock cached_hero_builds.kv3 files with a simple Windows UI and CLI.

Deadlock Hero Build Cleaner is a Windows tool for inspecting and cleaning cached_hero_builds.kv3. It can remove all saved builds, remove one hero's builds, remove one specific build ID, preview changes before writing, and repair affected LastUsedBuilds references.

Why This Tool Exists

Deadlock build cache files can get cluttered after testing, break when stale build IDs remain referenced, or become annoying to manage when you only want to remove one hero's entries. This tool exists to make cleanup and inspection practical without pretending to be a full save editor.

Key Features

  • inspect current cached_hero_builds.kv3 entries
  • remove all saved hero builds in one pass
  • remove one hero's builds without wiping the rest
  • remove one specific build ID
  • preview changes before rewriting the file
  • reset affected LastUsedBuilds references during cleanup
  • create a backup before replacing the original file
  • use either a Windows UI or CLI workflow

Recommended Screenshot Gallery

Use this screenshot order in both the GitHub README and the GameBanana gallery.

  1. Cleaner main tab with a valid file selected and backup enabled
    Caption: Quick full cleanup for cached_hero_builds.kv3 with backup enabled by default.
  2. Cleaner confirmation modal before purge
    Caption: Review the target file and planned changes before removing every saved build.
  3. Advanced tab focused on the action rail and Entries workspace
    Caption: Inspect build entries, choose a cleanup mode, and preview targeted changes before writing.
  4. Advanced Inspector tab showing summary plus LastUsed Resets
    Caption: Review cleanup summaries and LastUsedBuilds resets for safer targeted repairs.
  5. CLI inspect-builds or purge-all --dry-run output
    Caption: Use the CLI for fast inspection, previews, and scripted cleanup workflows.

Use clean product screenshots only. Avoid arrows, red callouts, or personal file paths in the captured UI.

Cleaner Vs Advanced Vs CLI

  • Cleaner Best for the safest full reset workflow. Pick the file, keep backup enabled, confirm, and remove every saved build.
  • Advanced Best for targeted cleanup and inspection. Use it when you need hero-specific purge, build-specific purge, dry runs, or detailed diagnostics.
  • CLI Best for fast previews, repeatable workflows, and low-level inspection from the terminal.

Quick Start And Downloads

Run the Windows UI:

dotnet run --project src/DeadlockSaveCleaner.Win

Run the CLI:

dotnet run --project src/DeadlockSaveCleaner.Cli

Inspect a build cache:

dotnet run --project src/DeadlockSaveCleaner.Cli -- inspect-builds --input C:\path\cached_hero_builds.kv3

Preview a full cleanup without rewriting the file:

dotnet run --project src/DeadlockSaveCleaner.Cli -- purge-all --input C:\path\cached_hero_builds.kv3 --dry-run --yes

Remove one hero's builds:

dotnet run --project src/DeadlockSaveCleaner.Cli -- purge-hero --input C:\path\cached_hero_builds.kv3 --hero hero_kelvin --output C:\path\cached_hero_builds.cleaned.kv3

Published outputs are placed under:

  • artifacts/win
  • artifacts/cli

Safety And Backups

  • writes go to a temporary file first
  • rewritten output is reloaded and verified before replacement
  • in-place rewrites can create a timestamped backup
  • the original file is replaced only after verification succeeds
  • destructive actions are previewed before execution

Supported Commands

  • inspect-builds
    Summarize build entries in a readable table.
  • inspect-kv3
    Dump the raw KV3 object graph for low-level inspection.
  • inspect-types
    Print the relevant VRF type surface used by the tool.
  • purge-all
    Remove every saved build and reset all LastUsedBuilds values to 0.
  • purge-hero
    Remove all builds for one selected hero.
  • purge-build
    Remove one specific build ID for one selected hero.
  • purge-legacy-ah
    Remove legacy Abrams/Haze entries detected by the cleanup rules.

Batch mode requires --input for every command except inspect-types.

Scope

Deadlock Hero Build Cleaner targets one file: cached_hero_builds.kv3.

It is a build cache cleaner and inspector, not a general Deadlock save editor, mod manager, or launcher.

Technical Notes

Requirements

  • Windows
  • .NET 9 SDK
  • bundled Source2Viewer.exe in vendor/Source2Viewer/

Notes About Source2Viewer.exe

The repo currently ships with a bundled Source2Viewer.exe for local development and portable builds.

The runtime bridge reads the single-file bundle directly and extracts the required managed and native payload into an isolated working directory. This avoids launching the external helper UI during normal CLI or WPF usage.

Projects

  • src/DeadlockSaveCleaner.Core
    Shared cleanup contracts, preview logic, mutation planning, and verification.
  • src/DeadlockSaveCleaner.Vrf
    Runtime bridge for KV3 support through the bundled Source2Viewer.exe.
  • src/DeadlockSaveCleaner.Cli
    Console workflow for preview, purge, and low-level inspection commands.
  • src/DeadlockSaveCleaner.Win
    WPF desktop app built on top of the same core services.
  • tests/DeadlockSaveCleaner.Tests
    Self-hosted unit and integration test runner.

Testing

Run the self-hosted test suite:

dotnet run --project tests/DeadlockSaveCleaner.Tests --no-build

The repo includes an anonymized minimal KV3 fixture in samples/fixtures/minimal-sample.kv3.

Publishing

CLI and WPF outputs both copy the bundled Source2Viewer.exe into tools/Source2Viewer.exe during build and publish.

GitHub Actions workflow: .github/workflows/release.yml

Third-Party Dependency

Before making the repository public or cutting releases for redistribution, confirm the upstream redistribution terms and update THIRD_PARTY_NOTICES.md accordingly.

If redistribution is not permitted, remove the bundled binary and require a user-supplied --bundle path instead.

About

Inspect, clean, and repair Deadlock cached_hero_builds.kv3 files with CLI and Windows UI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors