ThirteenAG / WidescreenFixesPack

Plugins to make or improve widescreen resolutions support in games, add more features and fix bugs.
https://thirteenag.github.io/wfp
MIT License
2.29k stars 218 forks source link

Resident Evil Revelations 2 split screen - settings for more height in coop #1475

Open miraf001 opened 10 months ago

miraf001 commented 10 months ago

Hi,

Thank you for your work on these awesome fixes.

When I saw your fix for fullscreen splitscreen coop in RE revelations 2, I thought it would be great to use it with two monitors, so each player can control each character on his own screen, so the monitors are set on top of each other, merged with the help of Eyefinity or SoftTh. So the resolution would be 1920x2160 for two 1080p monitors, split in middle. I was able to set this up successfully, however the result is as seen in screenshot, fixed 16:9 ratio, centered in height with black bars, so each of the monitors shows only half of the screen. Here are the screenshots for better idea what I mean.

1 2

Please, would it be possible to fix the "ultrahigh" resolution, just as you did the ultrawide, so it can be used this way? I am sure more people, who want better coop experience, would be very grateful.

Thank you.

ThirteenAG commented 10 months ago

Try altering parameters in these functions, maybe it will help: https://github.com/ThirteenAG/WidescreenFixesPack/blob/master/source/ResidentEvilRevelations2.FusionFix/dllmain.cpp#L615-L631 Though I'm not sure, the game is not designed to be on two monitors, there's plenty of fullscreen UI, cutscenes etc even in split screen.

miraf001 commented 10 months ago

Thank you, I will try this. Hopefully I'll manage to compile it, I've never done this before.

miraf001 commented 10 months ago

Sadly it didn´t work. Setting split screen to two 1920x1080 just freezes the game. Even in single player before the second player joins in, the picture is in fixed 16:9 with black bars above and below. So maybe it is because game doesn´t want to accept less wide aspect ratio in this resolution that 16:9. Maybe if I could force it do display correct aspect ratio without the black bars before the second player joins in, it could work in coop too. I tried to edit it myself in source code, but sadly I was unsuccessful. Any chance you could advise please?

ThirteenAG commented 10 months ago

You probably better off with 3840x1080 res, then just set appropriate coordinates to these two split screen functions. It might require more code to handle this case in other interface related functions though. Unfortunately it's not something I can check out ATM.

miraf001 commented 9 months ago

Thank you. To my surprise I actually managed to get it working in ultra widescreen. (I actually used slightly wider 3968x1080 because it is easier for me to test right now.)

This is the code that worked for me. `void __stdcall SplitScreenSetupTop(void a1, int32_t a2) { a2[0] = 0; a2[1] = 0; a2[2] = (int32_t)(720.0f / 2.0f GetAspectRatio()); // (720/2) aspect ratio a2[3] = (int32_t)(720.0f); // Total height return injector::stdcall<void(void, int32_t)>::call(0x4AC310, a1, a2); }

void __stdcall SplitScreenSetupBottom(void a1, int32_t a2) { a2[0] = (int32_t)(720.0f / 2.0f GetAspectRatio()); a2[1] = 0; a2[2] = (int32_t)(720.0f GetAspectRatio()); a2[3] = (int32_t)(720.0f); return injector::stdcall<void(void, int32_t)>::call(0x4AC310, a1, a2); }`

Now in side-by-side splitscreen the HUD, inventory, pause menu and the crosshair is offset too much to the right, as can be seen in screenshots. 20231211210928_1 20231211210848_1 20231211210904_1

Can you advise please, is there already code in your source to move these elements? And if so, can you please help me find it? Thank you so much for your help.

ThirteenAG commented 9 months ago

https://github.com/ThirteenAG/WidescreenFixesPack/blob/master/source/ResidentEvilRevelations2.FusionFix/dllmain.cpp#L408

miraf001 commented 9 months ago

Thank you. Today I tried for several hours adding/subtracting numbers to values in the OFFSET, but for some reason the game completely ignores everything I try. Regardless of if I try to offset it just by just a hundredth or a large number, the HUD stays firmly the same and doesn´t move at all. I really hate to bother you with this again, but could you point me in the right direction again, hopefully for the last time? I am at a loss.

Thank you.

ThirteenAG commented 9 months ago

You can see the surrounding if statements of that code, they check for screen coordinates to detect which screen is top, which is bottom, so when you edited screens coordinates, these checks became invalid. You need to edit them as well, with appropriate coordinates.

miraf001 commented 9 months ago

Right, thank you. So I used this code, hopefully it should now recognize the left and right screen, but I still couldn´t see any changes in the game.

case OFFSET: { if (IsSplitScreenActive()) { if (v28 == GetCurrentSplitScreenResX() || v28 == (GetCurrentSplitScreenResX() + 1)) { // Adjust for the left screen v14 = 2.0 / (float)(v28 - v19); v15 = -2.0 / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / GetDiff()); v13[3] = (float)(v15 * v7) + 1.0; } else if (v28 == GetResX()) { // Adjust for the right screen v14 = 2.0 / (float)(v28 - v19); v15 = -2.0 / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / (GetAspectRatio() / defaultAspectRatio)); v13[3] = (float)(v15 * v7) + 1.0; } } else { if (v28 == GetResX()) { // Adjust for a single screen (no split-screen) v14 = 2.0 / (float)(v28 - v19); v15 = -2.0 / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / GetDiff()); v13[3] = (float)(v15 * v7) + 1.0; } } } break;

Then I decided to revert back to your unaltered code, straight here from Github, without any changes to splitscreen positions, only so I could see the HUD behaviour when I change the offset. But even more strangely, even with your original code, I simply cannot see any changes in the HUD position, regardless of what I do in offset. So now I am even more confused.

Does the offset code work OK for you?

ThirteenAG commented 9 months ago

Because offset here is used only for one HUD element: uGUICommandFar. The main thing here is rescale, I think that one affects the majority of 2d elements.

miraf001 commented 9 months ago

Ok, thanks, I will try to make some changes to the scale. So far everytime i made any change it just made the HUD and main menu disappear completely, hopefully I will have more luck now.

miraf001 commented 9 months ago

It seems I managed to do it even scale it down, thank you for guiding me! I may have screwed up the code for the recognizing the left and right screen in split screen, I changed it to:

case OFFSET: { if (IsSplitScreenActive()) { if (v28 == GetCurrentSplitScreenResX() || v28 == (GetCurrentSplitScreenResX() + 1)) { ... } else if (v28 == GetResX())

But it uses settings only from the left screen for both, but it isn´t really problem, the settings works well for both screens.

The item icons, which should be in the right bottom part of the screens are too high, as a result of scaling down, but it is minor issue. 20231213230155_1 20231213230227_1

I only managed to make the "idiot version", where I just set the offset by numbers and kept testing until it was right. When we will play on the 3,840x1080 I suppose I will have to adjust it again for this specific resolution.

It would be great if you one day decide to release the proper side by side splitscreen version, but I can of course understand if you aren´t interested in that.

Take care.