Rayman 2 - Texture Hacking - Tutorial!

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

Moderators: English moderators, Modding and utilities team

Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
ICUP321
Bébé Globox
Posts: 123
Joined: Mon Sep 05, 2016 9:37 pm
Tings: 625

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by ICUP321 »

absynthe1812 wrote:I'm new when it comes to all this so I'm not really sure what I'm doing... but when I used XnView to view the textures, they are all .gf files and no image shows up in the program. Does anyone know what I'm supposed to do?

Edit: Also when I run Convert_all.bat, there is a message under each line saying "'gf2.exe' is not recognized as an internal or external command,
operable program or batch file."
Try running the Convert_all.bat as Administrator.

Also, now that this topic is active, I think I should point out that I made another mod. Dark Rayman from Rayman Arena was requested by OldClassicGamer but no one did it for some reason despite it being easy to make: There are also two more mods I'm working on, one of them is finished but I haven't uploaded game-play of it yet.
Last edited by PluMGMK on Sun Apr 29, 2018 1:18 pm, edited 1 time in total.
Reason: Please don't double-post in such quick succession.
Hakyra
Podocroc
Posts: 59
Joined: Sat May 23, 2015 8:11 pm
Tings: 296

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by Hakyra »

Hello i was trying to do an insanely High Quality Rayman 2 HD texture Project using an AI and i wanted to see how they would look up in-game, everything goes fine, i repack the Textures.cnt without any issue and then after the first loading screen in rayman 2, it crashes everytime.

Do you know if R2 has a max texture size allowed by the engine? or the textures have to be in 16-Bit format in order for the game to recognize them?
Thanks in advance
-Hakyra
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

In the latest Rayman Control Panel update I've added support for replacing textures in Rayman 2 and for the first time M/Arena and 3! It also has a GUI and option to batch import/export.
Last edited by RayCarrot on Fri Jan 03, 2020 10:17 pm, edited 1 time in total.
PluMGMK
Aline Louïa
Posts: 37010
Joined: Fri Jul 31, 2009 9:00 pm
Location: https://www.youtube.com/watch?v=cErgMJSgpv0
Contact:
Tings: 102745

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by PluMGMK »

Fantastic job! :up: Steo tells me that with a bit of perseverance it's possible to get RCP running under Wine, so I might give it a try…
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

Yep, it's pretty cool that it worked! It was first hard because of the WPF dependencies to DirectX, but he figured out how to solve that with the d3d8 dll. Once the app launched everything seems to work, besides some minor things like the per-level soundtrack utility for Rayman 1 and the splash screen being all black.
deton24
Garatta Ciatik
Posts: 1141
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8652

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by deton24 »

Does it have textures browser and possibility of importing/exporting many textures at the same time?
It might be excellent competition for szymski's tool - CNT Explorer which doesn't support exporting.

@down
Looks freaking cool. Great work.
Last edited by deton24 on Sat Jan 04, 2020 12:20 am, edited 1 time in total.
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

It does! You can view the texture thumbnails, export to multiple formats and import/export entire folders at once.

Image

The code is also modular, so in theory I can support any texture archive file, such as the UbiArt .ipk files.
Steo
Globox
Posts: 33018
Joined: Sun Feb 25, 2018 3:57 pm
Location: Globox Village
Tings: 91547

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by Steo »

Nice work! :up: I posted a short tutorial on how to get it working on Wine in the Rayman Control Panel thread.
Image
FC: 40210 | CF: 103059 | BOM: 94388 | LOTLD: 120486 | DOTK: 110450 | LS: 40810 | SBTC: 99693 | HH: 100028 | TOTL: 100563

TOTAL: 809687
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

With Rayman Control Panel 9.2.0 you can now import high resolution textures into Rayman 2 (and M/Arena/3)! For those of you who want to play the game with upscaled 4K textures, Hakyra is currently working on a mod for that :)

If you instead want to try this out for yourself, here's a guide:

Rayman 2 high resolution textures tutorial

