fayaz12g / totk-aar

Any Aspect Ratio for Tears of the Kingdom! A tool to generate custom settings to make the game look great on any display!
106 stars 5 forks source link

Disable Quality Reduction mod not actually loading #56

Closed InterClaw closed 1 year ago

InterClaw commented 1 year ago

I was suddenly noticing some pretty jarring FPS drops, like dropping down to 22-23 fps, or even 11 fps, for no apparent reason. GPU power consumption spikes when this happens as well.

After a lot of testing back and forth with various versions, I've determined that this is what happens if "Disable Quality Reduction" is not loaded. At least for me, with the below settings.

image

I've tried this in these versions, which are the recent ones that I can generate. 8.0.1 8.1.1 8.1.4 8.2.0

I tried it without "LOD Improvement", but that had no effect. And I tried it in 8.0.1, because in that version the mod is still under its old name, thinking that maybe that had something to do with it, but nope.

If I put "Disable Quality Reduction" separately in the mod folder, then the problem goes away. This is with or without having included it in AAR mod.

So it seems it's either not getting included in the generation at all, or at least not properly so. Or it's not loading when starting the game for some reason. Is it somehow overwriting itself? But not doing that when running the mod separately? I'm on Yuzu ML 1505 btw.

Or is it the wrong version perhaps? The one I'm using is from the collection here, v2.5.1, but I don't think this mod has changed, since it was updated for 1.2.0 a couple of weeks ago.

Speaking of versions, a thought for the new UI, perhaps including the version number (where available) of the mods featured in the tool could be a good idea, so you don't need to guess what you'll be running with. 👍

fayaz12g commented 1 year ago

Thank you for the detailed report. After looking at the code, I’m a little confused as to what is wrong. Disable Quality Reduction is literally just one line of code, two hex values (the source and replacement). That line of code is being generated in the pchtxt by the utility, at least on my end. Do you see it in yours? As for version numbers, as it’s just one line of code it doesn’t have versions, it’s never been updated per se, but rather the 1.2.0 version a few weeks ago that was released just changed the register it edits (the first hex value) to the new one given the offset by the version number. I’ll do some more testing and try putting the mod in separate like you mentioned to see if it changes anything.

InterClaw commented 1 year ago

I had a look inside the files and, yeah, I see what you mean. It sure is there in my generated version when ticked. And not there, when not. 🤷‍♂️

Since I can't really record what's happening, because N wouldn't like it, I took some small screenshots of RivaTuner of the four combinations to exemplify how it behaves. This is in a shrine called Sinakawak, next to New Serenne stable, just northwest of Lookout Landing. I found it good for testing, since it's a bit misty inside and has some fire light sources. I walk up to the first platform and spin the camera at a moderate pace.

Look at the frametime line at the bottom. When it's low I'm having low frametimes when at (or close to) 60 FPS. When you see the steep hills I get terrible FPS drops.

image

The squiggly part of the line on the bottom two is when I'm not quite hitting 60 FPS, which is normal for my CPU.

Top right, you can also see the power consumption for the GPU spiking when it happens (on its way down there though). It seems it's panickingly trying to swap out assets or something when the mod is not working and the FPS drops slightly. And then trying to load those quickly, which draws a lot of power. And the game chugs as a result. My theory.

As you can see, it doesn't matter if I've ticked the mod or not. I have to include it separately for it to work properly. So it seems that line is just ignored for some reason then...

I tried manually putting that line at the top to see if the order matters, but that just broke the aspect ratio and I got a very wide Link. So yeah, the order matters... 🙃

Me not knowing what I'm doing: image

Fruithapje21 commented 1 year ago

The problem here is pretty obvious and has to do with the formatting of pchtxt file. No offence but you maybe want to read the documentation and properly test stuff first because as I'm looking through the commits, none of the files from v4 onwards would actually work. Once you set the @enabled flag, the IPSwitchCompiler starts reading and it only expects an offset and a value. If you try to load comments, line breaks or whatever in between it will just stop reading. The yuzu log also clearly shows that only the first three instructions were patched (using the patches created by the latest version): Screenshot 2023-07-26 232737

The easiest fix is to just enclose every patch in its own enabled/stop block. The better way would be to create a template for each game version and fill in the placeholders depending on what the user selected. To give you an idea what I mean I have added an example in this comment. Note the '@{statusX}' for every optional patch, which you can either replace with @enabled or @disabled depending on the user input. Patches starting with @disabled to not get applied. If you are lazy you can copy the templates from me and add your own needs into it. main-1.2.0.txt

InterClaw commented 1 year ago

I took out all the comments and line breaks from my generated one for now, so it's just one big enabled/stop block and it seems to be working great! Noticing some other changes as well now hehe.

fayaz12g commented 1 year ago

@Fruithapje21 Thank you for explaining that all to me, I've never worked with this before. I always thought that including the "//" would comment out a line and it would skip it when reading. Before seeing these comments, I did a lot of testing with it today over zoom with my friend (as I still don't have access to yuzu for another week) and after yuzu crashing many times finally got it working by removing comments, I didn't know line breaks would also cause an issue though, which is currently how all of the visuals are built. I'll rebuild it in a way similar to what you mentioned at the end, as when I tried enclosing everything in a @enabled and @stop yuzu was crashing. I'll work on getting a version that generates without line breaks and comments out tonight. I just released my fixes from today which have the Disable Quality Reduction and LOD Improvement on by default.

I've also done a lot of fixes for the way images display now no longer being squished in the load game menu, save game menu, image saving menu, and the compendium saving menu. If you want to include any of those changes in yours, I put comments saying "new" next to all the new lines to make it easier to find because it was trial and error over a hundred commits (I was having my friend on zoom test the game and each time I made a change I would push the code, then he'd pull it and run it and launch the game).

fayaz12g commented 1 year ago

Okay @Fruithapje21 @InterClaw I just worked on a new version that makes use of the disabled tags including all the features but only turning them on with the enabled tag if they are checked. I found a pretty quick way to do this was generate all 5 files using my utility, then copy them into their own variables as strings and modify them with the right tags. This new method also uses no line breaks and has enabled and stop tags around every line of code so it should work. It is version 8.4.0

Edit: tested on my steam deck and it is working