rebtd7 / FF13Fix

Performance and bug fixes for the PC versions of FF13 and FF13-2
GNU General Public License v3.0
348 stars 24 forks source link

Uncapped framerate breaks facial animations. #3

Open ziobroaatwit opened 4 years ago

ziobroaatwit commented 4 years ago

If playing at high framerates when the in-game limiter is disabled, facial animations on in-game cutscenes play back extremely quickly, skipping their transitions between each expression. This makes the appearance of the characters talking look very jarring. When the in-game limiter is re-enabled, this issue goes away.

rebtd7 commented 4 years ago

Hi,

Which game is affected by this? (FF13 or FF13-2?) Could you upload a save file near a cutscene where this is noticeable?

ziobroaatwit commented 4 years ago

I can only test this in FF13 as I don't own FF13-2, however this clip shown here shows the correct speed at 60FPS using the limiter in-game, while this one at around 150FPS when the FPS is uncapped shows them sped up, they still technically sync to the audio, but something is going awry with the animation itself. The save game in question I'm using to check this is attached, which loads directly into the scene I recorded. ff13-40.zip

rebtd7 commented 4 years ago

Yep, they do seem to be broken =/

Thanks for the videos

Could you upload the save again? I believe you have uploaded the wrong one (just after the cutscene). I think the game shows the saves starting with 01, but the file names start with 00 so you probably meant to upload ff13-39.dat

Nucleoprotein commented 4 years ago

It looks like lipsync engine is also running at ~150FPS.

ziobroaatwit commented 4 years ago

Yeah I'm going to say that was a late night flub on my part, here is the right one. ff13-39.zip

rebtd7 commented 4 years ago

Is it just me or the lip animations seem to be a bit broken even at 60FPS? Perhaps they only work properly on 30FPS (console FPS cap)?

60FPS 30FPS

I'll update the ini to cap the FPS to 60 by default, as fixing this probably won't be an easy task...

ziobroaatwit commented 4 years ago

I agree with this one after comparing the two clips. I didn't even think to clamp down to 30 to check since I just assumed that they would work fine at both 30 and 60 since the port normally reaches 60 even with the aggressive frame limiting. I wonder if a method of engaging a cap for cutscenes alone would be an appropriate fix. I haven't discovered any other oddities with the FPS uncapped in gameplay yet.

rebtd7 commented 4 years ago

Yeah, capping the frame rate only during cutscenes would be a possible workaround for the issue

I think I'll want to spent some time trying to understand and fix the real issue before doing something like that though

Interestingly enough, the lip sync doesn't seem broken in this cutscene if you change the voice language to Japanese

scottjco commented 4 years ago

I got to say, I absolutely adore this mod and thank you for finally doing what Square couldn't do and actually fix the games. Playing FF13 this morning the difference is night and day. It really is.

The 60fps cutscene linked above doesn't look too bad to me, Is the jankiness really that bad above 60fps? I can live with a little bit of jank for the benefit.

If limiting the game to 30fps only during cutscenes would solve it I could live with that too, just my 2 cents. A lot of modern games do that, Injustice 2 for example.

ziobroaatwit commented 4 years ago

In my opinion, for a story based game like this, the jankiness is really a problem since the game relies on so many in-engine cutscenes that utilize the lipsync. For a proper experience, the most emotional or intense moments with camera close-ups could be ruined by the very PS2 lip-flapping motions of the broken lipsync at high framerates. 60 is acceptable, but say like I was getting at 140-180FPS, the animations are totally busted.

Additionally I'll give changing the language a shot and see if it is working correctly in Japanese. I'm curious why the two would be different other than porting mistakes.

scottjco commented 4 years ago

oh yeah I just tried it at 100fps (the max framerate I can see with this monitor) and the first cutscene I saw was jarring as heck. I'll stick with 60fps then. Which is fine since battles drop down to 80fps with anti-aliasing maxed out anyway.

MarioTainaka commented 4 years ago

