-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to limit framerate to a specific number ? #14315
Comments
Closest thing might be auto frameskip, but it's not great. It's a valid idea to automatically switch the frameskip when the detected framerate changed, to achieve a target framerate. I'll keep this open as a feature request. |
Don't we already have that feature to skip frames at 60 while keeping 30 unskipped? At least that's what I understand was the point of that other frameskip type. Not at home and don't remember it's name, but pretty sure it was made exactly for that. |
I don't think that's what it does, but I never quite understood it heh :P |
|
You'd probably better to patch the game to run at constant fps. It would become lighter as well(assuming down patching to 30). Anyway I ment this: #11523 |
I was actually just coming to post about this, so I'm glad others have brought it up. I've tried adjusting the cpu clock and using frame skip, but those didn't work (frame skipping was actually bad since when the game changes the fps cap from 60 to 30 you go below 30). My issue with this is that in Final Fantasy Tactics: War of the Lions the max fps value keep changes wildly based on what is happening (such as dialogue moments interspersed throughout combat). Me and a few others on discord think that some way to lock fps to a given max would be a nice feature. Someone on discord report it happening in Dirt 2, as well (i think when played on android). The reason frame skipping doesn't work is that it "skips" rendering a given amount of frames. For example: if a game runs at 60 fps and frame skip is set to "skip every 1 frame" it will only render every other frame (e.g. Frame>Skip>Frame>Skip>etc.) bringing 60fps down to 30 since only half of the frames are being rendered. If a game dipped to 30 while having frame skipping set to 1 it would result in 15 fps out of a possible 30 (if 30 was the frame cap). Having games with variable frame caps makes frame skipping an impractical fix. What causes the variable frame caps is probably the better way to understand the issue and hopefully get a fix put into development (be it a patch to code or a new feature like an adjustable frame cap or toggle for frame cap at a given interval). I made a short video to help highlight the variable fps found in game. It seems to be what others have been experiencing across a variety of games. Perhaps it'll help in some way. Video for demonstration purpose - https://www.youtube.com/watch?v=ZexnZzUsk-A |
Games are coded to have variable FPS, that's not a bug. You'd have to patch the game code to change it, it's nothing on the emu side althrough sometimes overclocking emulated PSP CPU can give a stable 60, but it still depends on the game, also even when that would work, it would make the game even harder to run on potato hardware. |
Btw, how does games usually change the FPS? using a certain syscall? (which syscall?), or changing the CPU clock? |
I don't think there's an "usual" way. There's like one game which literally checks the number of NPC's on the screen and reduces FPS based on that down to some single digit value even if it easily runs at PSP with default 222mhz clocks with this patched... potentially there's no two games doing this the same way unless using same engine/programmed by same people. |
We could allow a target FPS to be entered, such as even 45. And only frameskip above it. That's technically feasible, though a little complicated. FPS is actually detected. Technically speaking, the PSP has a fixed 59.94 FPS at all times. However:
But technically speaking, one could say that all PSP games are technically 59.94 FPS. They technically provide the display controller with a frame and the hardware does an update of the LCD at that interval. PPSSPP will however show 20/60 if the game is only drawing or updating the framebuffer 20 times per second. This is what people want/expect from an FPS limit. Inherently, this is why it's complex to limit the frameskip to an arbitrary amount. The process is like this:
-[Unknown] |
Wow! |
Force max fps was causing insanely long load times or even completely breaking some games, set under 60 to ie force the 60 fps game to run at 30 fps was also reducing the game's speed similar way to using alternate speed set to 50%. The option was removed together with other game breaking hacks to stop users from causing problems to themselves and then reporting those problems as emulation issues, especially since mobile users tend to abuse such hacks even for games that could only suffer from potential problems with no actual advantages, resulting in making their own experience worse. The only proper way to force the game into actually running at lower fps it was designed for with no disadvantages is to re-program that game itself(not always easy, but usually much easier than increasing FPS). In fact even in the very extreme case of GOW games, you're better to use fan made patches than depend on this particular PPSSPP hack that's applied automatically for it nowadays, it will make the game run smoother and easier to emulate at the same time. |
@LunaMoo wel Force60fps sounds more appealing according to users feedback in #11843
@unknownbrackets I believe #2542 is your work right ? Can it be implemented in current builds, also how was your experience with your hack ? |
The thing is this hack abused as by that user pretty sure still resulted in correct sound speed even when actual physics speed ends up half of what it should be. At least that's my experience when I tried it years ago. Dangerous speedhacks might feel worth using for some users, but will ruin the experience for many other users especially when you look at how many users are firstly getting their "best settings" from some youtube video, then coming for support to our forums trying to figure out why game X doesn't work, or runs without graphics. It's just not that easy to justify helping small percentage of people, if it has known tendency to ruin a ton of other users experience. As for Tomb Raider Legends, I actually know this case well and from that list above I can certainly believe it actually worked, however that game is bad example of everything that's wrong with popular franchises and console ports. It's actually bugged(even on real PSP) in a way that it has a really poor variable fps system that suffers from slowdowns whenever any change happens. A more quality workaround used by most people is to simply overclock PSP cpu to 333mhz to stop the game from ever lowering fps(even on real hardware with CFW). The fact it has variable fps makes it appear to work 100% fine with lower values on that emu side hack, but if the game goes even lower, you'd still experience the game bug, hence probably why the user set it to 20 there(and not sure if that's even enough as it probably could go lower in some places ~ another problem with user reports, people say that hacks work after testing like 1% of the game which is useless). Either way this is a terrible port, but would still give better experience with a fan made 30 fps patch than going even lower with emu hack and with anything that can run 60fps PSP games normally without performance issues, just overclocking psp cpu is the better way to go. PSP emulation for most people is a way to enhance the original experience, degrading it is not something most users desire. |
As you can tell from the low number, I implemented that some time ago (almost 8 years, I guess.) I had misgivings about it then, but hoped it would be a "safe" hack to improve two particular games that render at a breaknext pace. It didn't turn out safe. Even when it didn't cause major problems, it caused framerate issues (i.e. not hitting 60 consistently even if the device was completely capable) in some games. It also only worked to any degree for games that call sceDisplaySetFramebuf, which is most games but certainly not all. Remember that there are 1500+ games (not even counting different region variants), so we want to do things generically. We don't write 1500 different versions of components of the emulator for each individual game. We do have some detection of patterns that certain game developers used for some performance stuff, but FPS handling is much more varied. Game specific patches will always result in better quality FPS limiting than PPSSPP can do generically. The God of War example is a good one - the #2542 change did help performance, but the game patch helps much more. See here: But in summary (it's a long post):
And to be clear, God of War is probably the game where that change performed best. In many games, it'll cause more rendering to be built up each frame, and just increase microstutter with no performance benefit. -[Unknown] |
I see, based on the post at forum, GoW (and probably other games with similar FPS issue) is lacking of Vsync and render as many frames as possible, and by inserting vblank using cheat it's doing a vsync to PSP's display refresh rate or half of it. |
This is kinda related to #11372 or not? |
My device is weak and i want to limit all my games to 30fps but idk how. |
I'm having a problem with Midnight Club 3 LA Remix
The game runs 30fps in heavy areas or races, and try to reach 60fps in certain area.
My device runs fine at 30, but only manages to reach 45-58/60 ( Choppy sound and slowdowns)
This also happen in few other games:
Tomb Rider
Spiderman 3
MC3 DUB edition
Frameskip comes in handy at 60fps, but it also skip 1 frame at 30fps, making the game runs 25/30.
Adjust CPU clock speed causes really weird fps like 20/24/44/55/59
If only I could have to game run at 30,40 or 50 fps. It would be perfect
The text was updated successfully, but these errors were encountered: