Skip to content

Humongous entertainment/ scumm vm gamefix#1204

Open
Pepelespooder wants to merge 12 commits intoutkarshdalal:masterfrom
Pepelespooder:Humongous-Entertainment/-ScummVM-Gamefix
Open

Humongous entertainment/ scumm vm gamefix#1204
Pepelespooder wants to merge 12 commits intoutkarshdalal:masterfrom
Pepelespooder:Humongous-Entertainment/-ScummVM-Gamefix

Conversation

@Pepelespooder
Copy link
Copy Markdown

@Pepelespooder Pepelespooder commented Apr 13, 2026

Description

Added a ScummGameFix And used inifilefix. Scummgames like freddi fish and others from the humungous series don't run on Game native unless you point it towards the inifile and than the Game Folder. Also disabled the updater in the Inifile so the user cant soft lock them self by trying to update the scummvm install as it black screens. I have tested a couple others but haven't been able to get them to work why this is only applying to the Humongous series as I've tested all those. The only thing I cant do is set the games as legacy DRM which passes the executable variables properly. Will have to set that as a config option.

Opened as Draft PR as im still testing and refining

Recording

https://drive.google.com/file/d/1t1v4xyZHfbYZHQzQu6cIiTpFSPiLOrvI/view?usp=sharing

Checklist

  • [✅] If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • [✅] I have attached a recording of the change.
  • [✅] I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Add a ScummVM game fix for Humongous Entertainment Steam releases. Games now launch via the bundled ScummVM with the right INI, and updates are disabled to avoid black-screen softlocks.

  • New Features
    • ScummGameFix: detects scummvm.exe, reads the local .ini, selects the right game section, sets updates_check=0 via IniFileFix, and rewrites launch args with LaunchArgFix (-c "" ).
    • KeyedCompositeGameFix: new helper to run multiple fixes in order; used by ScummGameFix.
    • Registers fixes for many Steam app IDs (Putt-Putt, Freddi Fish, Pajama Sam, Spy Fox, Junior Field Trips, Big Thinkers).
    • Robust handling for missing files and clear logs via Timber.
    • Unit tests for ScummGameFix and KeyedCompositeGameFix.

Written for commit 877da62. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added compatibility fixes for 30+ additional Steam games, including classic adventure and educational titles
    • Implemented fix composition system for flexible game patching
    • Enhanced ScummVM support with automatic configuration detection and patching
  • Tests

    • Added test coverage for new fix composition and ScummVM functionality

Pepelespooder and others added 7 commits April 8, 2026 15:06
Introduce ScummGameFix implementation to detect bundled ScummVM executables and local .ini files, disable update checks, determine the correct game section, and rewrite the container launch command to start the game via ScummVM. Add numerous STEAM_* KeyedGameFix entries for various classic SCUMM titles and update GameFixesRegistry to register them. The ScummGameFix logs actions via Timber and safely handles missing files or parsing errors.
Forgot to remove these in the original commit sorry
Introduce IniFileFix (and KeyedIniFileFix) to centrally update or add key=value entries in INI files (UTF-8), support an optional migrationKey flag, log outcomes and mark container extras. Refactor ScummGameFix to use IniFileFix to disable updates_check and to use LaunchArgFix for launch arguments instead of manual file edits; remove the old disableUpdatesCheckInIni helper. Update GameFixesRegistry by reordering and adding multiple STEAM_Fix entries (new IDs added and some moved) to keep the registry in sync with available fixes.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

This PR introduces ScummVM game fix infrastructure by adding 33 new Steam game fix constants for ScummVM-based games, implementing ScummGameFix for automatic ScummVM configuration detection and application, introducing CompositeGameFix for combining multiple fixes, and registering all fixes in GameFixesRegistry with comprehensive test coverage.

Changes

