Skip to content

device settings: find a game's settings by what they hold, and give back what is a save - #118

Open
ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/settings-by-content
Open

ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/settings-by-content

Conversation

@ChakraFusion

Copy link
Copy Markdown

The follow-up #84 left out: settings files the game database doesn't list are recognised by their contents.

Detection (presets/detectsettings.go):

  • A file is taken for a game's settings by its contents: the vocabulary of one machine's display (resolution, vsync, shadow quality, upscaler), matched inside identifiers split at case changes and separators (_enableFrameGeneration, r_materialAniso), in UTF-8 or UTF-16. Unreal Engine's Config/<platform> folder is taken by convention.
  • Names only add weight. Measured over the game database's own labels, "settings" names 1,521 settings files and 70 saves, and ".ini" 1,831 and 137, so a name never decides on its own.
  • A name with a save word in it rules a file out unless the contents are overwhelming. The game database's save locations, logs, binaries, long files that are only partly settings, and Syncthing's conflict copies are never taken.

Giving back what is a save: a file taken for settings that changes like a save is given back for good (verdict "save", which also overrules the game database):

  • before it is left out, and at every later run, the game's snapshots are asked whether it changed in most of the snapshots in which the rest of the save changed (snapshot/history.go);
  • while it is left out, every change here and every manifest another device sends count whether it changed when the rest of the save did. Three such changes, outnumbering the times it stayed put, give it back (daemon/detectsettings.go).

Storage and UI: verdicts are kept per game (migration 0042: settings_files, settings_observations, and marks for when each game was last judged). They're applied through the device settings from #84, so hashes recorded under the old list are carried over as before. The game's file list says why each excluded file is excluded, and unticking one syncs it. The configuration tab's new text is in the catalogs: en, plus zh-Hans and zh-Hant as a first attempt for @Janlhin to correct. SyncIgnoreEditor isn't extracted yet, so its new labels are plain English like the rest of it.

On my machine: 74 files in 25 games detected, among them Crimson Desert's, DOOM Eternal's and Elden Ring's settings, and 12 games the game database doesn't cover. None of them is a file the snapshot history shows changing with the save.

Tests: presets/detectsettings_test.go, snapshot/history_test.go, daemon/devicesettings_test.go (TestObserveSettings_GivesBackWhatChangesLikeASave).

Checks: the full unit and e2e suites pass locally on today's dev-public.

🤖 Generated with Claude Code

…ack what is a save

The game database names the settings files of the games it knows (Liquid-co#84).
For the rest, a file is now taken for a game's settings by its contents
(presets/detectsettings.go): the vocabulary of one machine's display -
resolution, vsync, shadow quality, upscaler - matched inside identifiers
split at case changes and separators ("_enableFrameGeneration",
"r_materialAniso"), in UTF-8 or UTF-16. Unreal Engine's Config/<platform>
folder is taken by convention.

Names only add weight, by how reliably the game database's own labels show
them to mean settings: over its 16,700 settings and 9,000 save entries,
"settings" names 1,521 settings files and 70 saves, ".ini" 1,831 and 137,
so a name never decides on its own. A name with a save word in it rules a
file out unless the contents are overwhelming; the game database's save
locations are never taken, and nor are logs, binaries, long files that are
only partly settings, or Syncthing's conflict copies.

A file taken for settings that changes like a save is given back for good
(verdict "save", which also overrules the game database):
- before it is left out, and at every later run, the game's snapshots are
  asked whether it changed in most of the snapshots in which the rest of
  the save changed (snapshot/history.go);
- while it is left out, every change here and every manifest another
  device sends count whether it changed when the rest of the save did;
  three such changes, outnumbering the times it stayed put, give it back
  (daemon/detectsettings.go).

Detected files and verdicts are kept per game (migration 0042:
settings_files, settings_observations, and marks for when each game was
last judged) and applied through the device settings, so hashes recorded
under the old list are carried over as before. The game's file list says
why each excluded file is excluded, and unticking one there syncs it. The
configuration tab's new text is in the catalogs (en, zh-Hans, zh-Hant).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Omar-VF

Omar-VF commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks, the detection and the give-back checks are thorough. Two changes before we can merge:

  1. 0042_settings_files.sql creates settings_files, settings_observations and marks with plain CREATE TABLE. Builds of the earlier draft stack created settings_files (0043) and marks (0041) with the same schema, and a database from those builds would now fail to start with "table already exists". We saw exactly this last week with sync_device_settings. Please use CREATE TABLE IF NOT EXISTS for these.
  2. Files found by their contents should not be left out of sync automatically. A wrong guess means part of a save stops syncing without the user knowing, which is a bigger risk than Keep each device's game settings out of sync #84's database-listed files. In this version, detected files should be shown in the game's configuration tab as suggested settings files, and keep syncing until the user confirms them there. The game database's files stay automatic, as they are now.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants