From b5c1e4fc032335d49a16afd554ea295ab9c5f771 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 4 Oct 2026 23:47:21 +0200 Subject: [PATCH] fix: count engine and publisher trees as game data --- scripts/common.py | 25 ++++++++++++++++++++++--- scripts/generate_site.py | 3 ++- tests/test_audit_regressions.py | 16 ++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/scripts/common.py b/scripts/common.py index f290d0f4..6d6b1a95 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -1002,7 +1002,26 @@ def unique_emulator_profiles(profiles: dict[str, dict]) -> dict[str, dict]: } -GAME_DATA_TOPS = ("RPG Maker", "ScummVM") +# Trees that hold game and engine data rather than the system files of a +# machine: the engine trees, and the publishers whose games an engine runs. +GAME_DATA_TOPS = ( + "RPG Maker", + "ScummVM", + "Game Engines", + "sdlpal", + "Dinothawr", + "3D Realms", + "Apogee", + "Blizzard", + "Crack dot Com", + "Electronic Arts", + "Epic MegaGames", + "Id Software", + "Interplay", + "Monolith", + "Softdisk", + "Valve", +) def composition_tier(path: str) -> str: @@ -1020,8 +1039,8 @@ def compute_composition(db: dict) -> dict: """File and byte counts by tree area. Three buckets, each re-derivable from paths alone: arcade ROM sets - (Arcade/), game and engine data (the RPG Maker/ and ScummVM/ trees), - and console or computer system files (everything else). + (Arcade/), game and engine data (the trees of GAME_DATA_TOPS), and + console or computer system files (everything else). """ buckets = { "systems": {"files": 0, "size_bytes": 0}, diff --git a/scripts/generate_site.py b/scripts/generate_site.py index fcda2dd4..39e2b2f4 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -428,7 +428,8 @@ def composition_sentence(db: dict) -> str: f"The collection holds {comp['systems']['files']:,} console and " f"computer system files, {comp['arcade']['files']:,} arcade ROM sets " f"(`Arcade/`), and {comp['game_data']['files']:,} game and engine " - "data files (the `RPG Maker/` and `ScummVM/` trees). No pack holds " + "data files (`Game Engines/`, `RPG Maker/`, `ScummVM/` and the game " + "publishers' trees). No pack holds " "them all: each carries what its platform's emulators load." ) diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index bfd454df..b448945b 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -388,6 +388,22 @@ class CatalogRatioRegressions(unittest.TestCase): self.assertEqual(count_catalog_matched(db), 1) self.assertEqual(compute_composition(db)["systems"]["files"], 2) + def test_engine_and_publisher_trees_are_game_data(self): + """Engine data collected under `Game Engines/` and under a game + publisher counted as console and computer system files: 7 697 of + them made the README announce 13 564 system files.""" + from scripts.common import composition_tier + + for path in ( + "bios/Game Engines/C-Dogs SDL/cdogs/data/guns.json", + "bios/Id Software/Quake III Arena/baseq3/pak1.pk3", + "bios/Epic MegaGames/Jazz Jackrabbit 2/jazz2/Source/share.j2e", + "bios/RPG Maker/easyrpg/rtp/2000/Backdrop/Bridge.png", + ): + self.assertEqual(composition_tier(path), "game_data", path) + self.assertEqual(composition_tier("bios/Sony/PlayStation/scph5501.bin"), "systems") + self.assertEqual(composition_tier("bios/Microsoft/MSX/MSX2.ROM"), "systems") + def test_readme_ratio_matches_the_database(self): from scripts.common import compute_composition, count_catalog_matched, load_database