Rayman 3

For discussions about the Rayman series.
Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
Eshap
Barbara
Posts: 606
Joined: Wed Jul 07, 2010 12:19 pm
Tings: 10182

Re: Rayman 3

Post by Eshap »

what is going on it's 1:30 and my head hurts
what is all this ambiguous pie
Rayfist
Edith Up
Posts: 12553
Joined: Wed Jul 07, 2010 8:36 pm
Location: Right here, right now!
Tings: 176605

Re: Rayman 3

Post by Rayfist »

Eshap wrote:what is going on it's 1:30 and my head hurts
what is all this ambiguous pie
Go to sleep Eshap :mryellow:
Robotic Teensie
Goth Teensy
Posts: 407
Joined: Thu Aug 23, 2012 12:43 pm
Location: Unknown
Tings: 3130

Re: Rayman 3

Post by Robotic Teensie »

Progress update: the 2D Madness map is, in terms of distance covered, about 40% done I think. The latter parts mainly consist of clouds instead of jungle lands, which will be so much easier to reconstruct. However there's still one big stretch of jungle terrain to be done. I will also have to find a way to deal with prickly fruit swings and the water at the bottom of the map. Finally I found and corrected three mapping errors - correcting them takes extra time, so I hope I won't find any more mistakes...

I just started up Cheat Engine and I was shocked when I saw this:

Image

However a quick Google search told me that it's an April Fools joke :) the program is free and open source.

Anyway last night I realised something incredible I may be able to pull off with Cheat Engine... I don't want to reveal what it is just yet (I'm going to test now to see whether it will work), but it will be amazing if I'm able to do it.
Rulez
Knaaren
Posts: 14881
Joined: Wed Jul 04, 2007 4:38 pm
Location: Poland
Contact:
Tings: 5745

Re: Rayman 3

Post by Rulez »

AHAH holy shit April Fools.
Robotic Teensie
Goth Teensy
Posts: 407
Joined: Thu Aug 23, 2012 12:43 pm
Location: Unknown
Tings: 3130

Re: Rayman 3

Post by Robotic Teensie »

OMG my hack is STARTING TO WORK... I need to investigate further!!!

(by the way, this "incredible hack" I am talking about is not an April Fools joke...)

EDIT: Hmm I spoke too soon... I'm on the right track I think... but Rayman 3 keeps crashing when I modify stuff.
Adsolution
Holly Luya
Posts: 22233
Joined: Sat Aug 22, 2009 4:55 pm
Contact:
Tings: 110541

Re: Rayman 3

Post by Adsolution »

Eshap wrote:ambiguous pie
Delish.
Master
Rayman 1
Posts: 53542
Joined: Sun Aug 21, 2011 10:14 am
Location: Somewhere specific, I'd assume.
Tings: 468310

Re: Rayman 3

Post by Master »

This is sounding interesting, do keep us posted Robotic Teensie.
Robotic Teensie
Goth Teensy
Posts: 407
Joined: Thu Aug 23, 2012 12:43 pm
Location: Unknown
Tings: 3130

Re: Rayman 3

Post by Robotic Teensie »

Meh... it doesn't work. I wanted to find the value that holds the current map. I hoped to be able to change that to load whatever map I wanted. If it had worked I would have been able to start any part of any level I wanted. The level selection system in R3 is crappy - you can only start at the beginning of a world, not somewhere in the middle. With this hack I hoped to take control of the loading process.

But it doesn't work... there are hundreds of thousands of values that change based on the map, making it very difficult to locate the one value I need. I made some assumptions (the value will be static and always lower than 1,000,000) and managed to isolate about 10 values, but modifying them either crashed the game or had no effect at all. The closest I got was when I modified a certain value and the game kept working until I went Game Over, triggering a level reload - but then it crashed again. This is not some trivial piece of information I'm trying to change (like what powerup Rayman has) - knowing what map is currently active is vital for the inner workings of the game. I think in order to successfully change the map being loaded a combination of values all have to be changed at the right time - else the game will crash.
darkkitty
Green Teensy
Posts: 638
Joined: Thu Nov 15, 2012 11:32 pm
Location: ny state hateing the place
Tings: 1338

