2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

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

Moderators: English moderators, Modding and utilities team

Post Reply
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

Hello RaymanPC! I've made a few EXE-patchers for 2D PC Rayman games to fix/augment their functionality in various ways. They are written in Rust and their source code is published on GitHub. They should be simple enough to use: simply drag the EXE for the game in question onto the patcher, and it will patch it and create a backup file automatically.

:arrow: Patcher for the GOG version of Rayman 1 (RAYMAN.EXE) to make it honour the language setting (instead of forcing English): Windows binary downloadSource code
:arrow: Patcher for Rayman Designer (RAYKIT.EXE) to enable colouring and frame-freezing of letters, numbers and artworks from the Educational games, and associated Events Editor functionality (to be used in conjunction with Ray1Map's ETA/DES transfer feature): Windows binary downloadSource code
:arrow: Patcher for Rayman Designer (RAYKIT.EXE) to enable the use of red insta-killing moving/swinging pricklies and bouncy platforms: Windows binary downloadSource code

Original post below:
Hey all, PluM here with another Rayman 1 hack! This time, it's a small tool to make the version of Rayman 1 from GOG honour the user-chosen language setting instead of forcing it to English.

If you're on Windows (either 32- or 64-bit), you can just download the tool, put it in the same folder as RAYMAN.EXE and then drag the latter file onto it. You can also invoke it from the command line, if you prefer.

If you're nervous about downloading an EXE, you can take a look at the source code (in Rust) and see that it doesn't do anything sketchy.

Now, if you have the GOG version of Rayman Forever, you can use Rayman Control Panel to set the language to "French" or "German", and it won't magically reset itself to "English" when you run the game! I'm not actually sure how many people have access to only this version, and need to play in another language, but here it is just in case!

Thanks to RayCarrot for helping me get my bearings with disassembling and patching Rayman 1 and related EXEs, and understanding how the game does things in general!
RayCarrot
Uglette
Posts: 2153
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 29229

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by RayCarrot »

Really nice work! :D I've always found it odd how they made several single-langage releases of the PC version, but still retained the full translation for all languages (the GOG version even has Japanese and Chinese, but the font sprites are missing so they can't be used). I guess they did it as a fail-safe in case the installer didn't correctly set the language in the config (which brings up another question: why didn't they just allow the language to be changed after installation :P).
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by PluMGMK »

Thanks! I didn't actually realize that about the Japanese and Chinese – there's no way to hack in the sprites, is there? It's very weird that they didn't make language adjustable after installation all right, when they did have SETSOUND to handle most of the configuration. I guess someone didn't realize until too late that it would be a good idea, and they were so busy moving onto EDU and KIT that they didn't bother making any major changes to the tools – just a few language-hardcodes here and there! :hap: It would've been nice if they'd at least shipped an unlocked version on GOG, but at least this tool now takes care of that!
Steo
Globox
Posts: 31148
Joined: Sun Feb 25, 2018 3:57 pm
Location: Globox Village
Tings: 125570

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by Steo »

Oh, nice work Plum! I'll try this out soon if it works on Linux. :hap:
Image
FC: 40210 | CF: 103059 | BOM: 94388 | LOTLD: 120486 | DOTK: 110450 | LS: 40810 | SBTC: 99693 | HH: 100028 | TOTL: 100563

TOTAL: 809687
RayCarrot
Uglette
Posts: 2153
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 29229

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by RayCarrot »

