From 8993c5dccd89db787c3ead308281e88a0ecdff68 Mon Sep 17 00:00:00 2001 From: Ole <4692497+Guacam-Ole@users.noreply.github.com> Date: Thu, 26 Nov 2026 16:07:53 +0100 Subject: [PATCH 1/5] games: Graveyard Keeper 2 reader (day counter from the .info sidecar) Contribution per AGENTS.md: games/graveyard_keeper_2/ with reader, tests, proof record, icons and stages.json. The reader parses only the small JSON sidecar the game writes next to each slot (Steam_1.info); the 12 MB binary .dat is never opened. Proof: four rolling backups of one playthrough (day 110, 111, 113, 114 with increasing saveDateTime). graveyardQuality, churchQuality, villageRep and townCitizens were constant across all stages and stay unproven. i18n/en.json carries the "Day" fact label the gate expects. Checks: python tools/run_game_tests.py graveyard_keeper_2 (5 tests OK); python tools/gate/check_cards.py graveyard_keeper_2 -> PASSED, proven ['day', 'saved_at']. Stage files are the contributor's own saves without personal data and stay out of Git per stages/.gitignore. Co-Authored-By: Claude Fable 5.1 --- games/graveyard_keeper_2/README.md | 28 +++++ games/graveyard_keeper_2/icons.json | 3 + games/graveyard_keeper_2/proof.md | 16 +++ games/graveyard_keeper_2/reader.py | 115 +++++++++++++++++++++ games/graveyard_keeper_2/stages.json | 9 ++ games/graveyard_keeper_2/stages/.gitignore | 2 + games/graveyard_keeper_2/tables.py | 19 ++++ games/graveyard_keeper_2/test_reader.py | 44 ++++++++ i18n/en.json | 7 ++ 9 files changed, 243 insertions(+) create mode 100644 games/graveyard_keeper_2/README.md create mode 100644 games/graveyard_keeper_2/icons.json create mode 100644 games/graveyard_keeper_2/proof.md create mode 100644 games/graveyard_keeper_2/reader.py create mode 100644 games/graveyard_keeper_2/stages.json create mode 100644 games/graveyard_keeper_2/stages/.gitignore create mode 100644 games/graveyard_keeper_2/tables.py create mode 100644 games/graveyard_keeper_2/test_reader.py create mode 100644 i18n/en.json diff --git a/games/graveyard_keeper_2/README.md b/games/graveyard_keeper_2/README.md new file mode 100644 index 0000000..954f2dd --- /dev/null +++ b/games/graveyard_keeper_2/README.md @@ -0,0 +1,28 @@ +# graveyard_keeper_2 + +Steam appid: `4358690`. Status: **proven** (day counter); quality/reputation fields unproven. + +## Save locations + +- Windows: `%USERPROFILE%\AppData\LocalLow\Lazy Bear Games\Graveyard Keeper 2\.info` and `.dat` +- Steam Deck / Proton: `steamapps/compatdata/4358690/pfx/drive_c/users/steamuser/AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/` + +The reader uses `ddsaves._common.proton_user(4358690)` to walk every Steam library and picks the newest `*.info`. +Only the small JSON sidecar is read; the 12 MB binary `.dat` is never opened. + +## What the card shows + +- `day` — in-game day (fact id `day`, label `facts.graveyard_keeper_2.day`). +- `observed_at` — the save timestamp from `saveDateTime`. + +## What stays hidden + +`graveyardQuality`, `churchQuality`, `villageRep`, `townCitizens` are decoded into `progress` but were constant across all +four stages, so they remain `unproven` and are not displayed. See `proof.md`. + +## Checks + +```bash +python tools/run_game_tests.py graveyard_keeper_2 +python tools/gate/check_cards.py graveyard_keeper_2 +``` diff --git a/games/graveyard_keeper_2/icons.json b/games/graveyard_keeper_2/icons.json new file mode 100644 index 0000000..41f933c --- /dev/null +++ b/games/graveyard_keeper_2/icons.json @@ -0,0 +1,3 @@ +{ + "day": {"subject": "a small sun above a horizon line, as on a calendar day marker", "reference": "the in-game day counter shown next to the clock HUD"} +} diff --git a/games/graveyard_keeper_2/proof.md b/games/graveyard_keeper_2/proof.md new file mode 100644 index 0000000..de50232 --- /dev/null +++ b/games/graveyard_keeper_2/proof.md @@ -0,0 +1,16 @@ +# Evidence record — Graveyard Keeper 2 + +Status: **proven (1 field shown)**. Saves are the contributor's own, Steam build 1.011.1, Proton on Linux. +Source files: `AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/Steam_1*.info` (JSON sidecars written by the game). +The binary `Steam_1*.dat` world files were not parsed. + +| field | stage 1 | stage 2 | stage 3 | stage 4 | game-visible evidence | source table | decision | +|---|---|---|---|---|---|---|---| +| day | 110 | 111 | 113 | 114 | HUD day counter | none needed (number) | proven, shown | +| saved_at | 20:53 | 21:08 | 21:26 | 21:32 (2026-11-09) | save slot timestamp | none | proven, used as observed_at | +| graveyardQuality | 28 | 28 | 28 | 28 | — | — | unproven (constant) | +| churchQuality | 36 | 36 | 36 | 36 | — | — | unproven (constant) | +| villageRep | 17 | 17 | 17 | 17 | — | — | unproven (constant) | +| townCitizens | 20 | 20 | 20 | 20 | — | — | unproven (constant) | + +Stages are the game's own rolling backups of one slot (`_backup_3` oldest → `Steam_1` newest), copied into the ignored `stages/` folder. diff --git a/games/graveyard_keeper_2/reader.py b/games/graveyard_keeper_2/reader.py new file mode 100644 index 0000000..21362f3 --- /dev/null +++ b/games/graveyard_keeper_2/reader.py @@ -0,0 +1,115 @@ +"""Graveyard Keeper 2 (appid 4358690): read-only, stdlib reader for the save metadata sidecar. + +Each slot writes two files next to each other: ``.dat`` (binary Unity/C# world state, +~12 MB) and ``.info`` (small JSON written by the game). Only the ``.info`` sidecar is +parsed here; the ``.dat`` is never opened. + +Proof (4 stages of one playthrough, see proof.md): ``day`` grows 110 -> 111 -> 113 -> 114 and +``saveDateTime`` changes with it. ``graveyardQuality``, ``churchQuality``, ``villageRep`` and +``townCitizens`` were constant across all stages and therefore stay unproven and hidden. +""" +from __future__ import annotations +import json +import os +from datetime import datetime +from pathlib import Path + +try: + from ddsaves._common import proton_user, newest, read_bytes +except ImportError: # pragma: no cover - the proof gate always exposes plugin/py_modules + proton_user = None + + def newest(paths): + best = None + for p in paths: + if p.is_file() and (best is None or p.stat().st_mtime > best.stat().st_mtime): + best = p + return best + + def read_bytes(path): + return Path(path).read_bytes() + +APPID = 4358690 +SUB = "AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2" +INFO_GLOB = "*.info" +TIME_FORMAT = "%m/%d/%Y %I:%M:%S %p" + + +def _empty() -> dict: + return {"place": None, "chapter": None, "objective": None, "progress": {}, + "facts": [], "proven": [], "unproven": [], "fact_sources": {}} + + +def _candidate_dirs() -> list: + out = [] + if os.environ.get("USERPROFILE"): + out.append(Path(os.environ["USERPROFILE"]) / SUB) + if proton_user is not None: + out.extend(p / SUB for p in proton_user(APPID)) + return out + + +def find(path_or_dir=None): + if path_or_dir is not None: + p = Path(path_or_dir) + if p.is_file(): + return p + if p.is_dir(): + return newest(p.glob(INFO_GLOB)) or newest(p.rglob(INFO_GLOB)) + return None + for folder in _candidate_dirs(): + found = newest(folder.glob(INFO_GLOB)) + if found: + return found + return None + + +def _parse_time(text): + try: + return datetime.strptime(str(text), TIME_FORMAT).timestamp() + except (TypeError, ValueError): + return None + + +def read(path_or_dir=None) -> dict: + path = find(path_or_dir) + if path is None: + return _empty() + try: + info = json.loads(read_bytes(path).decode("utf-8")) + except (OSError, ValueError, UnicodeDecodeError): + return _empty() + if not isinstance(info, dict): + return _empty() + day = info.get("day") + if not isinstance(day, int) or isinstance(day, bool): + return _empty() + saved_at = _parse_time(info.get("saveDateTime")) + progress = { + "day": day, + "saved_at": saved_at, + "is_autosave": info.get("isAutoSave") is True, + "game_save_version": info.get("gameSaveVersion"), + "graveyard_quality": info.get("graveyardQuality"), + "church_quality": info.get("churchQuality"), + "village_rep": info.get("villageRep"), + "town_citizens": info.get("townCitizens"), + } + facts = [{"id": "day", "icon": "day", "value": str(day)}] + out = _empty() + out.update({ + "progress": progress, + "facts": facts, + "proven": ["day", "saved_at"], + "unproven": ["graveyard_quality", "church_quality", "village_rep", "town_citizens", + "is_autosave", "game_save_version"], + "fact_sources": {"day": "day"}, + "observed_at": saved_at if saved_at is not None else path.stat().st_mtime, + "source_path": str(path), + }) + return out + + +if __name__ == "__main__": + import sys + print(json.dumps(read(sys.argv[1] if len(sys.argv) > 1 else None), ensure_ascii=False, indent=2)) diff --git a/games/graveyard_keeper_2/stages.json b/games/graveyard_keeper_2/stages.json new file mode 100644 index 0000000..afc7419 --- /dev/null +++ b/games/graveyard_keeper_2/stages.json @@ -0,0 +1,9 @@ +{ + "appid": 4358690, + "stages": [ + {"path": "stages/stage1_day110.info", "note": "Steam_1_backup_3.info, 2026-11-09 20:53, day 110"}, + {"path": "stages/stage2_day111.info", "note": "Steam_1_backup_2.info, 2026-11-09 21:08, day 111"}, + {"path": "stages/stage3_day113.info", "note": "Steam_1_backup_1.info, 2026-11-09 21:26, day 113"}, + {"path": "stages/stage4_day114.info", "note": "Steam_1.info, 2026-11-09 21:32, day 114"} + ] +} diff --git a/games/graveyard_keeper_2/stages/.gitignore b/games/graveyard_keeper_2/stages/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/games/graveyard_keeper_2/stages/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/games/graveyard_keeper_2/tables.py b/games/graveyard_keeper_2/tables.py new file mode 100644 index 0000000..d5f34c4 --- /dev/null +++ b/games/graveyard_keeper_2/tables.py @@ -0,0 +1,19 @@ +"""Graveyard Keeper 2 needs no name table: the card shows only numbers read from the .info sidecar. + +Kept for the contribution layout. If a future version displays named places or items, generate +data/graveyard_keeper_2..json from the game's own localisation here. +""" +import argparse +from pathlib import Path + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("game_files", type=Path, nargs="?") + parser.add_argument("--language", choices=("en", "ru", "uk"), default="en") + parser.parse_args() + print("graveyard_keeper_2: no name table required (numeric facts only)") + + +if __name__ == "__main__": + main() diff --git a/games/graveyard_keeper_2/test_reader.py b/games/graveyard_keeper_2/test_reader.py new file mode 100644 index 0000000..ce7719b --- /dev/null +++ b/games/graveyard_keeper_2/test_reader.py @@ -0,0 +1,44 @@ +"""Golden values read by hand from the four .info sidecars (not copied from reader output).""" +from pathlib import Path +import unittest +from reader import read + +HERE = Path(__file__).resolve().parent / "stages" + + +class ReaderTests(unittest.TestCase): + def test_stage_days(self): + expected = {"stage1_day110.info": 110, "stage2_day111.info": 111, + "stage3_day113.info": 113, "stage4_day114.info": 114} + for name, day in expected.items(): + card = read(HERE / name) + self.assertEqual(card["progress"]["day"], day, name) + self.assertEqual(card["facts"], [{"id": "day", "icon": "day", "value": str(day)}]) + self.assertIn("day", card["proven"]) + self.assertEqual(card["fact_sources"]["day"], "day") + + def test_saved_at_is_parsed_and_increases(self): + times = [read(HERE / n)["progress"]["saved_at"] for n in sorted(HERE.glob("stage*.info"))] + self.assertTrue(all(isinstance(t, float) for t in times)) + self.assertEqual(times, sorted(times)) + + def test_constant_fields_stay_hidden(self): + card = read(HERE / "stage4_day114.info") + self.assertEqual(card["progress"]["village_rep"], 17) + for field in ("graveyard_quality", "church_quality", "village_rep", "town_citizens"): + self.assertIn(field, card["unproven"]) + self.assertNotIn(field, card["proven"]) + self.assertIsNone(card["place"]) + + def test_directory_picks_newest_info(self): + card = read(HERE) + self.assertEqual(card["progress"]["day"], 114) + + def test_missing_input_displays_nothing(self): + card = read(HERE / "does_not_exist.info") + self.assertEqual(card["facts"], []) + self.assertEqual(card["proven"], []) + + +if __name__ == "__main__": + unittest.main() diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..958dde9 --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,7 @@ +{ + "facts": { + "graveyard_keeper_2": { + "day": "Day" + } + } +} From 90090195ab1c2c6ebb9c8fe523fedc0ea136c164 Mon Sep 17 00:00:00 2001 From: Ole <4692497+Guacam-Ole@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:08:28 +0100 Subject: [PATCH 2/5] games: Graveyard Keeper 2 shows graveyard and church quality (7 stages) Three new stages (days 116-117, game 1.012.9) move graveyardQuality 28 -> 23 and churchQuality 36 -> 29 while the day counter keeps growing; both match the values the player reads in the game and are declared nonmonotonic (state values, not counters). villageRep (17 in every file) did not match the HUD reputation (5) and stays hidden; townCitizens is still constant and unproven. Labels are the game's own strings ("Graveyard Quality", "Church Quality"). Co-Authored-By: Claude Fable 5.1 --- games/graveyard_keeper_2/README.md | 14 +++++-- games/graveyard_keeper_2/icons.json | 13 ++++++- games/graveyard_keeper_2/proof.md | 34 +++++++++++------ games/graveyard_keeper_2/reader.py | 29 +++++++++++---- games/graveyard_keeper_2/stages.json | 32 ++++++++++++++-- games/graveyard_keeper_2/test_reader.py | 49 ++++++++++++++++++------- i18n/en.json | 4 +- 7 files changed, 133 insertions(+), 42 deletions(-) diff --git a/games/graveyard_keeper_2/README.md b/games/graveyard_keeper_2/README.md index 954f2dd..64eb6cb 100644 --- a/games/graveyard_keeper_2/README.md +++ b/games/graveyard_keeper_2/README.md @@ -1,6 +1,6 @@ # graveyard_keeper_2 -Steam appid: `4358690`. Status: **proven** (day counter); quality/reputation fields unproven. +Steam appid: `4358690`. Status: **proven** (day, graveyard quality, church quality); reputation and citizens hidden. ## Save locations @@ -8,17 +8,23 @@ Steam appid: `4358690`. Status: **proven** (day counter); quality/reputation fie - Steam Deck / Proton: `steamapps/compatdata/4358690/pfx/drive_c/users/steamuser/AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/` The reader uses `ddsaves._common.proton_user(4358690)` to walk every Steam library and picks the newest `*.info`. -Only the small JSON sidecar is read; the 12 MB binary `.dat` is never opened. +Only the small JSON sidecar is read; the 12 MB binary `.dat` is never opened. Steam Cloud syncs the sidecars, so a Deck +shows the same card as the PC. ## What the card shows - `day` — in-game day (fact id `day`, label `facts.graveyard_keeper_2.day`). +- `graveyard_quality` — the game's "Graveyard Quality" value (declared non-monotonic: it can fall). +- `church_quality` — the game's "Church Quality" value (declared non-monotonic). - `observed_at` — the save timestamp from `saveDateTime`. ## What stays hidden -`graveyardQuality`, `churchQuality`, `villageRep`, `townCitizens` are decoded into `progress` but were constant across all -four stages, so they remain `unproven` and are not displayed. See `proof.md`. +- `villageRep`: the sidecar value (17) did not match the reputation the player saw in the HUD (5), so its meaning is + unknown and it is never displayed. +- `townCitizens`: matched the HUD (20) but was constant across all seven stages, so it stays unproven. + +See `proof.md` for the stage table. ## Checks diff --git a/games/graveyard_keeper_2/icons.json b/games/graveyard_keeper_2/icons.json index 41f933c..1a26e50 100644 --- a/games/graveyard_keeper_2/icons.json +++ b/games/graveyard_keeper_2/icons.json @@ -1,3 +1,14 @@ { - "day": {"subject": "a small sun above a horizon line, as on a calendar day marker", "reference": "the in-game day counter shown next to the clock HUD"} + "day": { + "subject": "a small sun above a horizon line, as on a calendar day marker", + "reference": "the in-game day counter shown next to the clock HUD" + }, + "graveyard_quality": { + "subject": "a small stylised skull, as the game's own graveyard-quality marker", + "reference": "the skull sprite next to the Graveyard Quality value in the graveyard HUD/inspection panel" + }, + "church_quality": { + "subject": "a small chapel outline with a cross on the roof", + "reference": "the Church Quality value shown in the church inspection panel" + } } diff --git a/games/graveyard_keeper_2/proof.md b/games/graveyard_keeper_2/proof.md index de50232..7011506 100644 --- a/games/graveyard_keeper_2/proof.md +++ b/games/graveyard_keeper_2/proof.md @@ -1,16 +1,26 @@ # Evidence record — Graveyard Keeper 2 -Status: **proven (1 field shown)**. Saves are the contributor's own, Steam build 1.011.1, Proton on Linux. -Source files: `AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/Steam_1*.info` (JSON sidecars written by the game). -The binary `Steam_1*.dat` world files were not parsed. +Status: **proven (3 fields shown)**. Saves are the contributor's own, one playthrough, Steam builds 1.011.1 (stages 1–4) +and 1.012.9 (stages 5–7), Proton on Linux. Source files: `AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/Steam_1*.info` +(JSON sidecars written by the game). The binary `Steam_1*.dat` world files were not parsed. -| field | stage 1 | stage 2 | stage 3 | stage 4 | game-visible evidence | source table | decision | -|---|---|---|---|---|---|---|---| -| day | 110 | 111 | 113 | 114 | HUD day counter | none needed (number) | proven, shown | -| saved_at | 20:53 | 21:08 | 21:26 | 21:32 (2026-11-09) | save slot timestamp | none | proven, used as observed_at | -| graveyardQuality | 28 | 28 | 28 | 28 | — | — | unproven (constant) | -| churchQuality | 36 | 36 | 36 | 36 | — | — | unproven (constant) | -| villageRep | 17 | 17 | 17 | 17 | — | — | unproven (constant) | -| townCitizens | 20 | 20 | 20 | 20 | — | — | unproven (constant) | +| field | s1 | s2 | s3 | s4 | s5 | s6 | s7 | game-visible evidence | source table | decision | +|---|---|---|---|---|---|---|---|---|---|---| +| day | 110 | 111 | 113 | 114 | 116 | 117 | 117 | HUD day counter | none needed (number) | proven, shown | +| saved_at | 20:53 | 21:08 | 21:26 | 21:32 (11-09) | 21:52 | 21:58 | 22:02 (11-26) | save slot timestamp | none | proven, used as observed_at | +| graveyardQuality | 28 | 28 | 28 | 28 | 23 | 23 | 23 | "Graveyard Quality" value in the graveyard panel; player read 23 at s7 | label from game strings | proven, shown, **nonmonotonic** | +| churchQuality | 36 | 36 | 36 | 36 | 36 | 36 | 29 | "Church Quality" value in the church panel; player read 29 at s7 | label from game strings | proven, shown, **nonmonotonic** | +| villageRep | 17 | 17 | 17 | 17 | 17 | 17 | 17 | player read reputation **5** at s7, file says 17 (`repValue: false`) | — | **hidden: meaning does not match the HUD** | +| townCitizens | 20 | 20 | 20 | 20 | 20 | 20 | 20 | player read 20 at s7 (matches) | — | unproven (constant) | -Stages are the game's own rolling backups of one slot (`_backup_3` oldest → `Steam_1` newest), copied into the ignored `stages/` folder. +Non-monotonic declaration: both quality values are state values the game recomputes from the current graves / church +state, not counters. They dropped between stages (28 → 23 across the 1.011.1 → 1.012.9 update, 36 → 29 within one session) +while the day counter kept growing, so `read()` declares them in `nonmonotonic` with the reason; the gate flags them for +human review instead of failing. + +Label strings exist in the game's `resources.assets`: `Graveyard Quality`, `Church Quality` (EN), `Качество кладбища`, +`Качество церкви` (RU), `Friedhofsqualität`, `Kirchenqualität` (DE). The game marks graveyard quality with its own skull +sprite (``), hence the icon subject. + +Stages are the game's rolling backups of one slot (`_backup_3` oldest → `Steam_1` newest), copied into the ignored +`stages/` folder; stage 5 and the two day-117 stages show the quality fields moving independently of `day`. diff --git a/games/graveyard_keeper_2/reader.py b/games/graveyard_keeper_2/reader.py index 21362f3..6fa8c87 100644 --- a/games/graveyard_keeper_2/reader.py +++ b/games/graveyard_keeper_2/reader.py @@ -4,9 +4,10 @@ ~12 MB) and ``.info`` (small JSON written by the game). Only the ``.info`` sidecar is parsed here; the ``.dat`` is never opened. -Proof (4 stages of one playthrough, see proof.md): ``day`` grows 110 -> 111 -> 113 -> 114 and -``saveDateTime`` changes with it. ``graveyardQuality``, ``churchQuality``, ``villageRep`` and -``townCitizens`` were constant across all stages and therefore stay unproven and hidden. +Proof (7 stages of one playthrough, see proof.md): ``day`` grows 110 -> 117 and ``saveDateTime`` +with it. ``graveyardQuality`` (28 -> 23) and ``churchQuality`` (36 -> 29) change between stages and +match the HUD values the player sees; both are state values the game recomputes, so they are +declared ``nonmonotonic``. ``villageRep`` and ``townCitizens`` stayed constant and remain unproven. """ from __future__ import annotations import json @@ -96,14 +97,28 @@ def read(path_or_dir=None) -> dict: "town_citizens": info.get("townCitizens"), } facts = [{"id": "day", "icon": "day", "value": str(day)}] + fact_sources = {"day": "day"} + proven = ["day", "saved_at"] + unproven = ["village_rep", "town_citizens", "is_autosave", "game_save_version"] + for field in ("graveyard_quality", "church_quality"): + value = progress[field] + if isinstance(value, int) and not isinstance(value, bool): + facts.append({"id": field, "icon": field, "value": str(value)}) + fact_sources[field] = field + proven.append(field) + else: + unproven.append(field) out = _empty() out.update({ "progress": progress, "facts": facts, - "proven": ["day", "saved_at"], - "unproven": ["graveyard_quality", "church_quality", "village_rep", "town_citizens", - "is_autosave", "game_save_version"], - "fact_sources": {"day": "day"}, + "proven": proven, + "unproven": unproven, + "fact_sources": fact_sources, + "nonmonotonic": { + "graveyard_quality": "sum of the current graves' quality; falls when graves decay, are reworked or removed (28 -> 23 observed across stages 4 -> 5)", + "church_quality": "current church state, recomputed by the game; fell 36 -> 29 within one session (stages 6 -> 7)", + }, "observed_at": saved_at if saved_at is not None else path.stat().st_mtime, "source_path": str(path), }) diff --git a/games/graveyard_keeper_2/stages.json b/games/graveyard_keeper_2/stages.json index afc7419..ce5a14f 100644 --- a/games/graveyard_keeper_2/stages.json +++ b/games/graveyard_keeper_2/stages.json @@ -1,9 +1,33 @@ { "appid": 4358690, "stages": [ - {"path": "stages/stage1_day110.info", "note": "Steam_1_backup_3.info, 2026-11-09 20:53, day 110"}, - {"path": "stages/stage2_day111.info", "note": "Steam_1_backup_2.info, 2026-11-09 21:08, day 111"}, - {"path": "stages/stage3_day113.info", "note": "Steam_1_backup_1.info, 2026-11-09 21:26, day 113"}, - {"path": "stages/stage4_day114.info", "note": "Steam_1.info, 2026-11-09 21:32, day 114"} + { + "path": "stages/stage1_day110.info", + "note": "Steam_1_backup_3.info, 2026-11-09 20:53, day 110" + }, + { + "path": "stages/stage2_day111.info", + "note": "Steam_1_backup_2.info, 2026-11-09 21:08, day 111" + }, + { + "path": "stages/stage3_day113.info", + "note": "Steam_1_backup_1.info, 2026-11-09 21:26, day 113" + }, + { + "path": "stages/stage4_day114.info", + "note": "Steam_1.info, 2026-11-09 21:32, day 114" + }, + { + "path": "stages/stage5_day116.info", + "note": "Steam_1_backup_3.info, 2026-11-26 21:52, day 116, game 1.012.9" + }, + { + "path": "stages/stage6_day117.info", + "note": "Steam_1_backup_1.info, 2026-11-26 21:58, day 117" + }, + { + "path": "stages/stage7_day117.info", + "note": "Steam_1.info, 2026-11-26 22:02, day 117, church quality changed" + } ] } diff --git a/games/graveyard_keeper_2/test_reader.py b/games/graveyard_keeper_2/test_reader.py index ce7719b..aab79ff 100644 --- a/games/graveyard_keeper_2/test_reader.py +++ b/games/graveyard_keeper_2/test_reader.py @@ -1,38 +1,61 @@ -"""Golden values read by hand from the four .info sidecars (not copied from reader output).""" +"""Golden values read by hand from the seven .info sidecars (not copied from reader output).""" from pathlib import Path import unittest from reader import read HERE = Path(__file__).resolve().parent / "stages" +# (day, graveyardQuality, churchQuality) typed from each JSON file by eye. +GOLDEN = { + "stage1_day110.info": (110, 28, 36), + "stage2_day111.info": (111, 28, 36), + "stage3_day113.info": (113, 28, 36), + "stage4_day114.info": (114, 28, 36), + "stage5_day116.info": (116, 23, 36), + "stage6_day117.info": (117, 23, 36), + "stage7_day117.info": (117, 23, 29), +} class ReaderTests(unittest.TestCase): - def test_stage_days(self): - expected = {"stage1_day110.info": 110, "stage2_day111.info": 111, - "stage3_day113.info": 113, "stage4_day114.info": 114} - for name, day in expected.items(): + def test_stage_values_and_facts(self): + for name, (day, graveyard, church) in GOLDEN.items(): card = read(HERE / name) self.assertEqual(card["progress"]["day"], day, name) - self.assertEqual(card["facts"], [{"id": "day", "icon": "day", "value": str(day)}]) - self.assertIn("day", card["proven"]) - self.assertEqual(card["fact_sources"]["day"], "day") + self.assertEqual(card["progress"]["graveyard_quality"], graveyard, name) + self.assertEqual(card["progress"]["church_quality"], church, name) + self.assertEqual(card["facts"], [ + {"id": "day", "icon": "day", "value": str(day)}, + {"id": "graveyard_quality", "icon": "graveyard_quality", "value": str(graveyard)}, + {"id": "church_quality", "icon": "church_quality", "value": str(church)}, + ], name) + for field in ("day", "graveyard_quality", "church_quality"): + self.assertIn(field, card["proven"]) + self.assertEqual(card["fact_sources"][field], field) + + def test_quality_fields_declare_nonmonotonic(self): + card = read(HERE / "stage7_day117.info") + for field in ("graveyard_quality", "church_quality"): + self.assertTrue(card["nonmonotonic"][field].strip()) + self.assertNotIn("day", card["nonmonotonic"]) def test_saved_at_is_parsed_and_increases(self): times = [read(HERE / n)["progress"]["saved_at"] for n in sorted(HERE.glob("stage*.info"))] self.assertTrue(all(isinstance(t, float) for t in times)) self.assertEqual(times, sorted(times)) - def test_constant_fields_stay_hidden(self): - card = read(HERE / "stage4_day114.info") - self.assertEqual(card["progress"]["village_rep"], 17) - for field in ("graveyard_quality", "church_quality", "village_rep", "town_citizens"): + def test_unverified_fields_stay_hidden(self): + card = read(HERE / "stage7_day117.info") + self.assertEqual(card["progress"]["village_rep"], 17) # HUD showed 5 at this stage: field meaning unknown + self.assertEqual(card["progress"]["town_citizens"], 20) + for field in ("village_rep", "town_citizens"): self.assertIn(field, card["unproven"]) self.assertNotIn(field, card["proven"]) self.assertIsNone(card["place"]) def test_directory_picks_newest_info(self): card = read(HERE) - self.assertEqual(card["progress"]["day"], 114) + self.assertEqual(card["progress"]["day"], 117) + self.assertEqual(card["progress"]["church_quality"], 29) def test_missing_input_displays_nothing(self): card = read(HERE / "does_not_exist.info") diff --git a/i18n/en.json b/i18n/en.json index 958dde9..7609864 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,7 +1,9 @@ { "facts": { "graveyard_keeper_2": { - "day": "Day" + "day": "Day", + "graveyard_quality": "Graveyard Quality", + "church_quality": "Church Quality" } } } From e6fdc087563a4fad390a8f27972e5db68e0933af Mon Sep 17 00:00:00 2001 From: Ole <4692497+Guacam-Ole@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:10:09 +0100 Subject: [PATCH 3/5] games: Graveyard Keeper 2 proof: villageRep does not track the HUD reputation Co-Authored-By: Claude Fable 5.1 --- games/graveyard_keeper_2/README.md | 2 +- games/graveyard_keeper_2/proof.md | 2 +- games/graveyard_keeper_2/test_reader.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/games/graveyard_keeper_2/README.md b/games/graveyard_keeper_2/README.md index 64eb6cb..9e747da 100644 --- a/games/graveyard_keeper_2/README.md +++ b/games/graveyard_keeper_2/README.md @@ -20,7 +20,7 @@ shows the same card as the PC. ## What stays hidden -- `villageRep`: the sidecar value (17) did not match the reputation the player saw in the HUD (5), so its meaning is +- `villageRep`: the sidecar value stayed 17 while the HUD reputation went from 0 to 10 between saves, so its meaning is unknown and it is never displayed. - `townCitizens`: matched the HUD (20) but was constant across all seven stages, so it stays unproven. diff --git a/games/graveyard_keeper_2/proof.md b/games/graveyard_keeper_2/proof.md index 7011506..28531a0 100644 --- a/games/graveyard_keeper_2/proof.md +++ b/games/graveyard_keeper_2/proof.md @@ -10,7 +10,7 @@ and 1.012.9 (stages 5–7), Proton on Linux. Source files: `AppData/LocalLow/Laz | saved_at | 20:53 | 21:08 | 21:26 | 21:32 (11-09) | 21:52 | 21:58 | 22:02 (11-26) | save slot timestamp | none | proven, used as observed_at | | graveyardQuality | 28 | 28 | 28 | 28 | 23 | 23 | 23 | "Graveyard Quality" value in the graveyard panel; player read 23 at s7 | label from game strings | proven, shown, **nonmonotonic** | | churchQuality | 36 | 36 | 36 | 36 | 36 | 36 | 29 | "Church Quality" value in the church panel; player read 29 at s7 | label from game strings | proven, shown, **nonmonotonic** | -| villageRep | 17 | 17 | 17 | 17 | 17 | 17 | 17 | player read reputation **5** at s7, file says 17 (`repValue: false`) | — | **hidden: meaning does not match the HUD** | +| villageRep | 17 | 17 | 17 | 17 | 17 | 17 | 17 | HUD reputation was 0 in the old saves and 10 in a save written after s7 (22:09); the file says 17 in every case, with `repValue: false` | — | **hidden: field does not track the HUD reputation** | | townCitizens | 20 | 20 | 20 | 20 | 20 | 20 | 20 | player read 20 at s7 (matches) | — | unproven (constant) | Non-monotonic declaration: both quality values are state values the game recomputes from the current graves / church diff --git a/games/graveyard_keeper_2/test_reader.py b/games/graveyard_keeper_2/test_reader.py index aab79ff..2efe005 100644 --- a/games/graveyard_keeper_2/test_reader.py +++ b/games/graveyard_keeper_2/test_reader.py @@ -45,7 +45,7 @@ def test_saved_at_is_parsed_and_increases(self): def test_unverified_fields_stay_hidden(self): card = read(HERE / "stage7_day117.info") - self.assertEqual(card["progress"]["village_rep"], 17) # HUD showed 5 at this stage: field meaning unknown + self.assertEqual(card["progress"]["village_rep"], 17) # HUD reputation moved 0 -> 10 while this stayed 17: not the HUD value self.assertEqual(card["progress"]["town_citizens"], 20) for field in ("village_rep", "town_citizens"): self.assertIn(field, card["unproven"]) From 357244aeccd5120e4d53ee7a0dea53bdf0a9bc6f Mon Sep 17 00:00:00 2001 From: Ole <4692497+Guacam-Ole@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:15:23 +0100 Subject: [PATCH 4/5] games: Graveyard Keeper 2 shows town happiness from the .dat (8 stages) The HUD thumbs-up counter is not in the .info sidecar; it is the typed float variable "happiness" in the uncompressed .dat (UTF-16 field names, entropy 3.7 bits/byte). A byte scan for that one variable gives 0 -> 3 -> 3 -> 0 -> 5 -> 5 -> 5 -> 10 across eight stages, matching what the player read in the HUD (0/20, 5/20, 10/20). It is a spendable resource, so it is declared nonmonotonic. The /20 cap is not stored in the save and is not displayed. Stages are now folders holding .info + .dat. Co-Authored-By: Claude Fable 5.1 --- games/graveyard_keeper_2/README.md | 11 ++++-- games/graveyard_keeper_2/icons.json | 4 ++ games/graveyard_keeper_2/proof.md | 47 ++++++++++++++--------- games/graveyard_keeper_2/reader.py | 51 +++++++++++++++++++++++-- games/graveyard_keeper_2/stages.json | 32 +++++++++------- games/graveyard_keeper_2/test_reader.py | 45 ++++++++++++++-------- i18n/en.json | 3 +- 7 files changed, 136 insertions(+), 57 deletions(-) diff --git a/games/graveyard_keeper_2/README.md b/games/graveyard_keeper_2/README.md index 9e747da..439a105 100644 --- a/games/graveyard_keeper_2/README.md +++ b/games/graveyard_keeper_2/README.md @@ -1,6 +1,6 @@ # graveyard_keeper_2 -Steam appid: `4358690`. Status: **proven** (day, graveyard quality, church quality); reputation and citizens hidden. +Steam appid: `4358690`. Status: **proven** (day, graveyard quality, church quality, happiness); reputation and citizens hidden. ## Save locations @@ -8,21 +8,24 @@ Steam appid: `4358690`. Status: **proven** (day, graveyard quality, church quali - Steam Deck / Proton: `steamapps/compatdata/4358690/pfx/drive_c/users/steamuser/AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/` The reader uses `ddsaves._common.proton_user(4358690)` to walk every Steam library and picks the newest `*.info`. -Only the small JSON sidecar is read; the 12 MB binary `.dat` is never opened. Steam Cloud syncs the sidecars, so a Deck -shows the same card as the PC. +The JSON sidecar gives day, time and the zone qualities. The sibling `.dat` (13 MB, uncompressed) is scanned once for +the single typed variable `happiness`; nothing else in it is interpreted and it is never written. Steam Cloud syncs +both files, so a Deck shows the same card as the PC. ## What the card shows - `day` — in-game day (fact id `day`, label `facts.graveyard_keeper_2.day`). - `graveyard_quality` — the game's "Graveyard Quality" value (declared non-monotonic: it can fall). - `church_quality` — the game's "Church Quality" value (declared non-monotonic). +- `happiness` — the town happiness shown with the thumbs-up icon in the HUD (declared non-monotonic: it is spent). + Only the current value is shown; the HUD's `/20` cap is not stored in the save, so it is not displayed. - `observed_at` — the save timestamp from `saveDateTime`. ## What stays hidden - `villageRep`: the sidecar value stayed 17 while the HUD reputation went from 0 to 10 between saves, so its meaning is unknown and it is never displayed. -- `townCitizens`: matched the HUD (20) but was constant across all seven stages, so it stays unproven. +- `townCitizens`: matched the HUD (20) but was constant across all eight stages, so it stays unproven. See `proof.md` for the stage table. diff --git a/games/graveyard_keeper_2/icons.json b/games/graveyard_keeper_2/icons.json index 1a26e50..21df2b7 100644 --- a/games/graveyard_keeper_2/icons.json +++ b/games/graveyard_keeper_2/icons.json @@ -10,5 +10,9 @@ "church_quality": { "subject": "a small chapel outline with a cross on the roof", "reference": "the Church Quality value shown in the church inspection panel" + }, + "happiness": { + "subject": "a small thumbs-up hand", + "reference": "the town happiness icon (sprite `happiness`) next to the x/y counter in the HUD" } } diff --git a/games/graveyard_keeper_2/proof.md b/games/graveyard_keeper_2/proof.md index 28531a0..a48ea6a 100644 --- a/games/graveyard_keeper_2/proof.md +++ b/games/graveyard_keeper_2/proof.md @@ -1,26 +1,35 @@ # Evidence record — Graveyard Keeper 2 -Status: **proven (3 fields shown)**. Saves are the contributor's own, one playthrough, Steam builds 1.011.1 (stages 1–4) -and 1.012.9 (stages 5–7), Proton on Linux. Source files: `AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2/Steam_1*.info` -(JSON sidecars written by the game). The binary `Steam_1*.dat` world files were not parsed. +Status: **proven (4 fields shown)**. Saves are the contributor's own, one playthrough, Steam builds 1.011.1 (stages 1–4) +and 1.012.9 (stages 5–8), Proton on Linux (stages 1–4 are the Steam Cloud copies on a Steam Deck, 5–8 the PC's rolling +backups). Each stage folder holds the slot's `Steam_1.info` (JSON sidecar) and `Steam_1.dat` (binary world state, +uncompressed: entropy 3.7 bits/byte, UTF-16 field names of the C# serializer). -| field | s1 | s2 | s3 | s4 | s5 | s6 | s7 | game-visible evidence | source table | decision | -|---|---|---|---|---|---|---|---|---|---|---| -| day | 110 | 111 | 113 | 114 | 116 | 117 | 117 | HUD day counter | none needed (number) | proven, shown | -| saved_at | 20:53 | 21:08 | 21:26 | 21:32 (11-09) | 21:52 | 21:58 | 22:02 (11-26) | save slot timestamp | none | proven, used as observed_at | -| graveyardQuality | 28 | 28 | 28 | 28 | 23 | 23 | 23 | "Graveyard Quality" value in the graveyard panel; player read 23 at s7 | label from game strings | proven, shown, **nonmonotonic** | -| churchQuality | 36 | 36 | 36 | 36 | 36 | 36 | 29 | "Church Quality" value in the church panel; player read 29 at s7 | label from game strings | proven, shown, **nonmonotonic** | -| villageRep | 17 | 17 | 17 | 17 | 17 | 17 | 17 | HUD reputation was 0 in the old saves and 10 in a save written after s7 (22:09); the file says 17 in every case, with `repValue: false` | — | **hidden: field does not track the HUD reputation** | -| townCitizens | 20 | 20 | 20 | 20 | 20 | 20 | 20 | player read 20 at s7 (matches) | — | unproven (constant) | +| field | s1 | s2 | s3 | s4 | s5 | s6 | s7 | s8 | game-visible evidence | source | decision | +|---|---|---|---|---|---|---|---|---|---|---|---| +| day (.info) | 110 | 111 | 113 | 114 | 116 | 117 | 117 | 117 | HUD day counter | number | proven, shown | +| saved_at (.info) | 20:53 | 21:08 | 21:26 | 21:32 (11-09) | 21:56 | 21:58 | 22:02 | 22:09 (11-26) | save slot timestamp | — | proven, observed_at | +| graveyardQuality (.info) | 28 | 28 | 28 | 28 | 23 | 23 | 23 | 23 | "Graveyard Quality" panel; player read 23 at s7/s8; equals `wz_graveyard` in the .dat | label from game strings | proven, shown, **nonmonotonic** | +| churchQuality (.info) | 36 | 36 | 36 | 36 | 36 | 36 | 29 | 29 | "Church Quality" panel; player read 29 at s7/s8; equals `wz_church` in the .dat | label from game strings | proven, shown, **nonmonotonic** | +| happiness (.dat) | 0 | 3 | 3 | 0 | 5 | 5 | 5 | 10 | HUD thumbs-up counter: player read 0/20 at s4, 5/20 at s5–s7, 10/20 at s8 | game identifier `happiness` / `town_happiness` | proven, shown, **nonmonotonic** | +| villageRep (.info) | 17 | 17 | 17 | 17 | 17 | 17 | 17 | 17 | never matched the HUD; `repValue: false`; equals `village_REP` in the .dat (an NPC-style reputation) | — | **hidden** | +| townCitizens (.info) | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | player read 20 (matches) | — | unproven (constant) | -Non-monotonic declaration: both quality values are state values the game recomputes from the current graves / church -state, not counters. They dropped between stages (28 → 23 across the 1.011.1 → 1.012.9 update, 36 → 29 within one session) -while the day counter kept growing, so `read()` declares them in `nonmonotonic` with the reason; the gate flags them for -human review instead of failing. +Non-monotonic declarations: the two quality values are state values recomputed from the current graves / church +(28 → 23 across the 1.011.1 → 1.012.9 update, 36 → 29 within one session). Happiness is a spendable town resource: the +game's own texts say "spend to get what you want" and it dropped 3 → 0 between s3 and s4. +`read()` declares all three in `nonmonotonic` with the reason, so the gate reports them for human review. -Label strings exist in the game's `resources.assets`: `Graveyard Quality`, `Church Quality` (EN), `Качество кладбища`, -`Качество церкви` (RU), `Friedhofsqualität`, `Kirchenqualität` (DE). The game marks graveyard quality with its own skull -sprite (``), hence the icon subject. +How `happiness` is read: the `.dat` stores typed variables as `\x01 \x1f\x01 \x05\0\0\0 "value" `. +The reader scans for that exact byte pattern with the name `happiness`; the value must occur exactly once with one value, +otherwise the field is `None` and hidden. Nothing else in the `.dat` is interpreted, and the file is never written. + +The HUD shows happiness as `x/20`. No variable in the `.dat` carries that cap (no `happiness_max`, no `happiness_cap`; +`townCitizens` happens to be 20 but is not proven to be the denominator), so the card shows only the current value. + +Label strings in the game's `resources.assets`: `Graveyard Quality`, `Church Quality` (EN), `Качество кладбища`, +`Качество церкви` (RU), `Friedhofsqualität`, `Kirchenqualität` (DE). Happiness has no text label in the HUD (icon only); +its identifier in the game data is `happiness` / `town_happiness`, so the fact label is the plain word "Happiness". Stages are the game's rolling backups of one slot (`_backup_3` oldest → `Steam_1` newest), copied into the ignored -`stages/` folder; stage 5 and the two day-117 stages show the quality fields moving independently of `day`. +`stages/` folder (`.info` + `.dat` per stage, ~13 MB each). diff --git a/games/graveyard_keeper_2/reader.py b/games/graveyard_keeper_2/reader.py index 6fa8c87..6d3a9b4 100644 --- a/games/graveyard_keeper_2/reader.py +++ b/games/graveyard_keeper_2/reader.py @@ -1,17 +1,22 @@ """Graveyard Keeper 2 (appid 4358690): read-only, stdlib reader for the save metadata sidecar. Each slot writes two files next to each other: ``.dat`` (binary Unity/C# world state, -~12 MB) and ``.info`` (small JSON written by the game). Only the ``.info`` sidecar is -parsed here; the ``.dat`` is never opened. +~13 MB, uncompressed, UTF-16 field names) and ``.info`` (small JSON written by the game). +The ``.info`` sidecar gives day, time and the two zone qualities. One typed variable is read +from the ``.dat`` by a byte scan: ``happiness``, the town happiness shown with the thumbs-up +icon in the HUD. Nothing else in the ``.dat`` is interpreted. Proof (7 stages of one playthrough, see proof.md): ``day`` grows 110 -> 117 and ``saveDateTime`` with it. ``graveyardQuality`` (28 -> 23) and ``churchQuality`` (36 -> 29) change between stages and match the HUD values the player sees; both are state values the game recomputes, so they are -declared ``nonmonotonic``. ``villageRep`` and ``townCitizens`` stayed constant and remain unproven. +declared ``nonmonotonic``. ``happiness`` (0 -> 3 -> 0 -> 5 -> 10) is a spendable town resource +and is declared ``nonmonotonic`` too. ``villageRep`` and ``townCitizens`` stay hidden. """ from __future__ import annotations import json +import math import os +import struct from datetime import datetime from pathlib import Path @@ -34,6 +39,39 @@ def read_bytes(path): SUB = "AppData/LocalLow/Lazy Bear Games/Graveyard Keeper 2" INFO_GLOB = "*.info" TIME_FORMAT = "%m/%d/%Y %I:%M:%S %p" +DAT_MAX_BYTES = 64 * 1024 * 1024 + + +def _utf16(text: str) -> bytes: + return text.encode("utf-16-le") + + +def _dat_variable(dat_path, name: str): + """Return the float value of a typed variable ``{type: , value: }`` in the .dat. + + The serializer writes ``\x01 \x1f\x01 \x05\0\0\0 "value" ``. + Returns None when the file is missing, too large, the name is absent or ambiguous. + """ + try: + if not dat_path.is_file() or dat_path.stat().st_size > DAT_MAX_BYTES: + return None + blob = read_bytes(dat_path) + except OSError: + return None + needle = struct.pack(" dict: @@ -86,7 +124,11 @@ def read(path_or_dir=None) -> dict: if not isinstance(day, int) or isinstance(day, bool): return _empty() saved_at = _parse_time(info.get("saveDateTime")) + happiness = _dat_variable(path.with_suffix(".dat"), "happiness") + if happiness is not None and happiness == int(happiness): + happiness = int(happiness) progress = { + "happiness": happiness, "day": day, "saved_at": saved_at, "is_autosave": info.get("isAutoSave") is True, @@ -100,7 +142,7 @@ def read(path_or_dir=None) -> dict: fact_sources = {"day": "day"} proven = ["day", "saved_at"] unproven = ["village_rep", "town_citizens", "is_autosave", "game_save_version"] - for field in ("graveyard_quality", "church_quality"): + for field in ("graveyard_quality", "church_quality", "happiness"): value = progress[field] if isinstance(value, int) and not isinstance(value, bool): facts.append({"id": field, "icon": field, "value": str(value)}) @@ -118,6 +160,7 @@ def read(path_or_dir=None) -> dict: "nonmonotonic": { "graveyard_quality": "sum of the current graves' quality; falls when graves decay, are reworked or removed (28 -> 23 observed across stages 4 -> 5)", "church_quality": "current church state, recomputed by the game; fell 36 -> 29 within one session (stages 6 -> 7)", + "happiness": "town happiness is a spendable resource ( in the game's own texts); 3 -> 0 observed between stages 3 and 4", }, "observed_at": saved_at if saved_at is not None else path.stat().st_mtime, "source_path": str(path), diff --git a/games/graveyard_keeper_2/stages.json b/games/graveyard_keeper_2/stages.json index ce5a14f..c48140f 100644 --- a/games/graveyard_keeper_2/stages.json +++ b/games/graveyard_keeper_2/stages.json @@ -2,32 +2,36 @@ "appid": 4358690, "stages": [ { - "path": "stages/stage1_day110.info", - "note": "Steam_1_backup_3.info, 2026-11-09 20:53, day 110" + "path": "stages/stage1_day110", + "note": "Steam_1_backup_3 (.info + .dat), 2026-11-09 20:53, day 110, game 1.011.1" }, { - "path": "stages/stage2_day111.info", - "note": "Steam_1_backup_2.info, 2026-11-09 21:08, day 111" + "path": "stages/stage2_day111", + "note": "Steam_1_backup_2, 2026-11-09 21:08, day 111" }, { - "path": "stages/stage3_day113.info", - "note": "Steam_1_backup_1.info, 2026-11-09 21:26, day 113" + "path": "stages/stage3_day113", + "note": "Steam_1_backup_1, 2026-11-09 21:26, day 113" }, { - "path": "stages/stage4_day114.info", - "note": "Steam_1.info, 2026-11-09 21:32, day 114" + "path": "stages/stage4_day114", + "note": "Steam_1, 2026-11-09 21:32, day 114 (Steam Cloud copy from the Deck)" }, { - "path": "stages/stage5_day116.info", - "note": "Steam_1_backup_3.info, 2026-11-26 21:52, day 116, game 1.012.9" + "path": "stages/stage5_day116", + "note": "Steam_1_backup_3, 2026-11-26 21:56, day 116, game 1.012.9" }, { - "path": "stages/stage6_day117.info", - "note": "Steam_1_backup_1.info, 2026-11-26 21:58, day 117" + "path": "stages/stage6_day117", + "note": "Steam_1_backup_2, 2026-11-26 21:58, day 117" }, { - "path": "stages/stage7_day117.info", - "note": "Steam_1.info, 2026-11-26 22:02, day 117, church quality changed" + "path": "stages/stage7_day117", + "note": "Steam_1_backup_1, 2026-11-26 22:02, day 117, church quality changed" + }, + { + "path": "stages/stage8_day117", + "note": "Steam_1, 2026-11-26 22:09, day 117, happiness changed" } ] } diff --git a/games/graveyard_keeper_2/test_reader.py b/games/graveyard_keeper_2/test_reader.py index 2efe005..e2c56d9 100644 --- a/games/graveyard_keeper_2/test_reader.py +++ b/games/graveyard_keeper_2/test_reader.py @@ -1,50 +1,54 @@ -"""Golden values read by hand from the seven .info sidecars (not copied from reader output).""" +"""Golden values read by hand from the eight stage folders (not copied from reader output).""" from pathlib import Path import unittest from reader import read HERE = Path(__file__).resolve().parent / "stages" -# (day, graveyardQuality, churchQuality) typed from each JSON file by eye. +# (day, graveyardQuality, churchQuality) typed from each JSON file by eye; happiness is the +# value the player read from the HUD thumbs-up counter at that point (0, 3, 0, 5, 10 of 20). GOLDEN = { - "stage1_day110.info": (110, 28, 36), - "stage2_day111.info": (111, 28, 36), - "stage3_day113.info": (113, 28, 36), - "stage4_day114.info": (114, 28, 36), - "stage5_day116.info": (116, 23, 36), - "stage6_day117.info": (117, 23, 36), - "stage7_day117.info": (117, 23, 29), + "stage1_day110": (110, 28, 36, 0), + "stage2_day111": (111, 28, 36, 3), + "stage3_day113": (113, 28, 36, 3), + "stage4_day114": (114, 28, 36, 0), + "stage5_day116": (116, 23, 36, 5), + "stage6_day117": (117, 23, 36, 5), + "stage7_day117": (117, 23, 29, 5), + "stage8_day117": (117, 23, 29, 10), } class ReaderTests(unittest.TestCase): def test_stage_values_and_facts(self): - for name, (day, graveyard, church) in GOLDEN.items(): + for name, (day, graveyard, church, happiness) in GOLDEN.items(): card = read(HERE / name) self.assertEqual(card["progress"]["day"], day, name) self.assertEqual(card["progress"]["graveyard_quality"], graveyard, name) self.assertEqual(card["progress"]["church_quality"], church, name) + self.assertEqual(card["progress"]["happiness"], happiness, name) self.assertEqual(card["facts"], [ {"id": "day", "icon": "day", "value": str(day)}, {"id": "graveyard_quality", "icon": "graveyard_quality", "value": str(graveyard)}, {"id": "church_quality", "icon": "church_quality", "value": str(church)}, + {"id": "happiness", "icon": "happiness", "value": str(happiness)}, ], name) - for field in ("day", "graveyard_quality", "church_quality"): + for field in ("day", "graveyard_quality", "church_quality", "happiness"): self.assertIn(field, card["proven"]) self.assertEqual(card["fact_sources"][field], field) def test_quality_fields_declare_nonmonotonic(self): - card = read(HERE / "stage7_day117.info") - for field in ("graveyard_quality", "church_quality"): + card = read(HERE / "stage8_day117") + for field in ("graveyard_quality", "church_quality", "happiness"): self.assertTrue(card["nonmonotonic"][field].strip()) self.assertNotIn("day", card["nonmonotonic"]) def test_saved_at_is_parsed_and_increases(self): - times = [read(HERE / n)["progress"]["saved_at"] for n in sorted(HERE.glob("stage*.info"))] + times = [read(HERE / n)["progress"]["saved_at"] for n in sorted(HERE.glob("stage*"))] self.assertTrue(all(isinstance(t, float) for t in times)) self.assertEqual(times, sorted(times)) def test_unverified_fields_stay_hidden(self): - card = read(HERE / "stage7_day117.info") + card = read(HERE / "stage8_day117") self.assertEqual(card["progress"]["village_rep"], 17) # HUD reputation moved 0 -> 10 while this stayed 17: not the HUD value self.assertEqual(card["progress"]["town_citizens"], 20) for field in ("village_rep", "town_citizens"): @@ -56,6 +60,17 @@ def test_directory_picks_newest_info(self): card = read(HERE) self.assertEqual(card["progress"]["day"], 117) self.assertEqual(card["progress"]["church_quality"], 29) + self.assertEqual(card["progress"]["happiness"], 10) + + def test_info_without_dat_hides_happiness(self): + import shutil, tempfile + with tempfile.TemporaryDirectory() as tmp: + shutil.copy(HERE / "stage8_day117" / "Steam_1.info", tmp) + card = read(tmp) + self.assertEqual(card["progress"]["day"], 117) + self.assertIsNone(card["progress"]["happiness"]) + self.assertIn("happiness", card["unproven"]) + self.assertEqual([f["id"] for f in card["facts"]], ["day", "graveyard_quality", "church_quality"]) def test_missing_input_displays_nothing(self): card = read(HERE / "does_not_exist.info") diff --git a/i18n/en.json b/i18n/en.json index 7609864..0d93ae0 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -3,7 +3,8 @@ "graveyard_keeper_2": { "day": "Day", "graveyard_quality": "Graveyard Quality", - "church_quality": "Church Quality" + "church_quality": "Church Quality", + "happiness": "Happiness" } } } From f314fa57fa6769f181dae14353d77b54318fcc1f Mon Sep 17 00:00:00 2001 From: Ole <4692497+Guacam-Ole@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:18:44 +0100 Subject: [PATCH 5/5] games: Graveyard Keeper 2 labels: Graveyard / Church instead of the panel titles Co-Authored-By: Claude Fable 5.1 --- games/graveyard_keeper_2/README.md | 4 ++-- games/graveyard_keeper_2/proof.md | 3 ++- i18n/en.json | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/games/graveyard_keeper_2/README.md b/games/graveyard_keeper_2/README.md index 439a105..21a1eab 100644 --- a/games/graveyard_keeper_2/README.md +++ b/games/graveyard_keeper_2/README.md @@ -15,8 +15,8 @@ both files, so a Deck shows the same card as the PC. ## What the card shows - `day` — in-game day (fact id `day`, label `facts.graveyard_keeper_2.day`). -- `graveyard_quality` — the game's "Graveyard Quality" value (declared non-monotonic: it can fall). -- `church_quality` — the game's "Church Quality" value (declared non-monotonic). +- `graveyard_quality` — the game's "Graveyard Quality" value, labelled "Graveyard" (declared non-monotonic: it can fall). +- `church_quality` — the game's "Church Quality" value, labelled "Church" (declared non-monotonic). - `happiness` — the town happiness shown with the thumbs-up icon in the HUD (declared non-monotonic: it is spent). Only the current value is shown; the HUD's `/20` cap is not stored in the save, so it is not displayed. - `observed_at` — the save timestamp from `saveDateTime`. diff --git a/games/graveyard_keeper_2/proof.md b/games/graveyard_keeper_2/proof.md index a48ea6a..dc04a63 100644 --- a/games/graveyard_keeper_2/proof.md +++ b/games/graveyard_keeper_2/proof.md @@ -28,7 +28,8 @@ The HUD shows happiness as `x/20`. No variable in the `.dat` carries that cap (n `townCitizens` happens to be 20 but is not proven to be the denominator), so the card shows only the current value. Label strings in the game's `resources.assets`: `Graveyard Quality`, `Church Quality` (EN), `Качество кладбища`, -`Качество церкви` (RU), `Friedhofsqualität`, `Kirchenqualität` (DE). Happiness has no text label in the HUD (icon only); +`Качество церкви` (RU), `Friedhofsqualität`, `Kirchenqualität` (DE); the card uses the shorter nouns `Graveyard` / `Church` +(`Кладбище` / `Церковь`), which are game strings too. Happiness has no text label in the HUD (icon only); its identifier in the game data is `happiness` / `town_happiness`, so the fact label is the plain word "Happiness". Stages are the game's rolling backups of one slot (`_backup_3` oldest → `Steam_1` newest), copied into the ignored diff --git a/i18n/en.json b/i18n/en.json index 0d93ae0..b596bca 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,8 +2,8 @@ "facts": { "graveyard_keeper_2": { "day": "Day", - "graveyard_quality": "Graveyard Quality", - "church_quality": "Church Quality", + "graveyard_quality": "Graveyard", + "church_quality": "Church", "happiness": "Happiness" } }