Re: Rayman 3

Post by darkkitty »

if you have seen this post you will know my name chashey - lee pease ( my first name has a dash in the middle ) insted of a prank heres a gift :D
Adsolution
Holly Luya
Posts: 22233
Joined: Sat Aug 22, 2009 4:55 pm
Contact:
Tings: 110541

Re: Rayman 3

Post by Adsolution »

Did you enjoy your Easter-egg hunt on this very day three years ago?
Robotic Teensie
Goth Teensy
Posts: 407
Joined: Thu Aug 23, 2012 12:43 pm
Location: Unknown
Tings: 3130

Re: Rayman 3

Post by Robotic Teensie »

Remember when I posted in this thread I had decompiled Rayman 2? I now have a better decompiler. It doesn't leave asm inside the code. I also decompiled the Rayman Designer Mapper, Rayman 3 and Rayman Origins with it :)

The compiler also has an option to decompile DOS programs, but I've had no luck so far with Rayman 1...

Origins apparently has a debugging file (.pdb) linked to it... too bad it isn't available... that would make the code so much more readable.
Raymanni
Carnivora (good)
Posts: 1083
Joined: Wed Apr 03, 2013 5:11 pm
Tings: 12870

Re: Rayman 3

Post by Raymanni »

Robotic Teensie wrote:Remember when I posted in this thread I had decompiled Rayman 2? I now have a better decompiler. It doesn't leave asm inside the code. I also decompiled the Rayman Designer Mapper, Rayman 3 and Rayman Origins with it :)

The compiler also has an option to decompile DOS programs, but I've had no luck so far with Rayman 1...

Origins apparently has a debugging file (.pdb) linked to it... too bad it isn't available... that would make the code so much more readable.
This may be a derp question, but Im still going to ask it:

What does it actually mean that you decompiled these games, and what good does it have? I mean, are you going to rip some sprites/textures? Also, what program you used to decompile them?
Master
Rayman 1
Posts: 53542
Joined: Sun Aug 21, 2011 10:14 am
Location: Somewhere specific, I'd assume.
Tings: 468310

Re: Rayman 3

Post by Master »

I'm no expert, but I'd assume by decompiling we can understand the game better, and perhaps even reverse engineer it for modding.
Snagglebee
Teen Punk
Posts: 11795
Joined: Tue Jan 08, 2013 6:22 pm
Location: Yes
Tings: 2770

Re: Rayman 3

Post by Snagglebee »

Robotic Teensie wrote:Remember when I posted in this thread I had decompiled Rayman 2? I now have a better decompiler. It doesn't leave asm inside the code. I also decompiled the Rayman Designer Mapper [..] with it :)
How about to host a FTP Server where users can Up-/Download Rayman Designer Map files ( I can do that :) ) and then recompile the Mapper. Instead of connecting via Modem to UBISofts Server the Mapper should connect via direkt LAN to our FTP-Server? *Just a though*
Haruka
Ly
Posts: 26768
Joined: Sun Aug 10, 2008 9:19 pm
Contact:
Tings: 200215

Re: Rayman 3

Post by Haruka »

It would be nice modding that in order to have a server for RPC members to upload their RD levels...
Raymanni
Carnivora (good)
Posts: 1083
Joined: Wed Apr 03, 2013 5:11 pm
Tings: 12870

Re: Rayman 3

Post by Raymanni »

I think it would be fantastic idea.
Robotic Teensie
Goth Teensy
Posts: 407
Joined: Thu Aug 23, 2012 12:43 pm
Location: Unknown
Tings: 3130

Re: Rayman 3

Post by Robotic Teensie »

The programs on your computer look like this:

Code: Select all

