# Pluckomp launcher

The launcher installs Pluckomp from your own copy of *Pikmin 4*, starts it and keeps it up to date. Everything it
makes stays in the folder it sits in. Design: docs/architecture.md, Launcher. Building it: docs/building.md, Launcher.

## What you need

- Windows 10 or 11, 64-bit, with a Vulkan 1.3 graphics driver
- Your own dump of *Pikmin 4*: the base game (NSP or XCI) and the **2.0.0** update (NSP). Other versions are not
  supported. NSZ / XCZ files must be decompressed first.
- The keys dumped from your own console (`prod.keys`)
- About 20 GB of free disk space in the folder you choose, and at least 4 GB of free memory while it builds (8 GB or
  more makes the build much faster)

You do not need Python, a compiler or anything else: the launcher fetches its own build tools from this project's
GitHub release.

## Install

1. Download `Pluckomp-<version>-windows-x64.zip` from the project's GitHub Releases and unzip it into an empty folder.
2. Run `Pluckomp.exe`.
3. Press **Choose** next to *Base game*, *Update* and *Keys file* and pick your files.
4. Press **Install**. The launcher downloads its build tools (about 190 MB, checked against their SHA-256), unpacks
   the game data from your files, turns the game code into C and compiles it. The first install takes 20 to 30
   minutes on a 10-core machine, longer on smaller ones; the window shows each step and the end of its log.
5. Press **Play**.

If a step fails, the window says which step and why: a missing or damaged keys file, a game version other than 2.0.0,
not enough disk space or memory. The whole log is in `logs/task.log`.

## Play

**Play** starts `game/pluckomp.exe` with your saves in `profile/`. Closing the launcher does not close the game. If
the game stops with an error, the launcher shows the end of `game/logs/pluckomp.log`; attach that file to a bug report.

Controls are in docs/building.md, Input: a gamepad (buttons by position, as on a Switch controller) or the keyboard
(WASD to move, Enter for A, Backspace for B, F11 for full screen).

## Update

**Check updates** asks GitHub for the newest release. When there is one, the button becomes **Update to X**: the
launcher downloads it, checks its SHA-256, rebuilds the game with the new code from the files you chose before and
then replaces itself. Your saves (`profile/`) and the shader cache (`game/shader-cache/`) are kept. If an update is
stopped half way (you close the launcher, the power goes), the version you had keeps working; the next start
finishes an update that had already reached its last step.

## What the launcher sends and keeps

- The only network requests go to the GitHub Releases API of this project and to the release downloads. They carry
  nothing about you: no paths, no file names, no keys.
- `launcher.toml` remembers the paths you chose. The keys file is only ever passed by its path to the extraction tool;
  the launcher never copies or prints what is in it.
- Nothing from your game is ever uploaded or put in a release.

## The folder

| Path | What |
|---|---|
| `Pluckomp.exe` | the launcher |
| `launcher.toml` | your file choices and the update source |
| `game/` | the game, its shader cache and its logs |
| `profile/` | your saves |
| `work/` | the unpacked game data, the generated C and the compiled objects (about 15 GB); needed to rebuild |
| `versions/`, `toolchain/` | the launcher's code and build tools |
| `logs/` | the launcher's logs |

To uninstall, delete the folder (copy `profile/` first if you want to keep your saves).

## Background

The window's background is `installer/art/background.png` (2000 x 1236), built into `Pluckomp.exe`. A
`background.png` next to `Pluckomp.exe` replaces it; it is stretched over the window, so give it the window's shape
(1100 x 680, or larger at the same ratio for high-DPI screens). Any art for it has to be original: nothing taken from
the game or its packaging goes in the repository.
