hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.05k stars 2.15k forks source link

mhf1 timing issue #12737

Open tilkinsc opened 4 years ago

tilkinsc commented 4 years ago

What happens?

Multiple chains of buttons are being ignored by the game. For instance, 3 lance strikes in a rapid succession, as to strike as fast as possible. Sometimes the button presses get ignored, especially if there is stuff going on in game. For instance, the monster being hunted is casting a fireball or doing an attack animation. The uniqueness of fireball having fog appears to be interrelated.

What should happen?

A rapid succession of 3 strikes where they can be frame perfect. Timing is crucial in beating up monsters and dodging attacks.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

This is on Windows 10, gtx 1080 sc, with a ryzen 9 3900x. I am running the ppsspp version 1.9.3 I recently downloaded from the site within days of this post. I am using a black corded xbox 360 controller.


I ended figuring this was a timing issue due to talking about how it feels to smash a button when the receding animation is playing (which is where you can strike again, up to 3 times with the lance). I also thought it was my controller, but it seemed to work 100% fine in freedom unite and later monster hunter games.

So I went down to the settings to see what I can do.

First thing first, fast memory has always been a demon when it comes to monster hunter games, so I turned that off initially. I haven't tested a hunt with it on, which could be the source of this. It helps fix other issues, however. Other users were having the same issue with other weapons, but I only have data from my own tests. Everyone rocks that Fast Memory disabled.

I did indeed find a solution using the settings. image

I forced real clock sync. I also noticed a pretty nice acceleration to the game with setting the i/o timing to host. I would assume my ram and ssd aren't a bottle neck in anything i/o related, especially since I have the 'cache full ISO in RAM' enabled.

Some questions I have:

  1. with the Change emulated PSP's CPU clock, if I set it to 222mhz will there be any side effects for games that only run in 222mhz mode?
  2. does the software set up 333mhz mode or does ppsspp assume its preferred mode is 333mhz and swap to it?
  3. how would monster hunter's input and animation timing be faultered by these two settings? I have no explanation for why you can sit there and mash a button but no action happens.
LunaMoo commented 4 years ago

You assumed a "timing issue" based on later games of a series allowing something? You know that it's common for games to improve controls with each iteration?

As for your settings:

unknownbrackets commented 4 years ago

PPSSPP, like a PSP, starts all games at 222 Mhz. Games can request other speeds, either to save battery power or to run hot, but if they never do that it'll stick at 222 Mhz. It should make no difference. If a game does request another speed, anything but Auto may cause bugs.

Setting IO timing to Host with cache full ISO should in theory, be equivalent to Fast...

Force real clock sync is probably making the difference here, I suppose. The way PPSSPP works (and also the way most games work) is by frame. Here's a visual:

0.00s       0.0167s     0.0333s     0.050s        ...
+=====------+=====------+=====------+=====------+ ...

The above represents 60 FPS. At the start of each frame, PPSSPP runs the game code, renders things, checks inputs, etc. That's the = part. Once it's done everything it needs to do, it waits until the next frame. This is exactly how most PSP games, and even PC games, work internally.

HOWEVER, there's one big difference. Let's say the game is 30 FPS (this one most likely is.) Things just spread out:

0.00s       0.0167s     0.0333s     0.050s        ...
+============-----------+============-----------+ ...

This is why a game would even be 30 FPS, because it can't get everything done within the 1/60th of a second "budget" (at least, not consistently.)

But PSP games usually (they can change this, but most don't) update controller input 60 times a second, even if they are 30 FPS games. When we go into 30 FPS mode, we essentially only check 30 times a second, because emulation is paused during the blank --- part above.

And on powerful desktop hardware like yours, a 30 FPS game probably looks like this:

0.00s       0.0167s     0.0333s     0.050s        ...
+=----------------------+=----------------------+ ...

What "Force real clock sync" does is that it spreads out that "=" to try to make it take as long as it did on a real PSP. It's not perfect, but the goal is for netplay and controller things to run between frames. On mobile devices and laptops, this setting likely eats more battery power.

Latest git builds have a new setting to render duplicate frames to force 60 FPS, even if the game is 30 FPS. It would be interesting if turning that on, and real clock sync off, still helps.

-[Unknown]

Panderner commented 4 years ago

PPSSPP, like a PSP, starts all games at 222 Mhz.

God of War Games and Gran Turismo uses 333 MHz, Ratchet and Clank uses 266 MHz. Gran Turismo runs at 60 fps by using 333 Mhz but when I underclock the CPU to 222 MHz the game caps to 30 fps and saves battery life on a Real PSP.

tilkinsc commented 4 years ago

The PSP didn't have an unlocked processor until the 2000 series.

Thanks, @unknownbrackets . Very informative. I can understand why there would be such delay. I would be curious to know this as well. Stay tuned.

unknownbrackets commented 4 years ago

Thanks. I think that games written for firmware versions below 3.50 were locked at 222 Mhz and they allowed games to start requesting higher frequencies as of 3.50 - even on the PSP-1000. But I actually never had a PSP-1000, so maybe I'm wrong...

-[Unknown]

hrydgard commented 4 years ago

No, a PSP-1000 can also be clocked at 333Mhz, no problem. They indeed didn't allow it in the first firmware versions.

unknownbrackets commented 2 years ago

Have there been any findings with that setting?

-[Unknown]

tilkinsc commented 2 years ago

Its been two years and I monster huntered it up. I will leave myself a note to confirm the issue, I could of just been retarded and not understood input buffering.

AmyRoxwell commented 7 months ago

Checking this issue, its actually a thing with the game itself and happens on real console (Also seems nobody bother to check on real hardware cuz the moment you try it, it's very noticeble), The version doesn't matter either. The only way to fix it is by using a cwcode that changes one function on the input system, credits to GReinoso96 on github for making the cheats:

Monster Hunter Freedom (EUR) ULES00318:

_C1 Input Drop Fix
_L 0xD10DCFB6 0x00001460
_L 0x110DCFB6 0x00001060

Monster Hunter Freedom (USA) ULUS10084:

_C1 Input Drop Fix [USA]
_L 0xD10DC1BE 0x00001460
_L 0x110DC1BE 0x00001060

Monster Hunter Freedom (JPN) ULJM05066

_C1 Input Drop Fix [JPN]
_L 0xD10DB8CE 0x00001460
_L 0x110DB8CE 0x00001060

Now, i would like to provide a video about it being a thing on real hardware soon but my psp is a bit busted down, so it may take a while, once again, I can confirm this happens on real hardware. (You can try it yourself on original hardware and it should be super obvious when you enter any hunt with the SNS, the weapon you have by default.)

hrydgard commented 7 months ago

Interesting.

Maybe we should have a mechanism to optionally auto-apply game bugfixes like that, or at least include such bugfix cheats directly with the emulator, just like we already do some fixes with compat.ini hacks (or these could just be another compat.ini setting...).

AmyRoxwell commented 7 months ago

Interesting.

Maybe we should have a mechanism to optionally auto-apply game bugfixes like that, or at least include such bugfix cheats directly with the emulator, just like we already do some fixes with compat.ini hacks (or these could just be another compat.ini setting...).

If you could include those codes on the compat.ini so they auto-load that would be great, a lot of Monster Hunter Fans don't recommend this game due to having this big issue, the input dropping on freedom is absolutely terrible. Now, I had test those cheats for a long time and they haven't cause any issues while playing offline and online.