One-time setup
  • Remove the pirate head DRM using the utility in the Rayman Control Panel under the Rayman 2 options
  • In the game configuration in RCP, set the game to use DirectX
  • If using DgVoodoo, set DirectX to use anisotropic 16x scaling and set the resolution to match the game configuration. Set VRAM to 256 or 512.
Replace textures:
  • Go to the Rayman 2 Archive Explorer in RCP and replace the textures, or use a pre-packaged textures.cnt file
  • Use the synchronization utility in RCP to synchronize the game textures (this has to be done every time the textures have their resolution changed)
Common issues:
  • If the game crashes the texture sizes haven't been correctly synchronized, or the textures aspect ratio doesn't match
  • If the game doesn't display any textures at all it's because the available VRAM is set too high, and the game using a signed value thinks you have negative VRAM. Using a wrapper such as DgVoodoo allows the VRAM to be limited.
  • If the game displays your high resolution textures at their original low resolution size it's because you're using nGlide, which has pre-set configurations the game uses to determine the available resources on the computer. Currently only DirectX supports displaying in any resolution.
Let me know if you have any questions :)
Last edited by RayCarrot on Sun Feb 02, 2020 12:55 pm, edited 1 time in total.
deton24
Garatta Ciatik
Posts: 1141
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8652

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by deton24 »

I stopped even thinking I would live to see someone finding fix for these hi-res textures crashes after those years. Honestly - it's incredible. You're making God's work, RayCarrot. And it's also for M/Arena/3!
I'm interested in more details about this texture synchronization feature and how it works. What stays behind the secret.

In case of R2, pity that nGlide is incompatible. I think it had better performance than dgVoodoo, and it was very important while using my Reshade/SweetFX mod.
Maybe later I'll send a message to nGlide support when tex mod will be ready in order to let them know about the issue, and maybe it will be fixed one day.
I'm also curious whether the base of the mod will be Granville's work:
viewtopic.php?f=89&t=27677
Or maybe everything will be done from scratch. That may be much easier in case of file names mismatch. As he wrote later, Granville's used PC textures as a base, though. Anyway, these textures can be a good reference.

I will write in R3 tex mod thread(s), maybe we will find a dare devil to make PC tex mod too. But all those file names will be tough to change from GC to PC version...
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

deton24 wrote: Fri Jan 31, 2020 8:14 pm I stopped even thinking I would live to see someone finding fix for these hi-res textures crashes after those years. Honestly - it's incredible. You're making God's work, RayCarrot. And it's also for M/Arena/3!
Thanks! It wouldn't have been possible without help from Droolie and Robin too :)
deton24 wrote: Fri Jan 31, 2020 8:14 pm I'm interested in more details about this texture synchronization feature and how it works. What stays behind the secret.
The reason the game crashes with high res textures normally is because the texture sizes are also hard-coded in the .sna files for each level (and fix.sna). By decoding the files and finding the texture file names my tool can set the sizes to match those in the textures.cnt file. For Rayman M/Arena and 3 it also matches the mipmap count.
Normally editing the .sna files causes the game DRM to kick in, making the game impossible to play. However Robin found a way to patch it out completely.
deton24 wrote: Fri Jan 31, 2020 8:14 pm In case of R2, pity that nGlide is incompatible. I think it had better performance than dgVoodoo, and it was very important while using my Reshade/SweetFX mod.
DirectX has inconsistent performance, so if we ever find a way for it to work with nGlide that would be preferable. I tried manually increasing certain RAM values for it, but it either glitches out the game completely or just doesn't work.
deton24 wrote: Fri Jan 31, 2020 8:14 pm I will write in R3 tex mod thread(s), maybe we will find a dare devil to make PC tex mod too. But all those file names will be tough to change from GC to PC version...
icup is porting his GC HD texture pack to PC already! :)
deton24
Garatta Ciatik
Posts: 1141
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8652

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by deton24 »

Many thanks to Robin and Droolie for their work!

It would be good to publish Robin's patch in a form of some standalone patch especially if RCP doesn't have that option excluded to use from others. The Adsolution's RayTwol also suffers from this bug on certain levels as I read it in release notes there.

