hedge-dev / HMMCodes

Hedge Mod Manager community codes repository
18 stars 19 forks source link

[Sonic Frontiers] Disable FPS Limit code not working #164

Closed OmuNaki closed 1 month ago

OmuNaki commented 1 month ago

As title says, the code is activated but in-game and with both RivaTuner and Steam's overlay the game is still locked at 60fps. Before Update 2 I remember it working properly but ever since that update it hasn't worked.

hyperbx commented 1 month ago

Does your display support higher than 60Hz?

OmuNaki commented 1 month ago

Yes, it's a 240hz monitor.

hyperbx commented 1 month ago

Enable the Show Frame Rate on Title Bar code under the System category and see what that reports, it should be a metric provided during every frame.

OmuNaki commented 1 month ago

Screenshot_6

No mods, only the Disable FPS Limit and Show Framerate codes on

hyperbx commented 1 month ago

Does the frame rate increase if you disable V-Sync in the game settings?

OmuNaki commented 1 month ago

No, it stays the same wether on or off.

hyperbx commented 1 month ago

Create a file in your mods directory called ExtraCodes.hmm and paste the following into there;

Code "Verify Disable FPS Limit"
//
    #lib "GameMode"
    #lib "Memory"

    static bool _isPrinted = false;
//
{
    if (GameMode.GetName() != "GameModeTitle")
        return;

    if (_isPrinted)
        return;

    Console.WriteLine();
    Memory.PrintMemory((nint)0x140D64D50, 2);
    Console.WriteLine();
    Memory.PrintMemory((nint)0x140D64E21, 2);
    Console.WriteLine();
    Memory.PrintMemory((nint)0x140146A1C, 2);
    Console.WriteLine();
    Memory.PrintMemory((nint)0x1410EC6CE, 2);
    Console.WriteLine();

    _isPrinted = true;
}

In Hedge Mod Manager, go to the Codes tab and hit F5 to refresh, then enable this code under the Uncategorised category. Then go to the Settings tab and click Enable debug console.

Launch the game and once you get to the main menu, it should write some hex values to the console, please send a screenshot of the output so I can verify whether the Disable FPS Limit code actually installed.

OmuNaki commented 1 month ago

image This is what it shows.

hyperbx commented 1 month ago

Looks like you have some overlay software installed that's trying to hook the graphics device.

Add the following to your ExtraCodes.hmm and press F5 at the Codes tab in Hedge Mod Manager to refresh, then enable it under the Uncategorised category.

Patch "Crash"
*(int*)0 = 0;

This will cause the game to crash on boot so we can generate a crash dump. Hold the Windows key and press R and enter %APPDATA% and hit enter, then navigate to .\SEGA\SonicFrontiers\steam\crashpad_db\reports\ and send the latest *.dmp file in that directory. I'll be able to determine from there what application is doing this, in case that is the culprit.

OmuNaki commented 1 month ago

I booted up the game and it crashed but it didn't create a new *.dmp file, the latest one there is from July 25th this year.

hyperbx commented 1 month ago

Try checking %LOCALAPPDATA%\CrashDumps\ in case it got put in there instead.

OmuNaki commented 1 month ago

SonicFrontiers.exe.23884.dmp There it was.

hyperbx commented 1 month ago

I don't see anything out of the ordinary in here, perhaps it's crashing too early. Try this;

Code "Crash"
//
    #lib "GameMode"
//
{
    if (GameMode.GetName() != "GameModeTitle")
        return;

    *(int*)0 = 0;
}
OmuNaki commented 1 month ago

40f42b6f-e6ac-4db2-bcdd-c2b0d7de2f6b.dmp Here.

hyperbx commented 1 month ago

Do you happen to use any of the following programs?

products using goverlay

The messages printed to the debug console come from a library called goverlay which injects an overlay into the game.

OmuNaki commented 1 month ago

I downloaded Medal recently, but I closed it during the tests we've been doing, and the problem has been going on since before downloading it. I have Guilded installed too but it's always closed.

hyperbx commented 1 month ago

but I closed it during the tests we've been doing

That'd explain why I didn't see anything in the crash dumps. lol

So the code I sent all the way back at the beginning, are you able to see the output from that in the debug console now that it's not being spammed with goverlay messages?

hyperbx commented 1 month ago

It should output something like this.

image

OmuNaki commented 1 month ago

image It showed properly now lol

EDIT: just due to curiousity I went into the game after taking this screenshot, game is still locked at 60fps.

hyperbx commented 1 month ago

Looks like the Disable FPS Limit code is being installed properly.

This seems like it could be a software issue outside of the game itself, you may want to double-check your display settings and check out NVIDIA Control Panel to see if it's applying any limit to the game.

OmuNaki commented 1 month ago

Huh, I didn't even know Framerate could be limited with NVIDIA Control Panel, if I had known I would've checked there first.

image

Thank you so much and sorry for taking up your time with what ended up being such a simple thing!

hyperbx commented 1 month ago

Haha nice, glad you got it sorted. No worries!