Cohort / File(s) Summary
GameFixesRegistry Update
app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt
Updated fixes map to register 33 new Steam game fix entries for various ScummVM-based games.
Steam Game Fix Constants
app/src/main/java/app/gamenative/gamefixes/STEAM_2839*.kt, STEAM_2922*.kt, STEAM_2925*.kt, STEAM_2946*.kt, STEAM_317*.kt, STEAM_363*.kt, STEAM_3767*.kt
Added 33 new KeyedGameFix constants for ScummVM games (Putt-Putt series, Pajama Sam series, Freddi Fish series, Spy Fox series, and others), each using ScummGameFix initialization with corresponding Steam app IDs.
Game Fix Type Implementations
app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt, KeyedCompositeGameFix.kt
Introduced ScummGameFix which detects ScummVM executable, parses .ini configuration, disables update checks, and applies launch arguments; introduced CompositeGameFix and KeyedCompositeGameFix for composing multiple game fixes with sequential execution.
Test Suite
app/src/test/java/app/gamenative/gamefixes/types/ScummGameFixTest.kt, KeyedCompositeGameFixTest.kt
Added comprehensive Robolectric-based tests validating ScummGameFix behavior (executable/ini detection, launch arg configuration, ini file updates) and KeyedCompositeGameFix behavior (fix execution order, partial failure handling, property retention).

Sequence Diagram(s)

sequenceDiagram
    participant Client as GameFix Applier
    participant ScummFix as ScummGameFix
    participant FileSystem as File System
    participant IniParser as INI Parser
    participant IniHandler as IniFileFix
    participant LaunchHandler as LaunchArgFix
    participant Container as Container

    Client->>ScummFix: apply(context, gameId, installPath, ...)
    ScummFix->>FileSystem: locate scummvm.exe
    alt Executable not found
        ScummFix-->>Client: return false
    else Executable found
        ScummFix->>FileSystem: search for scummvm.ini
        alt INI not found
            ScummFix-->>Client: return false
        else INI found
            ScummFix->>IniParser: parse scummvm.ini
            IniParser-->>ScummFix: detected gameId
            ScummFix->>IniHandler: apply IniFileFix (disable updates_check)
            IniHandler->>FileSystem: write updated ini
            ScummFix->>LaunchHandler: apply LaunchArgFix
            LaunchHandler->>Container: set execArgs with ini path + gameId
            ScummFix-->>Client: return true
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • unbelievableflavour
  • utkarshdalal
  • phobos665

Poem

🐰 A warren of games now finds their way,
ScummVM scripts dance at last,
With Putt-Putts, Pajama Sams in play,
Freddi Fish swims fast,
Thirty-three steam dreams—hip, hip, hooray! 🎮✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and uses unclear abbreviations without conveying the main purpose or scope of the changeset. Clarify the title to be more specific about the change, e.g., 'Add ScummVM game fix for Humongous Entertainment Steam games' or 'Support ScummVM-based Humongous Entertainment games'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is comprehensive and covers the main changes, goals, and testing status, though some required template sections differ from the standard.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Pepelespooder
Copy link
Copy Markdown
Author

Pepelespooder commented Apr 13, 2026

Only thing is I dont know if im still over reaching a bit with the Gamefix. I was thinking of just submitting each config individually but than it wouldnt have the softlock fix. Because if update gets set to anything but never it completely breaks game launch on second launch

@Pepelespooder
Copy link
Copy Markdown
Author

Im gonna mark this as ready for review. As UnbelievableFlavour has looked it over and helped me fix it up a bit

@Pepelespooder Pepelespooder marked this pull request as ready for review April 14, 2026 12:30
Copy link
Copy Markdown
Contributor

@unbelievableflavour unbelievableflavour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR, lots of nice game fixes + 2 new gamefix types we will surely be using in future PRs as well.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 38 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt">

<violation number="1" location="app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt:31">
P2: Duplicate fix registrations are silently overwritten when building the map with `associateBy`, leaving dead entries and increasing misconfiguration risk.</violation>
</file>

<file name="app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt">