nGlide is only Glide wrapper. It doesn't support any other API. It only reroots/translates calls to DXGI.dll when Glide is used, or to Vulkan when it's chosen in nGlide options.
I didn't notice any performance difference between DX and Vulkan mode on my PC in Rayman 2 (on Vulkan SweetFX injector doesn't work of course).

On the other hand, dgVoodoo can work both with Glide and DX6 (ddraw.dll) API, probably also rerooting to DXGI afterwards. Some time ago DX6 performance was worse there than on DXwrapper (usual FPS drops below 60FPS). DXwrapper proper variant can be found on Rayman 2 PCGamingWiki. On Glide with dgVoodoo I'm not sure, but it shouldn't provide better performance than on nGlide.
Whether dgVoodoo nGlide or DXwrapper DX6 will be faster (if it will be compatible with tex mod), I don't know, at least for now.
DXwrapper was slower than nGlide for sure. Generally it holds 60FPS, but in some cases it drops. And it was only vanilla game.
I barely keep 60 FPS with my mod and nGlide on stock performance of RX 570... Actually it's 57+ so I'd expect severe frame drops on other wrappers.
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

deton24 wrote: Sat Feb 01, 2020 10:09 am It would be good to publish Robin's patch in a form of some standalone patch especially if RCP doesn't have that option excluded to use from others.
Why? The DRM-removal tool is included in RCP, and you anyway need RCP to sync the textures.
PluMGMK
Aline Louïa
Posts: 37010
Joined: Fri Jul 31, 2009 9:00 pm
Location: https://www.youtube.com/watch?v=cErgMJSgpv0
Contact:
Tings: 102745

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by PluMGMK »

So if the pirate head is caused by SNA checksum mismatch, how come people used to get all those false positives on Windows Vista / 7 / etc. until GOG fixed it?
PluMGMK
Aline Louïa
Posts: 37010
Joined: Fri Jul 31, 2009 9:00 pm
Location: https://www.youtube.com/watch?v=cErgMJSgpv0
Contact:
Tings: 102745

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by PluMGMK »

I never got the issue the first time I played on my PC with Windows XP years ago. Then when I played on my Vista PC some years later, I consistently got it near the end of the Echoing Caves. Years later again, playing under Wine, I got it in the wrong temple in the Sanctuary of Stone and Fire. There are videos of it happening in other levels. I know it probably has less to do with the OS version than with specific unknowable variables of the OS / software configuration, but it definitely wasn't one certain level.
RayCarrot
Tily
Posts: 2278
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 36217

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by RayCarrot »

PluMGMK wrote: Sat Feb 01, 2020 12:42 pm So if the pirate head is caused by SNA checksum mismatch, how come people used to get all those false positives on Windows Vista / 7 / etc. until GOG fixed it?
Some retail releases had the wrong checksum in certain levels. It was fixed in later releases I believe. The GOG version uses the correct ones.
deton24
Garatta Ciatik
Posts: 1141
Joined: Fri Jan 14, 2011 1:22 am
Location: Poland
Tings: 8652

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by deton24 »

I think it's exactly what could happen in e.g. Polish release, possibly in the Sanctuary of Stone and Fire, but in guardian section (it could be also at the end of The Echoing Caves as other source says). It was MULTI2 version containing Polish and French, and they probably weren't aware of this SNA checksum mismatch after editing language files. It wasn't UBI, but external company working on this, Licomp Empik.
Don't know about any other different releases which could have the same issue.
Last edited by deton24 on Sat Feb 01, 2020 6:54 pm, edited 1 time in total.
PluMGMK
Aline Louïa
Posts: 37010
Joined: Fri Jul 31, 2009 9:00 pm
Location: https://www.youtube.com/watch?v=cErgMJSgpv0
Contact:
Tings: 102745

Re: Rayman 2 - Texture Hacking - Tutorial!

Post by PluMGMK »

Huh. Then I wonder why I got the error in different places depending on what PC I was on.
Post Reply