God of War Chains of Olympus/Ghost of Sparta - Performance improvements codes
|
11-19-2016, 03:30 AM
(This post was last modified: 05-17-2017 09:48 AM by Kabuto_Kun.)
Post: #1
|
|||
|
|||
God of War Chains of Olympus/Ghost of Sparta - Performance improvements codes
Hey guys,
I have made some great performance improvements to God of War Chains of Olympus and Ghost of Sparta, something that was long needed for these games, but let's write some background info first, if you're interested to read them . Introduction. Both God of War games are very special in how they run on a real PSP, and therefore on PPSSPP too. They always try to render the maximum number of frames possible, even when the game is already running at over 60 FPS. For a real PSP this is not a problem, as the hardware can not actually reach 60FPS anywhere, but even if at some point it can do it, you wouldn't feel the extra frames because the PSP screen has a 60 HZ refresh rate. This is the same situation that happens when, for example, you play a PC game at 100FPS using a monitor with a refresh rate of 60 HZ: you will not see any visual difference (you may only get better input response) because the refresh rate is lower than your actual FPS and you will be just burning processing power. GoW PSP games had been very CPU demanding with emulators since the beginning, and this behavior is the main culprit. PPSSPP runs PSP games with a lot better internal performance than a real PSP, even while using the same PSP CPU speed, so both GoW games are almost always running at higher than 60 FPS in PPSSPP even if you see its green FPS counter always showing 60 FPS as max (this is a PPSSPP limitation). This is why the option "Prevent FPS from exceeding 60 (speeds up GoW)" was implemented by PPSSPP devs, a workaround to avoid rendering useless frames above 60 FPS, so we can get much better emulation performance. The problem is that this option is not perfect. Tests. I can easily tell the difference between different FPS in games, that is why I like so much to play them at 60FPS when possible . So while playing any GoW game on PPSSPP, I have always noticed that even when the emulator shows the game to be running at "60 FPS", the game feels like it's running at 40+ or 50+ FPS (like using some kind of forced frameskip), depending on what is happening in gameplay. After some research about this, I found an address in RAM for both games where a continuously calculated internal FPS value gets stored as a float; the addresses are (in CW Cheat format): - GoW Chains of Olympus: (UCUS-98653 @0x32D8C0), (NPUG-80325 @0x32FAD8), (NPEG-00023 @0x32FAE8), (UCET-00844/UCES-00842 @0x32D8D0), (UCED-00971 @0x29B390). - GoW Ghost of Sparta: (UCUS-98737 @0x40EFC0), (UCES-01401/NPEG-00044 @0x410560), (UCES-01473 @0x410600), (NPEG-90035 @0x37ACC0). Then I wrote a simple assembly code to show the internal FPS value instead of the ingame red orbs indicator, and while playing the game and monitoring the value I noticed some things: - If you disable the Prevent FPS… option the game can run anywhere from 150+ FPS (ingame) to over 2000+ FPS!! (menus), which causes the bad performance I explained above; if you enable the option, the game is still running at 90+ FPS (ingame) and 300+ FPS (menus), so it is still rendering more frames than it should. The internal FPS you get depends on the CPU speed you have configured in PPSSPP options when you booted the game. - But there is more, while playing the game with the Prevent FPS option enabled, the higher the internal FPS (the one I found) value is over 60 FPS, the choppier the game runs. So for example, when you play the same scene at 65 vs 85 internal FPS, the games run a lot smoother at the lower speed. This is the forced frameskip I complained above. If you want to check this by yourself, you can change the PSP CPU speed to some value where the game stays close to 60 FPS but not higher (50+FPS, according to the green FPS counter in PPSSPP) and you will see that the game feels a lot better than the "fixed" 60 FPS you get with a higher CPU speed using normal settings. At this point, it's clear why I said the option is not perfect. As alternative workarounds for "better" performance, people use PPSSPP frameskip option, which is not a good idea in practice; others just decrease the CPU speed in PPSSPP to ridiculous values (66, 33, even 15mhz ) to make the game "playable", but the end result is just sad: a game randomly jumping anywhere from 10+ to 50+ FPS. But… I didn't write this post as a complain, this is all about information and, of course, posting a solution . I managed to limit the internal FPS of both GoW games to a fixed/stable 60 or 30 FPS (your choice) by inserting vblanks (1 for 60FPS and 2 for 30FPS). I'm not totally sure if this was the best way to do it, but AFAIK this is what the game developers should have done in the first place, and it works great so far as you will see. Performance comparison. For the next performance comparison, I am running the first level from Chains of Olympus in the the exact same scene with the game paused (like when a hint appears, still running), unlimited emulator speed and using all the same emulator settings unless the changes specified: IMG1^ No cheat. Prevent FPS: OFF, Internal FPS: 161, CPU speed: 555Mhz, PPSSPP VPS/percentage: 66/108% - - - - - IMG2^ No cheat. Prevent FPS: ON, Internal FPS: 87, CPU speed: 555Mhz, PPSSPP VPS/percentage: 117/193% - - - - - IMG3^ Fixed 60 FPS. Prevent FPS: OFF, Internal FPS: 60, CPU speed: 555Mhz, PPSSPP VPS/percentage: 162/270% - - - - - IMG4^ Fixed 60 FPS. Prevent FPS: ON, Internal FPS: 60, CPU speed: 555Mhz, PPSSPP VPS/percentage: 161/267% - - - - - IMG5^ Fixed 60 FPS. Prevent FPS: OFF, Internal FPS: 60, CPU speed: 266Mhz, PPSSPP VPS/percentage: 158/262% - - - - - IMG6^ Fixed 30 FPS. Prevent FPS: ON, Internal FPS: 30, CPU speed: 555Mhz, PPSSPP VPS/percentage: 152/505% Observations from the images: - As you can see from pictures 1 and 2, PPSSPP shows 60 FPS as max even when the game is internally running higher than that. - By comparing the picture 1 with the number 2, you can see the performance benefit of enabling the Prevent FPS option: 193% (option ON) vs 108% (option OFF). - By comparing picture 2 with pictures 3-4-5 you can see the performance benefit of using the fixed 60 FPS cheat vs only enabling the Prevent FPS option: ~267% (fixed 60 FPS) vs 193% (Prevent FPS option OFF and fixed FPS cheat OFF). - By comparing the pictures 3-4 with the number 5, you can see that there is no performance difference between 266 and 555 Mhz (or higher) in CPU speed when you're using the cheats and the game is already running at a fixed 30/60 FPS. - Picture number 6 shows how easy should be to run the game on weak hardware with the 30 FPS cheat: 505% (fixed 30 FPS) vs 267% (fixed 60 FPS). The higher the percentage is, the better/more efficient the game is running. You can expect the same performance gains in GoW Ghost of Sparta. As a nice bonus, the use of either 30/60 FPS cheats completely fixes the sky flickering issue; it was caused by the unstable default framerate behavior. Cheats. Please, read the How to use from below before using the cheats. v God of War - Chains of Olympus [USA-UMD/EUR-UMD], UCUS98653.ini / UCES00842.ini Code: _S UCUS-98653 / UCES-00842 Code: _S NPUG-80325 Code: _S NPEG-00023 Code: _S UCET-00844 Code: _S UCED-00971 v God of War - Ghost of Sparta [USA-UMD], UCUS98737.ini Code: _S UCUS-98737 Code: _S UCES-01401 Code: _S NPEG-00044 Code: _S UCES-01473 Code: _S NPEG-90035 How to use: - Before using the cheats (60/30FPS), you MUST increase the CPU speed in PPSSPP to a very high value (666 Mhz or higher is perfect), then reboot the game to make it effective. If you are already playing the game using savestates, save the game on a save point like in a real PSP, set the high CPU speed and reboot the game. Don't load anymore a savestate saved while having a lower CPU speed. - You should disable the cheat after you see that it has already been applied to the game. You can use the "Create a game config" option when you boot your GoW game, so this CPU speed (and other settings) will only work for this game. Additional details: The high PSP CPU speed is needed because of how the cheats I made work: It's like enabling double buffered v-sync: it makes the game use an internal frameskip to previous "steps" in the FPS that the game can internally run with the available PSP CPU power (1 step less while using the fixed 60FPS cheat and 2 less while using the 30 FPS cheat), for example: - 60 FPS cheat, if the game is internally running higher than 60 FPS, it will run at a fixed 60FPS. - 60 FPS cheat, if the game is internally running lower than 60 FPS, it will run at a fixed 30FPS. - 30 FPS cheat, if the game is internally running higher than 60 FPS, it will run at a fixed 30FPS. - 30 FPS cheat, if the game is internally running lower than 60 FPS, it will run at a fixed 20FPS. My test on a REAL PSP, which runs the games at lower speeds than PPSSPP, shows that: - 60 FPS cheat, if the game is running lower than 60 FPS, it will run at a fixed 30FPS. It's almost the same as with PPSSPP so you can imagine other variations, the difference is that the PSP can not always exceed the high FPS needed to avoid the "steps" to lower speeds. I tested the cheats for some time looking for negative side effects and I did not get any problems in PPSSPP (game speed is perfect and there are no other issues). I got a crash once in a real PSP, but this cheat is not made to be used with it, this is only for emulators. In case you have a highly clocked i7 CPU paired with a top of the line GPU (a powerful PC, you get the idea) and you think that you're already getting a smooth/constant 60FPS without these cheats: you're wrong. You should at least use the fixed 60 FPS cheat even with powerful hardware, this way you avoid the previously explained forced frameskip and can play these GoW games at a real silky smooth 60 FPS, and all by still using less hardware resources than without using the cheats. In conclusion, you MUST use a high CPU speed value (like 666Mhz or higher) so the game is always running at FPS higher than 60FPS, this way you get both cheats (60/30 FPS) to run like they should. If you check the performance comparisons from above, you can see that while using the cheats, there is no performance difference between using 266 and 555 Mhz (or even 999Mhz) as CPU speed if the game is already running at 60FPS, but using 266Mhz will make the game run at a fixed 30 FPS at some points where it can't keep over 60 internal FPS so don't use low CPU speeds. TL;DR: Grab the performance cheats in the Cheats section from above, but you MUST read the How to use section before you try to use them. This is a long post, I will edit it later with random corrections and I have to port the cheats to other game regions/releases too, so please do not quote this whole post. I have made other similar speed improvements/bug fixes to other PSP games too and I will post them at some point on a master list post or something. If you have questions or feedback about this post, just post them here. Enjoy. goo.gl/kNOhTz : 60FPS master list, Mar. 2017 ; Reddit /u/Kabuto_Kun forums.ppsspp.org/showthread.php?tid=4799&pid=105128#pid105128 : Unlock FPS in PSP games ("easy method") forums.ppsspp.org/showthread.php?tid=4799&pid=123500#pid123500 : Permanently patch a PSP game with CW cheats. |
|||
« Next Oldest | Next Newest »
|