<violation number="1" location="app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt:51">
P2: ScummGameFix discards CompositeGameFix failure and always returns success, masking sub-fix failures.</violation>

<violation number="2" location="app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt:113">
P2: ScummVM INI selection is order-dependent and may choose an unrelated `.ini`, leading to wrong config mutation or launch failure.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

GOG_Fix_2147483047,
GOG_Fix_1787707874,
GOG_Fix_1635627436,
STEAM_Fix_400,
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Duplicate fix registrations are silently overwritten when building the map with associateBy, leaving dead entries and increasing misconfiguration risk.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt, line 31:

<comment>Duplicate fix registrations are silently overwritten when building the map with `associateBy`, leaving dead entries and increasing misconfiguration risk.</comment>

<file context>
@@ -28,14 +28,49 @@ object GameFixesRegistry {
         GOG_Fix_2147483047,
         GOG_Fix_1787707874,
         GOG_Fix_1635627436,
+        STEAM_Fix_400,
+        STEAM_Fix_1637320,
         STEAM_Fix_22300,
</file context>
Fix with Cubic


private fun findScummVmIni(installPath: String, exeDir: File): File? {
val candidates = listOfNotNull(
exeDir.listFiles()?.firstOrNull { it.extension.lowercase() == "ini" },
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: ScummVM INI selection is order-dependent and may choose an unrelated .ini, leading to wrong config mutation or launch failure.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt, line 113:

<comment>ScummVM INI selection is order-dependent and may choose an unrelated `.ini`, leading to wrong config mutation or launch failure.</comment>

<file context>
@@ -0,0 +1,131 @@
+
+    private fun findScummVmIni(installPath: String, exeDir: File): File? {
+        val candidates = listOfNotNull(
+            exeDir.listFiles()?.firstOrNull { it.extension.lowercase() == "ini" },
+            File(installPath).listFiles()?.firstOrNull { it.extension.lowercase() == "ini" },
+        )
</file context>
Fix with Cubic

),
LaunchArgFix("-c \"$windowsIniPath\" $detectedGameId"),
),
).apply(context, gameId, installPath, installPathWindows, container)
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: ScummGameFix discards CompositeGameFix failure and always returns success, masking sub-fix failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt, line 51:

<comment>ScummGameFix discards CompositeGameFix failure and always returns success, masking sub-fix failures.</comment>

<file context>
@@ -0,0 +1,131 @@
+                    ),
+                    LaunchArgFix("-c \"$windowsIniPath\" $detectedGameId"),
+                ),
+            ).apply(context, gameId, installPath, installPathWindows, container)
+
+            Timber.tag("GameFixes").i("Detected and using local ScummVM config: $windowsIniPath (Game ID: $detectedGameId)")
</file context>
Fix with Cubic

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt (1)

106-108: Log the parse exception instead of swallowing it.

If reading the INI fails, this collapses I/O or encoding problems into the same "could not detect Game ID" path. Keeping the exception in the log will make bad installs much easier to diagnose.

🪵 Suggested logging tweak
         } catch (e: Exception) {
+            Timber.tag("GameFixes").w(e, "Failed to parse ScummVM ini: ${iniFile.absolutePath}")
             null
         }
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt` around
lines 106 - 108, The catch block in ScummGameFix.kt currently swallows
exceptions ("catch (e: Exception) { null }"); change it to log the exception
before returning null—use the project's logging facility (e.g., the existing
logger instance or Android Log.e/Timber) to record e and a short contextual
message like "Failed to parse INI while detecting Game ID" so I/O/encoding
errors are visible while preserving the null return path.
app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt (1)

31-73: Remove the duplicate registrations for STEAM_Fix_400 and STEAM_Fix_22330.

Both keys already appear later in this same list, and associateBy keeps only the last entry. These extra registrations are dead data today and can hide an intended KeyedCompositeGameFix if a second fix was meant to stack on the same game key.

🧹 Suggested cleanup
-        STEAM_Fix_400,
         STEAM_Fix_1637320,
         STEAM_Fix_22300,
-        STEAM_Fix_22330,
         STEAM_Fix_22380,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt` around lines
