A new update for Ray2Get

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

Moderators: English moderators, Modding and utilities team

Post Reply
Synthesis
Garatta Ciatik
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

A new update for Ray2Get

Post by Synthesis » Sun May 13, 2018 8:44 pm

Ten years later (well... more like, ten years too late, amirite?) I'm back with a major update for Ray2Get.

About a month ago, deton24 suggested me to dig around and try to find a way to improve the game's audio engine. Turns out it didn't work; but in the process, I noticed that some stuff in my old and rusty music-decoding tool needed improvement. And I was like "hell no, there's no way I'm gonna do all that crazy time-consuming stuff for just tiny little details"...

Yet.
After what unexpectedly turned out to be a whole month of delving into technical details and experimenting with the game, I'm releasing this new version which allows you to convert the musics from the game to regular .wav... and back!

This means you can now put your own music into the game!... provided you know how to split your files and what their names should be. Fortunately, I provided a text file which lists all the sequences of .apm files that are played throughout the game at every location (yes, I've spent quite some time replaying the sh** out of Rayman 2 to figure all that out in every bit of the game).

This new version fixes the artifacts I noticed (see my previous post)—actually, you can choose between standard IMA ADPCM (in which the original music files provided with the game were encoded anyway) and a slightly modified version to prevent the artifacts—, and supports more .wav formats (8, 16, 24 and 32-bit integer, mono and stereo, any sample rate).

The code has been rewritten almost from scratch (it started as a custom encoder which I eventually merged with the original ray2get), in Python for convenience (it's cross-platform and doesn't require to recompile after every minor tweak), so you should have a working Python 2.x/3.x environment installed on your machine if you want to use the script.


I've set up a GitHub repository with the code, some documentation including a how-to guide, an .apm format description (gathered from my current knowledge), and the list of all the sequences played during the game, and it's available here:

https://github.com/Synthesis/ray2get


Have fun hacking around.
Now I can retire peacefully.
Last edited by Synthesis on Mon May 14, 2018 7:12 pm, edited 1 time in total.

Fifo
Garatta Ciatik
Posts: 8315
Joined: Thu Sep 19, 2013 7:08 pm
Location: :(){ :|:& };:
Contact:
Tings: 11000

Re: A new update for Ray2Get

Post by Fifo » Sun May 13, 2018 8:50 pm

Nice! What an unexpected update.

PluMGMK
Pizzicatta
Posts: 28566
Joined: Fri Jul 31, 2009 9:00 pm
Location: Tír an "Tuisil Ghinidigh" agus an "Mhodha Choinníollaigh"
Contact:
Tings: 3780

Re: A new update for Ray2Get

Post by PluMGMK » Sun May 13, 2018 10:26 pm

Python 2? Not 3? :tssk:

Kidding, of course! This is great work, I can't wait to try it out! :D

Droolie
Oumbr
Posts: 4966
Joined: Wed Apr 20, 2005 7:31 pm
Tings: 54340

Re: A new update for Ray2Get

Post by Droolie » Sun May 13, 2018 10:47 pm

Very cool! And thank you so much for putting the code and documentation online!
I haven't had the time to look at it yet, but I do have a quick question to see if I understood correctly:

The music files provided with Rayman 2 were encoded with standard IMA ADPCM and the old Ray2Get used standard IMA ADPCM to decode them, so it didn't introduce artifacts. However, the game itself does have artifacts when playing back, because it doesn't implement the algorithm properly -- and you implemented Rayman 2's incorrect version purely so that new files play properly in Rayman 2, but this isn't necessary for any of the old files. Am I correct?

Synthesis
Garatta Ciatik
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

Re: A new update for Ray2Get

Post by Synthesis » Sun May 13, 2018 11:01 pm

PluMGMK wrote:Python 2? Not 3? :tssk:
Yeah, that sucks, I know. I've been nitpicking over tiny details, but the lazy, quick-n-dirty way. :oops:

Synthesis
Garatta Ciatik
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

Re: A new update for Ray2Get

Post by Synthesis » Sun May 13, 2018 11:17 pm

@Droolie: Yes, you're right.

In fact, I noticed this when I was trying to replace the in-game musics with my own, to see if the game could handle 44100Hz audio.
When recording the game's audio, I noticed a DC offset slowly building up on some of my files. I initially thought that it was due to downsampling, but the problem was the same at 22k.
So I dove into the Rayman2 executable and found that tiny difference in the code, which I thought was intended.
But when decoding some of the leftover files (especially "Jail20 bruitages.apm") with the "fixed" version, I noticed the same DC offset. Which made me think that it's actually Rayman 2's DLL that is slightly buggy.

So eventually I chose to implement both and let the user choose the one they want.

Synthesis
Garatta Ciatik
Posts: 47
Joined: Fri Jan 02, 2009 7:48 pm
Location: France
Tings: 10235

Re: A new update for Ray2Get

Post by Synthesis » Mon May 14, 2018 7:16 pm

Alright everyone, small update: I fixed a minor bug or two (incorrect automatic output file name when using the 'ei' option, no .apm format check); and the script should now work with Python 3 as well.

incognito
Ratcognito
Posts: 15619
Joined: Wed Oct 02, 2013 10:34 am
Tings: 15073

Re: A new update for Ray2Get

Post by incognito » Mon May 14, 2018 7:36 pm

Now, on to play Rayman with Marilyn Manson in the background.... :lol:

Greeness
Oiseau Moqueur
Posts: 938
Joined: Tue May 17, 2016 9:39 pm
Contact:
Tings: 16835

Re: A new update for Ray2Get

Post by Greeness » Tue May 15, 2018 3:33 pm

Nice! I think it would be interesting to try and replace some music from the game with tracks from the N64 version, so for example maybe the first phase of the final boss fight could play the N64 version of the final boss theme and then the second phase would use the normal track.
Rare Rayman images Drive folder:
https://drive.google.com/drive/folders/ ... sp=sharing
Feel free to share any rare media that's missing.

The Jonster
Joe
Posts: 24336
Joined: Sat Mar 24, 2018 6:15 am
Tings: 50825

Re: A new update for Ray2Get

Post by The Jonster » Tue May 15, 2018 3:43 pm

Wow, this is great! Well done, Synthesis! I should try doing some experimenting with this sometime! :)
RAYMAN GO PLAY SOMEWHERE ELSE, I’M TRYING TO CONCENTRATE!!!
Image
Steo wrote:
Thu Oct 04, 2018 5:26 pm
^ reminds me of someone who can take a lot of criticism and still refuses to get angry with me. ^ is really friendly with others and < is actually impressed at this stage :)
R4Y_ANC3L wrote:
Sat Sep 01, 2018 1:29 pm
Aaron wrote:
Sat Sep 01, 2018 9:58 am
Oh yeah and happy birthday to Jonster :teuf:
Well, today isn't technically Jonster's birthday. You are wishing his Ting account a "Happy Birthday". :oops2:

Post Reply