feat(recomps): match PC ports to owned games by store ID and check their files

The catalogs name no store release, but Recomp Launcher gives each game's
IGDB slug. Wikidata links IGDB slugs to Steam app IDs, GOG slugs and Epic
store slugs, and GOG's products API gives the slug of each owned GOG
product; both answers are cached. A store with known IDs for the game is
matched by ID only. Other ports of the same PC game share its slug.

A match counts once the file a catalog names is in the install, and is
the right version when Decomp Buddy gives its hash or size. The card says
whether files were checked, whether it matched only by name, or which
file is missing or different.
This commit is contained in:
Kurt Himebauch committed 2026-12-01 11:13:15 -05:00
1 parent e72496f34d
commit 9fee179a80
11 files changed
+509 -82

No files matched your search

+48 -17
View File
@@ -106,22 +106,49 @@ The build is chosen in the order linux-arm64 (native), android, linux-x64 (FEX),
## Game data
For PC ports (Decomp Buddy's "PC (Windows)" and "IBM PC (MS-DOS)", Recomp Launcher's `pc`), `RecompData`
matches the game's title against the player's installs (store sidecars and Steam client libraries) and
owned games. It uses Decomp Buddy's rules:
- A subtitle after a colon or dash is fine, so "Fallout 2: A Post Nuclear Role Playing Game" is
Fallout 2.
- A leading possessive such as "Sid Meier's" is dropped.
- Only store-edition words (GOTY, Gold, Complete, Definitive, ...) may follow the title, so "Fallout 2"
is not "Fallout".
PC ports need the original PC game's files, which a store sells. For these entries (Decomp Buddy's "PC
(Windows)" and "IBM PC (MS-DOS)", Recomp Launcher's `pc` origin), DroidDeck works out whether the player
already has them.
Where a plan names the file the port needs in a folder (`expected_filename`, for example `DIABDAT.MPQ`),
the folder holding that file inside the install is the one shown. An install without that file does not
count.
**1. Which store release is the game: `RecompStoreIds`.** None of the catalogs names one.
- **IGDB slug:** Recomp Launcher gives each game's IGDB slug (`about.url`). Other ports of the same PC
game take it when the title leads to one slug (`shareIgdb`). That covers 390 of 1,104 PC entries.
- **Wikidata:** links IGDB slugs (P5794) to Steam app IDs (P1733), GOG slugs (P2725) and Epic store
slugs (P6278). It is asked in batches of 150 over SPARQL and cached in `files/recomps/store-ids.json`
for 14 days. 144 PC games get at least one store ID: 121 Steam, 90 GOG, 18 Epic.
- **GOG:** GOG's public products API (`api.gog.com/products?ids=…`, 50 per call) gives the slug of each
GOG product the player owns or installed. Kept in `gog-slugs.json`, since slugs don't change.
- **Installed:** "Installed on Steam" and the guest folder to point the port at.
- **Owned:** "Install game".
- **Otherwise:** what the catalog says the game needs. Console recomps are never matched.
**2. Matching an install or owned game.**
- For a store with known IDs for the game, only the ID counts: a Steam app ID, or a GOG product's slug.
A title match is not used there, so DOOM (2016) never stands in for Doom (1993).
- Epic IDs can't be compared yet: DroidDeck keeps an Epic game's namespace and app name, not its store
slug. So Epic, and any store without IDs for the game, falls back to Decomp Buddy's title rules (from
`src/stores.js`):
- A subtitle after a colon or dash is fine.
- A leading possessive such as "Sid Meier's" is dropped.
- Only store-edition words (GOTY, Gold, Complete, Definitive, ...) may follow the title.
- Installs come from store sidecars and the Steam client libraries, internal or SD card. Owned games
come from the store libraries and the Steam page.
**3. The right files.**
- **The file:** Decomp Buddy's `expected_filename` or Recomp Launcher's `inputs[game].check.file` (112
PC entries) names a file the port needs. It is looked for as a relative path, without case, up to 4
folders into the install. The folder holding it is the one shown.
- **The version:** when Decomp Buddy gives `expected_hashes` (sha1, sha256, md5, crc32) or
`expected_size` (31 PC entries), the file must match. Hashes are kept in `hashes.json` by path, size
and modified time.
| State | Card |
|---|---|
| Found, file checked | green "Installed on Steam · files checked", and the folder |
| Found by ID, no file to check | green "Installed on Steam" |
| Found by title only | grey "Installed on Steam · matched by name" |
| Incomplete | "Installed on GOG, but DIABDAT.MPQ is missing", or "… is a different version" |
| Owned | "You own it on Steam. Install it first", with "Install game" |
| Otherwise | what the catalog says the game needs |
Console recomps are never matched, because no store sells their dumps.
## UI
@@ -175,6 +202,9 @@ same code.
- Zelda 64: Recompiled v1.2.2 installed from Decomp Buddy's `linux-arm64` plan in about 5 s and
reached its Select ROM screen natively.
- AYN Thor, with store IDs: both Sonic Mania ports matched the Steam install on the SD card by app ID
(via IGDB and Wikidata), not by title.
## Not done yet
- **Recompa delivery rules.** Hand a chosen ROM to an Android port the way Recompa's `delivery`
@@ -192,9 +222,10 @@ same code.
- **ROM checks.** Hash a chosen ROM against `sha1` and say whether it is the right one.
- **x86 runtime hint.** A linux-x64 build needs Steam opened once so the FEX runtime (sniper) is
installed. Show that on the card, or fall back to the Windows build.
- **Steam ownership** relies on the Steam page's library or the Steam store sign-in. A game
installed by the Steam client counts as installed regardless. Title matching can miss renamed
editions.
- **Epic IDs.** Epic store slugs from Wikidata could be compared once DroidDeck keeps each owned Epic
game's product slug (Epic's catalog has it as `productSlug` / page mappings).
- **Store IDs upstream.** A `stores` field on Recomp Launcher inputs (Steam app IDs, GOG product IDs)
would make Wikidata a fallback. It has been proposed but not filed yet.
- **Recomp setup steps.** Some recomps build themselves from the player's data with bundled
Python (Recompia). They need executable storage, so they must stay inside the Linux root, never
under `/media`; see the Discord thread on Recompia from 2026-11-15.