PluMGMK wrote: Sun Sep 20, 2020 9:55 pm Thanks! I didn't actually realize that about the Japanese and Chinese – there's no way to hack in the sprites, is there?
That would be pretty difficult yeah. They added an extra DES in allfix, which means that they also edited every single level file to increase the DES index by 1 for the events. The DES in allfix also have their pointers hard-coded in the exe I believe (I haven't looked into it too much, but I did try modifying a DES and everything got offset wrong, unlike when you edit the world files).
An interesting thing about the Japanese and Chinese translations is that the text for them uses sprite indexes instead, and then each sprite is one of the sentences in the game.
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by PluMGMK »

Steo wrote: Mon Sep 21, 2020 6:15 am Oh, nice work Plum! I'll try this out soon if it works on Linux. :hap:
It definitely does, as that's the only place I've actually tried it! :hap: I haven't actually tried dragging a file onto it on Windows, but everything I've heard assures me that'll do the trick. :P
I actually did try it in a Windows 98 VM, but it looks like even the MinGW runtime needs a bunch of DLLs that exist only on NT (possibly only since XP). So don't try this on a retro gaming PC! XD
RayCarrot wrote: Mon Sep 21, 2020 7:27 am
PluMGMK wrote: Sun Sep 20, 2020 9:55 pm Thanks! I didn't actually realize that about the Japanese and Chinese – there's no way to hack in the sprites, is there?
That would be pretty difficult yeah. They added an extra DES in allfix, which means that they also edited every single level file to increase the DES index by 1 for the events. The DES in allfix also have their pointers hard-coded in the exe I believe (I haven't looked into it too much, but I did try modifying a DES and everything got offset wrong, unlike when you edit the world files).
Figures! I guess it's probably possible, but it would take such a huge amount of work that it's probably not worth it in the grand scheme of things...
An interesting thing about the Japanese and Chinese translations is that the text for them uses sprite indexes instead, and then each sprite is one of the sentences in the game.
Ah, I see, the text of the translations per se isn't there. That makes sense, since I'd imagine there are far fewer sentences in the game than hanzi/kanji/kana needed to represent them!

UPDATE: So I was a bit too clever by adding those nops. I've just released a new version that doesn't do that, which you should use instead of the old one. I think the old one causes undefined behaviour in the game (i.e. may crash it) by relying on the three upper bytes of the edx register being zero, when there's no guarantee of that.

So if you patched your game with the first version, and it crashes on startup, please try restoring the backup and using the new version.
Steo
Globox
Posts: 31148
Joined: Sun Feb 25, 2018 3:57 pm
Location: Globox Village
Tings: 125570

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by Steo »

I haven't tried it myself yet, but I'll test it out later and let you know!
Image
FC: 40210 | CF: 103059 | BOM: 94388 | LOTLD: 120486 | DOTK: 110450 | LS: 40810 | SBTC: 99693 | HH: 100028 | TOTL: 100563

TOTAL: 809687
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: Patcher for GOG Rayman 1 to make it honour language setting

Post by PluMGMK »

I mean, version 0.1.0 never caused the game to crash for me, but I only tested it a few times, and I don't know if someone else's config could cause something different to appear in the edx register to mine at that particular point in the code…
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

Hey guys, just double-posting to mention that I've made another patcher, this time for Rayman Designer. It enables the use of the full functionality of objects (letters, numbers and artworks) from the Educational games, which can be ported over using Ray1Map. This one probably isn't of use to as many people as the first one, but I'm putting it out there in case anyone's interested. :)
RayCarrot
Uglette
Posts: 2153
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 29229

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by RayCarrot »

Nice! :D As you mentioned in the readme the frame changing code has probably been completely removed. Judging by the string "'right or left arrow' Change frame (size,icon,number or sample)" in the RayKit exe I assume it was originally an option in the editor, but was removed along with the EDU events. There is no value for it in the event data which gets saved from the Events Editor, so it wouldn't be possible to save it anyway. You can see the values in the R1_Mapper_SaveEventInstance class in Ray1Map. You could always convert custom levels to binary files and use them in By his Fans or 60 Levels I suppose, but that removes the simplicity of being able to edit it in-game once it's been compiled to binary (and you'd need to update this tool to work with them too then). Too bad Designer doesn't support multiple compiled levels.
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

Yeah, that's kinda what I figured. Still, if they did use the same tools for making the EDU games, maybe they had a workaround for saving, probably involving the HitPoints field in some way. That would explain why the HitPoints value is the same as the frame index for all the artworks in stock EDU even though the engine ignores it. Then for letters maybe it was something like HitPoints(saved) = 6*Frame + HitPoints...

Sounds like it could be fun to implement, but I'll have to spend a lot more time understanding KIT's UI code. :oops2:

UPDATE (10 days later): I've released version 0.3.0 of the patcher, that does exactly this. Now you can use the Events Editor (provided you update your EVE.MLT files) to place and manipulate EDU objects, and saving and loading works too! :D If you already patched Rayman Designer with version 0.2.0, you need to restore the backup before using version 0.3.0.
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

Another double-post to announce another new patcher. This one again patches RAYKIT.EXE (or at least the version from GOG) to allow the creation of red instant-killing moving/swinging pricklies and bouncy platforms, in addition to the stationary pricklies available in the standard game. Download link is in the first post.

I don't know why I'm spending so much time adding functionality to Rayman Designer when Rayman ReDesigner is apparently coming out next month. :oops2:
Hunchman801
Bad Rayman
Posts: 80243
Joined: Thu Aug 07, 2003 6:50 pm
Location: Paris, France
Contact:
Tings: 578060

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by Hunchman801 »

Well, you might end up adding more features than ReDesigner itself. :fou2:

Anyway, I haven't played Designer in decades but I found the readme very informative. :hap:
Image
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

Hunchman801 wrote: Wed Dec 23, 2020 7:11 pm Well, you might end up adding more features than ReDesigner itself. :fou2:
I've seen that ReDesigner will include moving big pricklies, and coloured pricklies. The former is possible, though I'd have to spend a bit of time thinking about the implementation details. For the latter, I tried what I thought was the obvious solution (extending the code used for letters and numbers), but it didn't work because the DES file for pricklies doesn't have the right palette (I think).
Hunchman801 wrote: Wed Dec 23, 2020 7:11 pm Anyway, I haven't played Designer in decades but I found the readme very informative. :hap:
The one for the most recent patcher, with the stuff about the EVE.MLT?
Hunchman801
Bad Rayman
Posts: 80243
Joined: Thu Aug 07, 2003 6:50 pm
Location: Paris, France
Contact:
Tings: 578060

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by Hunchman801 »

PluMGMK wrote: Thu Dec 24, 2020 12:50 am The one for the most recent patcher, with the stuff about the EVE.MLT?
Yes, that one. Come to think about it, I'm yet to come across a proper beginner's guide for Rayman Designer hacking that explains the inner mechanics from the very start rather than relying on the reader's prior knowledge of various concepts spread across dozens of long-dead websites. :P
Image
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

Indeed, I remember failed effort(s?) to make such a thing back in the day. I think it was because most of the people involved at the time didn't really fully understand it themselves (at least that was the case for me :fou:) and were just throwing stuff at the wall to see what stuck. The more recent efforts that went into Ray1Map are far more coherent and could form the basis for solid instruction – not sure if anyone's undertaking that effort currently though! :P Carrot mentioned to me before the possibility of generating MLT files automatically from within Ray1Map, and I think he's implemented it. Haven't tried it myself though.
RayCarrot
Uglette
Posts: 2153
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 29229

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by RayCarrot »

I think the biggest issue when it comes to modifying the .mlt files is the inconsistency of the way the game handles the values. Although it's always been known what each value is named (based on some handy developer comments in each file) it's harder to understand what they do. A value like HitPoints is usually exactly what it sounds like, but it can also be used as a generic parameter to control things like colors and event behavior.
The commands are also a nice system they made to allow object behavior, such as movements, to be more generalized, but the system is fairly basic and only really used for the first few worlds (even then there are multiple instances where the game code directly references a part of a command, so they're not entirely separate and thus can't be fully modified without sometimes having to modify the exe itself...). Imo I think the R2 prototype handled it in a nicer way, where object movements is usually based off of specific tiles which tell a moving platform to turn in specific directions. That way it's visually clearer how they move in a level.

I did start documenting a bit in the Ray1Map wiki, but I haven't been keeping it up to date with all findings, so it's probably already missing a lot of information.
Hunchman801
Bad Rayman
Posts: 80243
Joined: Thu Aug 07, 2003 6:50 pm
Location: Paris, France
Contact:
Tings: 578060

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by Hunchman801 »

RayCarrot wrote: Thu Dec 24, 2020 10:09 pm I did start documenting a bit in the Ray1Map wiki, but I haven't been keeping it up to date with all findings, so it's probably already missing a lot of information.
A very commendable initiative! While not as accessible as an actual tutorial, a complete encyclopaedic resource is definitely a good start. :up:
Image
PluMGMK
Sandra Misu
Posts: 32852
Joined: Fri Jul 31, 2009 9:00 pm
Location: Jade_enr.exe /B /TX sally_clean.bf
Contact:
Tings: 4050

Re: 2D PC Rayman game EXE patchers (Make GOG Rayman 1 honour language setting, and others)

Post by PluMGMK »

RayCarrot wrote: Thu Dec 24, 2020 10:09 pm Imo I think the R2 prototype handled it in a nicer way, where object movements is usually based off of specific tiles which tell a moving platform to turn in specific directions. That way it's visually clearer how they move in a level.
I guess they were already moving that way with the Joe UFOs in the Cave world. It's a pity they didn't include those in stock Designer (even though we can now add them back in with Ray1Map!).
Hunchman801 wrote: Fri Dec 25, 2020 5:25 pm
RayCarrot wrote: Thu Dec 24, 2020 10:09 pm I did start documenting a bit in the Ray1Map wiki, but I haven't been keeping it up to date with all findings, so it's probably already missing a lot of information.
A very commendable initiative! While not as accessible as an actual tutorial, a complete encyclopaedic resource is definitely a good start. :up:
Indeed, it's a great place to look! :up:
Post Reply