00 00 8b ce e8 26 1a 02 00 6a 00 e8 70 11 00 00 83 c4 04 e8 98 13 00 00 33 c0 8a 88 c0 10 43 00 88 88 08 0d 45 00 40 84 c9 75 ef c7 05 38 a6 43 00 00 00 00 00 e8 a6 1b 00 00 6a 00 8d 4c 24 08 e8 1b 01 00 00 8d 44 24 04 8d 4c 24 04 c7 84 24 a8 00 00 00 00 00 00 00 89 46 1c e8 03 ac 01 00 8d 4c 24 60 c7 84 24 a8 00 00 00 01 00 00 00 e8 8f 11 02 00 8d 4c 24 04 c7 84 24 a8 00 00 00 ff
Now that's not very helpful if you want to understand how the program works... can you guess what program that big bunch of numbers was taken from?
No? Then take a look at this...

Code: Select all

else
  {
    MessageBoxA(
      0,
      "Please check your DirectX version. At least version 8.1 is required.",
      "Rayman 3 Setup Error",
      0x10u);
  }
  return 0;
}
Can you guess it now? It's Rayman 3's graphics setup (R3_Setup_DX8.exe). What I did there was put the program into a decompiler, which decompiled it. It translated all those numbers into readable code.

The problem is... decompiling a program is incredibly complicated. The code the decompiler makes is not 100% perfect. It's often not even valid code. Many errors and inaccuracies pop up. A lot of information was also lost in our versions of Rayman games - only Ubisoft has the original code. Most of the decompiled code is really incomprehensible, such as:

Code: Select all

    CWinApp::Enable3dControlsStatic(v1);
    sub_402290(0);
    sub_4024C0();
    v2 = 0;
    do
    {
      v3 = byte_4310C0[v2];
      *(&FileName + v2++) = v3;
    }
    while ( v3 );
    dword_43A638 = 0;
    sub_402CF0();
    sub_401270(0);
In order to make the code more understandable one must manually add lots of data to help the decompiler. I'll quote Wikipedia:
(...) the nature of disassembly precludes total accuracy, and a great deal of human intervention is necessarily required (...) (the) user will begin with an automatically generated disassembly listing and then convert sections from code to data and vice versa, rename, annotate, and otherwise add information to the listing, until it becomes clear what it does.
So the automatically generated code we got is impossible to understand. It really doesn't have any practical use... it would require weeks or months of analysing by someone who has the necessary expertise (and I don't have that) to make sense of it all.
Shrooblord
Mr Stone
Posts: 15762
Joined: Tue Sep 07, 2010 5:07 pm
Location: The Buccaneer MK. II
Tings: 68850

Re: Rayman 3

Post by Shrooblord »

Well, for one, a while loop would never end in a ; before telling the program what it should be looping. That should be some indication. Strangely enough, the 'do' step with the method in enclosed brackets is before the while loop, which is usually the thing that the while loop should be doing. This makes me think that that excerpt of code you have is the wrong way around! Or at least, the while() do section is in the wrong order.
Snagglebee
Teen Punk
Posts: 11795
Joined: Tue Jan 08, 2013 6:22 pm
Location: Yes
Tings: 2770

Re: Rayman 3

Post by Snagglebee »

What program language is this? Java?
Robotic Teensie
Goth Teensy
Posts: 407
Joined: Thu Aug 23, 2012 12:43 pm
Location: Unknown
Tings: 3130

Re: Rayman 3

Post by Robotic Teensie »

Shrooblord wrote:Well, for one, a while loop would never end in a ; before telling the program what it should be looping. That should be some indication. Strangely enough, the 'do' step with the method in enclosed brackets is before the while loop, which is usually the thing that the while loop should be doing. This makes me think that that excerpt of code you have is the wrong way around! Or at least, the while() do section is in the wrong order.
There are two kinds of while loops - the most common one is while (condition=true) {code to be executed}. But you can also check the condition after the code... {code to be executed} while (condition=true). In the latter case, the loop will always execute at least once. And that's done with a do... while loop.

Code: Select all

do
    {
      v3 = byte_4310C0[v2];
      *(&FileName + v2++) = v3;
    }
    while ( v3 );
Here v3 is modified first, and if the condition is valid, the loop runs again.

http://en.wikipedia.org/wiki/Do_while_loop

The programming language... hm. I'll check it... hang on.

EDIT: The original source code was Microsoft Visual C++ 6.0. However the code I posted - which is what the decompiler spitted out - is some C-like pseudocode (not original, valid C++ code!)
Post Reply