Just stumbled upon this last night, seriously thank you for fixing this i've been having issues with these games ever since I bought them, I switched various GPU and CPU generations through out the years. each one more powerful but the last but the game remained a mess. Thank you. for the first time I can experience the game at a smooth 60.

Mic601 commented 4 years ago

For some reasons after I alt tabbed out and returned to the game the facial animations were fixed at 144fps. Everything was buttery smooth.

Liwenhan commented 4 years ago

For some reasons after I alt tabbed out and returned to the game the facial animations were fixed at 144fps. Everything was buttery smooth.

Did you use fullscreen when you alt-tabbed, or was it just (borderless) windowed?

Noikar commented 3 years ago

Yeah I'm curious about that too.

des506 commented 3 years ago

Wonder if there have been any updates to this issue and if the alt-tab workaround actually works? I have tried with both Borderless windowed and Fullscreen, both don't seem to work.

Mic601 commented 3 years ago

I'm sorry guys for the late reply. I can't seem the replicate the animation fix no matter how much I alt-tab. I'm such an idiot for not recording any of the fixed facial animation back then and I will always hate myself for that. Sorry :(

rebtd7 commented 3 years ago

I spent some time with this when this issue was opened but I wasn't able to even find the routine responsible for the lip sync logic. Contributions to fix this are very welcome.

Asherek commented 3 years ago

Would you be willing to add an option to limit cutscenes to 60fps? I think that would be the best compromise right now. Cutscenes aren't interactive and don't have a ton of movement in this game anyways, so the difference between 60fps vs. uncapped isn't as obvious, compared to gameplay where you're controlling the camera. Thanks!

rebtd7 commented 3 years ago

I agree. Capping the cutscenes to 60FPS would be the best compromise. I'll work on it once I have time.

McJ0n commented 3 years ago

An option to cap to 30FPS for completely faithful facial animations would be appreciated as well.

Mic601 commented 2 years ago

Was it fixed because it's not broken for me (again) and consistently now. No need to alt tab and hope it works. This time I got a recording but the only problem is that the recording is in 60fps and I'm not able to find any way to record above that framerate. The things I've done different that could be the solution are:

-I'm running on Windows 11 (doubt) -I'm using the ultrawide screen patch on forced fullscreen (most possible)

Here's the link to patch if you wanna try it yourselves. You don't need an ultrawide to actually use the patch https://community.pcgamingwiki.com/files/file/2017-final-fantasy-xiii-ultrawide-fix/

Mic601 commented 2 years ago

While im at it here's the footage with my steam fps counter showing the framerate: https://drive.google.com/file/d/1pd5xs96PlgNlbd8Yh-F47IMBT2DYMsa7/view?usp=sharing

edit: you're gonna need to download the clip to have it play in 60fps didn't know google drive didnt support 60fps

ghost commented 2 years ago

Was this ever implemented? No rush, just asking.

I agree. Capping the cutscenes to 60FPS would be the best compromise. I'll work on it once I have time.

Asherek commented 2 years ago

@rebtd7 Hope you're doing well! Any chance you were able to add in this feature? It would be absolutely amazing to be able to cap the cutscenes to 60fps and 30fps as options. Thanks!

PFLI2 commented 1 year ago

While im at it here's the footage with my steam fps counter showing the framerate: https://drive.google.com/file/d/1pd5xs96PlgNlbd8Yh-F47IMBT2DYMsa7/view?usp=sharing

edit: you're gonna need to download the clip to have it play in 60fps didn't know google drive didnt support 60fps

And this only happens with ultra widescreen?

Noikar commented 1 year ago

I'm not using ultra wide

On Sun, Jun 4, 2023 at 12:21 AM PFLI2 @.***> wrote:

While im at it here's the footage with my steam fps counter showing the framerate: https://drive.google.com/file/d/1pd5xs96PlgNlbd8Yh-F47IMBT2DYMsa7/view?usp=sharing

edit: you're gonna need to download the clip to have it play in 60fps didn't know google drive didnt support 60fps