31 - 73, In GameFixesRegistry (the list of registered fixes), remove the
duplicate enum entries STEAM_Fix_400 and STEAM_Fix_22330 so each key appears
only once; locate the repeated occurrences in the collection being built (used
later with associateBy) and delete the earlier duplicates so the intended final
mapping and any potential KeyedCompositeGameFix stacking are preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/app/gamenative/gamefixes/STEAM_292240.kt`:
- Around line 5-7: Update the KDoc header in STEAM_292240.kt so the documented
game title matches the actual app ID 292240; locate the top KDoc block (the /**
... */ comment) in the STEAM_292240.kt file and replace the incorrect Spy Fox
title with the correct title for app ID 292240, ensuring the comment accurately
reflects the game's name used elsewhere in mapping/lookup code.

In `@app/src/main/java/app/gamenative/gamefixes/STEAM_292780.kt`:
- Around line 5-7: Update the KDoc title in the top-of-file comment in
STEAM_292780.kt to the correct game name for app ID 292780: replace "Pajama Sam
3: You Are What You Eat From Your Head to Your Feet (Steam)" with the proper
title for Pajama Sam 2 so the file comment accurately reflects app ID 292780;
locate the KDoc block at the top of STEAM_292780.kt and edit the title line
accordingly.

In `@app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt`:
- Around line 111-116: In findScummVmIni, don't pick the first .ini arbitrarily;
explicitly look for a file named "scummvm.ini" in exeDir and in installPath (use
exeDir.resolve("scummvm.ini")/File(installPath,"scummvm.ini") or filter by name
equalsIgnoreCase), returning the first match, and only if neither exists fall
back to the current listFiles().firstOrNull logic; update the function to prefer
case-insensitive exact "scummvm.ini" checks before the generic candidate list.

---

Nitpick comments:
In `@app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt`:
- Around line 31-73: In GameFixesRegistry (the list of registered fixes), remove
the duplicate enum entries STEAM_Fix_400 and STEAM_Fix_22330 so each key appears
only once; locate the repeated occurrences in the collection being built (used
later with associateBy) and delete the earlier duplicates so the intended final
mapping and any potential KeyedCompositeGameFix stacking are preserved.

In `@app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt`:
- Around line 106-108: The catch block in ScummGameFix.kt currently swallows
exceptions ("catch (e: Exception) { null }"); change it to log the exception
before returning null—use the project's logging facility (e.g., the existing
logger instance or Android Log.e/Timber) to record e and a short contextual
message like "Failed to parse INI while detecting Game ID" so I/O/encoding
errors are visible while preserving the null return path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e9d4c30-dadf-446d-bb1b-9a3c2ced4548

📥 Commits

Reviewing files that changed from the base of the PR and between 22cf4c5 and 877da62.

📒 Files selected for processing (38)
  • app/src/main/java/app/gamenative/gamefixes/GameFixesRegistry.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283900.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283910.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283920.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283930.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283940.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283960.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_283980.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292240.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292260.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292280.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292770.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292780.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292800.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292820.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_292840.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294530.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294540.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294550.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294560.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294660.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294670.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294680.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294690.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294700.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294710.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_294720.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_317020.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_317030.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_363050.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_363060.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_363070.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_376760.kt
  • app/src/main/java/app/gamenative/gamefixes/STEAM_376770.kt
  • app/src/main/java/app/gamenative/gamefixes/types/KeyedCompositeGameFix.kt
  • app/src/main/java/app/gamenative/gamefixes/types/ScummGameFix.kt
  • app/src/test/java/app/gamenative/gamefixes/types/KeyedCompositeGameFixTest.kt
  • app/src/test/java/app/gamenative/gamefixes/types/ScummGameFixTest.kt

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