Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Discuss tools to aid in the modification and running of Rayman games.

Moderator: Modding and utilities team

Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
JohnnyGui
Blue Lum
Posts: 23
Joined: Sun Feb 07, 2016 8:12 pm
Tings: 115

Re: Rayman 2 PC Widescreen Patch Update (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX,

Post by JohnnyGui »

deton24 wrote: Thu Apr 22, 2021 8:02 am Copy ubi.ini from the package linked above and set Vulkan renderer in nGlide configurator as well.

Or PM me around Saturday 16:00 (GMT+2) and I can help you on TeamViewer if it's still the same.
Thanks. I just noticed something. The game crashes even if I launch it in its original state right after installation without changing any files. So the widescreen customization is not the cause. I have also tried your linked ubi.ini along with changing to Vulkan but no avail. Installing nGlide 2.10 and trying out every possible compatibility mode for the.exe file also doesn't help.

It seems that Windows 10 itself is the cause of the crashing for some reason. What Windows 10 build do you have?
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch Update (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX,

Post by deton24 »

The guy who had this problem had a recent W10 build for the day of his post. Should be findable on Wikipedia.

He had exactly the same. The game wasn't working even after clean installation. IMHO the problem is the newest GOG release which has some new changes.

You can move your game folder to desktop. Especially if it was in C:\GOG.
Eventually try to use path without spaces in folder names.

You can also check out DgVoodoo Glide, but probably it won't work too.

If still nothing, check whether this one works:
https://disk.yandex.com/d/R97ROA5MkUjdzg
edit 2023 or this with newer widescreen
https://drive.google.com/file/d/1Pr8MYK ... sp=sharing
(but both probably with 16:10 patch, or at least the latter)
ICUP321
Baby Globox
Posts: 125
Joined: Mon Sep 05, 2016 9:37 pm
Tings: 635

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by ICUP321 »

So I decided to make a few personal changes to Automaniak's Rayman 2 widescreen patch. The changes I made were so that the FOV and horizontal aspect ratio value match very closely to that of the original 4:3 aspect ratio. They're not exactly identical, but I think I've gotten it to the point where it looks almost identical.
Here's a comparison:
4:3
Image

16:9
Image

My widescreen patch is 16:9 only and has only been tested on the GOG version, but if anyone wants to try adapting it for other aspect ratios/versions, feel free to do so.
https://www.mediafire.com/file/rfptt7ux ... ix.7z/file
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by deton24 »

Great thanks! I'll post it at the top as well. It will be useful for someone for sure!
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by deton24 »

New method of permanent change of FOV replacing Cheat Engine hack:
https://www.youtube.com/watch?t=95&v=YdI8oBA8p0U

(thanks for the info, Kacepru)
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by deton24 »

Garo released a new widescreen patch for Rayman 2
16:9, 16:10, 21:9, 32:9 versions available

https://github.com/TonicGaro/R2Widescreen/releases

So far, it was only tested with the latest GOG release (it's for $1.49 on GOG till July, 11 09:59 EEST).

Changes:
- The patch already has pirate head DRM issue fixed,
- HUD icons are not stretched (it's applied also via optional textures.cnt and it wasn't fixed in HD tex mod in the same file, bear in mind that the patch might be not fully compatible with tex mod due to some offset binary changes; at least it wasn't tested),
- HUD icon positions corrected (at least with attached textures.cnt where squeezed icons are stored)
- FOV is fully corrected to match original 4:3 AR, so it looks exactly the same, plus additional space on sides from widescreen resolution
- FOV for all cutscenes was corrected
- Pop-in issues on the sides of the screen shouldn't be there "since I modified the FOV value in fix.sna instead of the one in the exe"


"I encourage everyone once my widescreen patch is finished to play the game in 21:9 at least once
it really intensifies the cinematic feel the game is going for
some parts of the game legit look like they were made for ultrawide" Garo

If you use Glide and no HD tex mod, these are recommended settings for Glide to avoid broken graphics or low res textures, 12MB VRAM left just in case
https://imgur.com/a/jwlebCu (presents also FOV corrections)

____
Known issues:
- Here you can find some comparison of Glide vs DX6, where the latter have lighting popping in and out on textures issues, but Glide won't support HD tex mod:
viewtopic.php?t=75444
- "When you hop inside the chair in top of the world, the FOV is actually zoomed in, like every second it's a different FOV value.
There's absolutely no way I'm going to figure out how to change it"
- "I already technically figured out how to squeeze the yeah text, but as a result it causes dialogue text to be very misaligned,
and IMO misaligned dialogue text is a lot more distracting" "even in the Dreamcast version the "yeah" text remains stretched even when you set the game to 16:9 in the video options"
lk19
Incrediball
Posts: 72
Joined: Thu Feb 11, 2021 8:52 pm
Tings: 360

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by lk19 »

deton24 wrote: Thu Jul 04, 2024 4:48 pm - "When you hop inside the chair in top of the world, the FOV is actually zoomed in, like every second it's a different FOV value.
There's absolutely no way I'm going to figure out how to change it"
I wonder how the FOV is changed in this patch. Is it by editing the fix.sna file? If so, I recently found a way to change the FOV directly in the EXE, without the need to edit any SNA files. It also scales every FOV value in the game with the new aspect ratio and does not need to be done separately for each FOV value. I might have a look at it once I'm done implementing it for the Playmobil games ;)
Garo
Walking shell
Posts: 91
Joined: Sun Aug 08, 2021 1:37 pm
Location: Vegetables' HQ
Contact:
Tings: 455

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by Garo »

lk19 wrote: Fri Jul 05, 2024 11:26 am I wonder how the FOV is changed in this patch. Is it by editing the fix.sna file? If so, I recently found a way to change the FOV directly in the EXE, without the need to edit any SNA files. It also scales every FOV value in the game with the new aspect ratio and does not need to be done separately for each FOV value. I might have a look at it once I'm done implementing it for the Playmobil games ;)
If it doesn't have any culling issues then you've peaked my interest.
lk19
Incrediball
Posts: 72
Joined: Thu Feb 11, 2021 8:52 pm
Tings: 360

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by lk19 »

So here it is: Just run the Python script in the same folder as Rayman2.exe (tested with GOG version).

It should basically work like a non-glitchy version of the Hor+ patch. In particular, you do not need to
  1. adjust the value 0.75 at memory address 0x40b904 / file offset 0xb904 as in the Ver- patch, or
  2. adjust any FOV values in SNA-files.
So these two changes probably need to be reversed, if this was to be integrated in the existing patch.

The code reads the resolution from memory and scales the FOV value accordingly. So, if all you want to do is change the resolution and the FOV, you do not need a separate EXE for each aspect ratio (I don't know about the other changes in the patch, though – they may still require separate patches).

The Python code contains lots of comments that are hopefully helpful. I also included two Screenshots of how the injected code looks in Ghidra, if this helps.

Edit: Also attached the patched EXE for testing.
Edit2: Removed the "old" patched EXE. Please use the newer version below. Kept the Python file for documentation.
Attachments
Rayman2_FOV_fix.7z
(53.53 KiB) Downloaded 32 times
Last edited by lk19 on Wed Jul 24, 2024 10:09 pm, edited 1 time in total.
lk19
Incrediball
Posts: 72
Joined: Thu Feb 11, 2021 8:52 pm
Tings: 360

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by lk19 »

Here's a new version of my Widescreen Patch (fixes only aspect ratio and FOV, no HUD fix, no 32 bit color depth fix).

The aspect ratio is now hard-coded into the EXE and it should work completely independent of the game's internal resolution (i.e. the resolution set with GXSetup.exe or inside ubi.ini). For now, I recommend that you set the internal resolution to 1024x768 using GXSetup.exe (or directly in ubi.ini) for both Direct3D or Glide. The actual resolution (e.g. 1920x1080) can be set with your favorite Direct3D/Glide Wrapper (e.g. dgVoodoo, DDrawCompat, nGlide) ;) Please see the comments below regarding the internal resolution for more details.

The attached EXE is pre-patched for an aspect ratio of 16:9. For other aspect ratios, please follow either (a) or (b):
  1. Run the attached Python script in the same folder as the original, unpatched Rayman2.exe from GOG (do not try to run it on the attached, pre-patched EXE – it won't work). The script will ask you for the desired aspect ratio or resolution.
  2. Open the attached pre-patched EXE in HxD (https://mh-nexus.de/en/hxd/) and navigate to byte offset 9BFFC. In the data inspector on the right hand side, under Single (float32), it should say 1.33333333. Grab a calculator and compute 0.75 * AspectRatio (e.g. for 21:9, you would get 0.75 * 21 / 9 = 1.75). Replace 1.33333333 with this value, press enter and save the file.
Some remarks regarding the game's internal resolution (only for those who are interested in technical details – no need to read if you only want to use the patch):

The game will only accept those resolutions that are available in GXSetup.exe. If you enter a different resolution into ubi.ini, it will automatically revert to 640x480! The resolutions that are available depend on your setup and the chosen graphics mode:
  • In Direct3D mode, only native resolutions (i.e. the ones supported by your monitor) are available.
  • In Glide mode, the available resolutions are also restricted by the existing "Glide modes". These are defined by the Glide API and include, e.g. 8:5, 4:3 and 5:4 aspect ratio, but no widescreen resolutions at all.
As mentioned before, the internal resolution does not really matter, since the scaling is done by the Direct3D/Glide wrapper. However, there are two things to consider:
  1. Setting the internal resolution very low will reduce the quality of the background images. So if you set the resolution to 320x200, the loading screen will look quite pixelated!
  2. Setting the internal resolution very high (e.g. 3840x2160) will make the game crash due to memory issues (from my work on the Playmobil games I have a feeling that these might be fixable – but I don't see the need for this).
For these reasons, I recommend setting the internal resolution to 1024x768, because it is available in both Direct3D and Glide mode and setting it to any higher value does not seem to have a beneficial effect on the image quality of the loading screen graphics ;)
Attachments
Rayman2_Widescreen_V2.7z
(289.13 KiB) Downloaded 92 times
RibShark
Ninja Teensy
Posts: 1661
Joined: Wed Aug 14, 2013 8:03 pm
Contact:
Tings: 3292

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by RibShark »

Nice job! I was actually hooking the same function for my upcoming Tonic Trouble fix, with the exact same method to calculate the FOV, so it's nice to know that I was doing everything properly!

I decided to make a fork of Spitfire's Ray2Fix to apply this fix automatically (and without EXE edits): https://github.com/RibShark/Ray2Fix/releases/tag/aspect, just install and configure and it should work fine!

EDIT: this does bug out some 2D elements, will try to fix later
JohnnyGui
Blue Lum
Posts: 23
Joined: Sun Feb 07, 2016 8:12 pm
Tings: 115

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by JohnnyGui »

lk19 wrote: Wed Jul 24, 2024 10:08 pm Here's a new version of my Widescreen Patch (fixes only aspect ratio and FOV, no HUD fix, no 32 bit color depth fix).

The aspect ratio is now hard-coded into the EXE and it should work completely independent of the game's internal resolution (i.e. the resolution set with GXSetup.exe or inside ubi.ini). For now, I recommend that you set the internal resolution to 1024x768 using GXSetup.exe (or directly in ubi.ini) for both Direct3D or Glide. The actual resolution (e.g. 1920x1080) can be set with your favorite Direct3D/Glide Wrapper (e.g. dgVoodoo, DDrawCompat, nGlide) ;) Please see the comments below regarding the internal resolution for more details.

The attached EXE is pre-patched for an aspect ratio of 16:9. For other aspect ratios, please follow either (a) or (b):
  1. Run the attached Python script in the same folder as the original, unpatched Rayman2.exe from GOG (do not try to run it on the attached, pre-patched EXE – it won't work). The script will ask you for the desired aspect ratio or resolution.
  2. Open the attached pre-patched EXE in HxD (https://mh-nexus.de/en/hxd/) and navigate to byte offset 9BFFC. In the data inspector on the right hand side, under Single (float32), it should say 1.33333333. Grab a calculator and compute 0.75 * AspectRatio (e.g. for 21:9, you would get 0.75 * 21 / 9 = 1.75). Replace 1.33333333 with this value, press enter and save the file.
Some remarks regarding the game's internal resolution (only for those who are interested in technical details – no need to read if you only want to use the patch):

The game will only accept those resolutions that are available in GXSetup.exe. If you enter a different resolution into ubi.ini, it will automatically revert to 640x480! The resolutions that are available depend on your setup and the chosen graphics mode:
  • In Direct3D mode, only native resolutions (i.e. the ones supported by your monitor) are available.
  • In Glide mode, the available resolutions are also restricted by the existing "Glide modes". These are defined by the Glide API and include, e.g. 8:5, 4:3 and 5:4 aspect ratio, but no widescreen resolutions at all.
As mentioned before, the internal resolution does not really matter, since the scaling is done by the Direct3D/Glide wrapper. However, there are two things to consider:
  1. Setting the internal resolution very low will reduce the quality of the background images. So if you set the resolution to 320x200, the loading screen will look quite pixelated!
  2. Setting the internal resolution very high (e.g. 3840x2160) will make the game crash due to memory issues (from my work on the Playmobil games I have a feeling that these might be fixable – but I don't see the need for this).
For these reasons, I recommend setting the internal resolution to 1024x768, because it is available in both Direct3D and Glide mode and setting it to any higher value does not seem to have a beneficial effect on the image quality of the loading screen graphics ;)
This is great! Is there any chance to also implement the HUD fix and 32 color depth fix along with it?
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by deton24 »

They say that dgVoodoo with one of the modes (D3D or Glide) already uses 32-bit internally. Maybe it was D3D.
JohnnyGui
Blue Lum
Posts: 23
Joined: Sun Feb 07, 2016 8:12 pm
Tings: 115

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by JohnnyGui »

deton24 wrote: Fri Dec 06, 2024 10:15 am They say that dgVoodoo with one of the modes (D3D or Glide) already uses 32-bit internally. Maybe it was D3D.
Oh, should this be shown as x32 in the ubi.ini file in that case?

Also, is there a standalone HUD fix since it's not implemented in Ik19's widescreen patch?
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by deton24 »

No, it was independent of ubi.ini.

You can simply take textures.cnt from one of the earlier widescreen patch updates in the first post, but you'd need to repack the archive if you use Granville's HD tex mod.
But IG, the function for proper resizing the HUD was documented somewhere already. If not directly for R2, then for some other CPA game, maybe in other thread.
JohnnyGui
Blue Lum
Posts: 23
Joined: Sun Feb 07, 2016 8:12 pm
Tings: 115

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by JohnnyGui »

deton24 wrote: Fri Dec 06, 2024 11:30 pm No, it was independent of ubi.ini.

You can simply take textures.cnt from one of the earlier widescreen patch updates in the first post, but you'd need to repack the archive if you use Granville's HD tex mod.
But IG, the function for proper resizing the HUD was documented somewhere already. If not directly for R2, then for some other CPA game, maybe in other thread.
So with lk19's patch, I don't need the file Vignette.cnt nor the World folder files provided by Garo for any other fixes? Only Textures.cnt?
RayCarrot
Carmen
Posts: 2476
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 40322

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by RayCarrot »

I'm not sure if it was posted here, but the latest version of Ray2Fix has a proper widescreen patch in it now that fixes pretty much all issues.
deton24
Art Rytus
Posts: 1194
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8932

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by deton24 »

Not sure about World folder files, but Vignette.cnt contains only loading screens, and I can't remember if anybody fixed the issue that you cannot change at least their resolution, otherwise the game will crash.
Textures.cnt contains HUD icons, but someone already found a way to resize them in the binary so stretching HUD files for every aspect would be not necessary (just in the binary or other files).
And yeah, some of the newer fixes (IG at least objects disappearing on the edges) is fixed in Ray2Fix.
JohnnyGui
Blue Lum
Posts: 23
Joined: Sun Feb 07, 2016 8:12 pm
Tings: 115

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by JohnnyGui »

deton24 wrote: Sat Dec 07, 2024 2:11 pm Not sure about World folder files, but Vignette.cnt contains only loading screens, and I can't remember if anybody fixed the issue that you cannot change at least their resolution, otherwise the game will crash.
Textures.cnt contains HUD icons, but someone already found a way to resize them in the binary so stretching HUD files for every aspect would be not necessary (just in the binary or other files).
And yeah, some of the newer fixes (IG at least objects disappearing on the edges) is fixed in Ray2Fix.
Thanks for the info. So I have 3 remaining questions.

1. Ray2fix already has the 32 bit + HUD fix right?

2. And how about he mentioned issue by Garo:
"When you hop inside the chair in top of the world, the FOV is actually zoomed in, like every second it's a different FOV value"

Is that also fixed in Ray2Fix since it implements Ik19's new patch method?

3. Is the remaining issue with the 2D elements (mentioned by Ribshark) present in all available patches?
lk19
Incrediball
Posts: 72
Joined: Thu Feb 11, 2021 8:52 pm
Tings: 360

Re: Rayman 2 PC Widescreen Patch (16:9, 16:10, 21:9, 32:9, ..) | PC 32 bit depth fix | + widescreen for DC, PSX, PS2

Post by lk19 »

JohnnyGui wrote: Thu Dec 12, 2024 6:54 pm Thanks for the info. So I have 3 remaining questions.

1. Ray2fix already has the 32 bit + HUD fix right?

2. And how about he mentioned issue by Garo:
"When you hop inside the chair in top of the world, the FOV is actually zoomed in, like every second it's a different FOV value"

Is that also fixed in Ray2Fix since it implements Ik19's new patch method?

3. Is the remaining issue with the 2D elements (mentioned by Ribshark) present in all available patches?
Not sure about all your points, but Ray2Fix implements both my FOV fix (patches every FOV in the game, including the one in top of th world) and the un-stretched HUD elements. It's probably the best way to play the game right now ;)
Post Reply