And this only happens with ultra widescreen?

— Reply to this email directly, view it on GitHub https://github.com/rebtd7/FF13Fix/issues/3#issuecomment-1575376770, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJIPZIHX2LTWKGKACR62EBDXJQEM7ANCNFSM4KFWIWRQ . You are receiving this because you commented.Message ID: @.***>

Mic601 commented 1 year ago

Hi! I guess I owe an explanation after all this time. It seems the game has 3 types of cutscenes. Full mocap, cheap cutscenes where characters are cycling through presets of animations and (ofc) prerendered. It seems that the facial expressions arent broken in the full mocap cutscenes. I think I got confused when i opened the game with the ultrawide hack and saw how smooth the facial expressions were for the first cutscene i have seen. All the subsequent cutscenes were all mocap'd so I was hyped and thought i found the solution until I stumbled upon the cheap cutscenes where the facial expressions were broken again. Anyway i'm redownloading the game as I'm writing this down to test those "fully mocap'd" cutscene without the ultrawide fix to see whether or not the fix changed anything to them.

I'll keep y'all updated today


De : PFLI2 @.> Envoyé : 4 juin 2023 00:21 À : rebtd7/FF13Fix @.> Cc : Mic601 @.>; Comment @.> Objet : Re: [rebtd7/FF13Fix] Uncapped framerate breaks facial animations. (#3)

While im at it here's the footage with my steam fps counter showing the framerate: https://drive.google.com/file/d/1pd5xs96PlgNlbd8Yh-F47IMBT2DYMsa7/view?usp=sharing

edit: you're gonna need to download the clip to have it play in 60fps didn't know google drive didnt support 60fps

And this only happens with ultra widescreen?

— Reply to this email directly, view it on GitHubhttps://github.com/rebtd7/FF13Fix/issues/3#issuecomment-1575376770, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQABTCV3UVGTPPIJOGGSJPTXJQENBANCNFSM4KFWIWRQ. You are receiving this because you commented.Message ID: @.***>

Mic601 commented 1 year ago

@PFLI2 Ok done downloading. Applied the FFXIII fix and nothing else. Launched a save where I knew there was a "fully mocap'd" cutscene and it's working perfectly fine. So we can scratch the UW fix. My theory of the 3 types of cutscenes stands true as of now. Here's the proof: https://drive.google.com/file/d/1NHRwFKn5XJrfmKTQB4XTK9RgP4jIx-KJ/view?usp=sharing As you can see on my steam FPS counter I get an average of 130fps and the facial animations are perfectly fine. (download the video for the full resolution and framerate)

PFLI2 commented 1 year ago

@Mic601 That's an excellent find. So all we need to test are these "cheaper" cutscenes. How common are they?

Mic601 commented 1 year ago

@PFLI2 To my knowledge there's a lot of them. Even conversations during gameplay have broken facial animation so we can count those moments in the cheap cutscenes category. Honestly idk what's going on during the full high quality in-game cutscenes that causes facial animation to be interpolated correctly vs gameplay cheap cutscenes to have broken animations. Maybe a faulty line of code? (im not a programmer don't laugh lol)

Ok as I was writing that first paragraph I just decided to go press on new game and I'm confused as to why nobody noticed this before. All cutscenes during the fight against the mech have no broken animations at all. As soon as you jump into gameplay you can see lightning's eye lids have broken animations.

PFLI2 commented 1 year ago

@Mic601 I suppose this is up to the author. They'd need to cap these "real" cutscenes to prevent any broken animations.

Mic601 commented 1 year ago

Nah I dont think you get it. The real cutscenes are fine. It's the rest that isnt even down to gameplay that has broken facial animation


From: PFLI2 @.> Sent: Monday, June 19, 2023 5:16:35 PM To: rebtd7/FF13Fix @.> Cc: Mic601 @.>; Mention @.> Subject: Re: [rebtd7/FF13Fix] Uncapped framerate breaks facial animations. (#3)

@Mic601https://github.com/Mic601 I suppose this is up to the author. They'd need to cap these "real" cutscenes to prevent any broken animations.

— Reply to this email directly, view it on GitHubhttps://github.com/rebtd7/FF13Fix/issues/3#issuecomment-1597776019, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQABTCWQVPKRFI7O4IFMRJDXMC6THANCNFSM4KFWIWRQ. You are receiving this because you were mentioned.Message ID: @.***>

PFLI2 commented 1 year ago

That's my mistake then, apologies.

flowasaurus commented 1 year ago

I am able to get rid of the sped-up facial animations during all forms of cut-scenes, even the "in-game graphic" ones when lowering shadows from 4096 to 2048, while having over 100fps and playing at 1080p with full AA. If I go to 4096 the cutscenes revert back to the sped-up messed up ones.

PFLI2 commented 1 year ago

I am able to get rid of the sped-up facial animations during all forms of cut-scenes, even the "in-game graphic" ones when lowering shadows from 4096 to 2048, while having over 100fps and playing at 1080p with full AA. If I go to 4096 the cutscenes revert back to the sped-up messed up ones.

I don't see the connection but that's a great discovery

flowasaurus commented 1 year ago

Yeah, I accepted the speed up because it looks so sharp playing at 8192x outside of the speed-up cutscenes, which I kind of pretend to look away during lol.

Mic601 commented 1 year ago

I am able to get rid of the sped-up facial animations during all forms of cut-scenes, even the "in-game graphic" ones when lowering shadows from 4096 to 2048, while having over 100fps and playing at 1080p with full AA. If I go to 4096 the cutscenes revert back to the sped-up messed up ones.

I'm unsure if the shadow quality has any relevancy? In the recordings i've done in way above 120fps with 4k shadows. Maybe you just went through a bunch of fully mo-capped cutscenes and got confused. Keep playing to see if the broken facial animation reappears in later cutscenes. A similar scenario happened to me when I first made the claim that the Ultrawide fix was correcting the facial animation. I was just going through mo-capped cutscenes after one another. They are more frequent during the Pallum Pollum Arc.

In fact you can test during gameplay if the facial animations are still broken. Look at your character's face and wait for them to blink or move their mouth. You'll see the eyes and mouth skipping all their frames to go from open to close.

flowasaurus commented 1 year ago

I will double check, as I am actively playing, and can make a new save/catch up to the point I noticed it quickly.

Mic601 commented 1 year ago

@flowasaurus wait reread my message I edited it. Last paragraph. Do that to save a huge amount of time. From my understanding the bad broken cutscenes are, yes in-game, but also during gameplay mode as they just cycle through a bunch of npc animations (similar to when you speak to a skyrim npc they will move their arms and do some lil gestures). Hope that helps for your tests!

Mic601 commented 1 year ago

I'm tempted to do a video explaining what I'm trying to say. But like the game has clearly two states during gameplay. A cinematic state (facial animations are working as intended) and a gameplay state (broken facial animation). Those broken gameplay cutscenes are sometimes not too obvious to notice but like if you see Vanille walking with her default girly walk cycle during a cutscene, expect the facial animations to be broken.

(Giving Vanille as an example because she has the most outrageous and most obvious to spot walk cycle animation)

flowasaurus commented 1 year ago

The way I interpret it is there are 3 states. In-game cutscenes (sped-up), rendered cutscenes (normal animations), and basically fully animated videos (normal animations). When I discussed changing the shadows all 3 were in sync/matched voices with facial animations and body animations, when I upgraded the shadows the lowest quality cutscenes and animations sped-up.

PFLI2 commented 1 year ago

I'm tempted to do a video explaining what I'm trying to say. But like the game has clearly two states during gameplay. A cinematic state (facial animations are working as intended) and a gameplay state (broken facial animation). Those broken gameplay cutscenes are sometimes not too obvious to notice but like if you see Vanille walking with her default girly walk cycle during a cutscene, expect the facial animations to be broken.

(Giving Vanille as an example because she has the most outrageous and most obvious to spot walk cycle animation)

That video would be much appreciated.

flowasaurus commented 1 year ago

You are correct, I was wrong, I double checked and the cutscenes just switched up the style so often and now see it is still sped up.

Asherek commented 1 year ago

The single easiest way I think to resolve this issue would be to add an option to cap cutscenes at 60 fps even if you have 120fps for gameplay. For cutscenes, where you don't have any control of the camera, the difference between 60 and 120 is very negligible since it's not tied to input -> what your brain sees.

PFLI2 commented 1 year ago

The single easiest way I think to resolve this issue would be to add an option to cap cutscenes at 60 fps even if you have 120fps for gameplay. For cutscenes, where you don't have any control of the camera, the difference between 60 and 120 is very negligible since it's not tied to input -> what your brain sees.

If possible that would be ideal. The idea is in this thread in a post from about 3 years ago so we just have to wait.

Nucleoprotein commented 1 year ago

This should be quite easy to be done but then some seriale is needed that is set when cutscene is playing...

Glurak18 commented 9 months ago

soo i guess we dont get a fix for that? Or a 2nd limiter for cutscenes :( Still waiting for a fix :O

Xbob42 commented 8 months ago

This should be easily doable externally (albeit with a little more effort from the player) by having two hotkey toggles in RivaTuner Statistics Sever (RTSS) -- one for your "cheap" cutscene animations (30 or 60) and one for your normal gameplay (120, 165, etc.)

Then, if you get weird looking cutscenes or just want to be safe, you hit the button to toggle between them. Easy enough in RTSS, though I'm having trouble even getting the RTSS overlay to show up in this game, let alone getting my FPS toggle hotkeys to work. I can cap the FPS below the mod's FPS just fine, but the toggle hotkeys themselves are giving me issue. Ideally I want to set some of the back paddle buttons on my controller to these keyboard toggles, that way I don't even have to sit up to do this, so it'll be about as minimally inconvenient as a non-native solution can be.

EDIT: Got it, just had to use another hotkey to enable my framerate limiter. (Probably disabled it by accident.)

So now I've got two keys, enable 60 FPS cap and enable 120 FPS cap. Works flawlessly in gameplay, gonna try to check cutscenes now to see if you can safely change it in a cutscene without breaking the animations further. If not I'll just enable the 60 cap whenever a cutscene is about to start, but I hope it's changeable mid-scene.

Here's a 40 second video to show you how to set these hotkeys: https://www.youtube.com/watch?v=658GiBKe2Gk

PFLI2 commented 1 month ago

This should be easily doable externally (albeit with a little more effort from the player) by having two hotkey toggles in RivaTuner Statistics Sever (RTSS) -- one for your "cheap" cutscene animations (30 or 60) and one for your normal gameplay (120, 165, etc.)

Then, if you get weird looking cutscenes or just want to be safe, you hit the button to toggle between them. Easy enough in RTSS, though I'm having trouble even getting the RTSS overlay to show up in this game, let alone getting my FPS toggle hotkeys to work. I can cap the FPS below the mod's FPS just fine, but the toggle hotkeys themselves are giving me issue. Ideally I want to set some of the back paddle buttons on my controller to these keyboard toggles, that way I don't even have to sit up to do this, so it'll be about as minimally inconvenient as a non-native solution can be.

EDIT: Got it, just had to use another hotkey to enable my framerate limiter. (Probably disabled it by accident.)

So now I've got two keys, enable 60 FPS cap and enable 120 FPS cap. Works flawlessly in gameplay, gonna try to check cutscenes now to see if you can safely change it in a cutscene without breaking the animations further. If not I'll just enable the 60 cap whenever a cutscene is about to start, but I hope it's changeable mid-scene.

Here's a 40 second video to show you how to set these hotkeys: https://www.youtube.com/watch?v=658GiBKe2Gk

Having to mess with hotkeys mid-game is really not ideal but a good bandaid for now I guess.