Ridge Racer Type 4 reverse engineering help needed

GuillermoTell15

Member
OP
Newcomer
Joined
Jan 26, 2018
Messages
8
Trophies
0
Age
29
XP
66
Country
Spain
Hi guys, I've trying to get into this game's filesystem but, unfortunately, looks like it does not use any common folder structure. Right now I'm stuck. Looks like the files are just attached somehow leaving some blank spaces sometimes (file offset somewhere?). No filenames. No compression for now.

By far, I think I've already located all cars except for the Pacman one. However, I've no idea of how they work internally, just managed to get some point clouds, no textures, no polygons. It uses the TIM format but only for the scenery, no idea how cars' textures work.

Also, with some work I think it may be possible to get the tracks, as I found some point clouds which ressemble them.

If someone is interested and has some knowledge about PSOne reverse engineering just comment below so we can continue working together. If no one is interested I'll just drop it.
 
Last edited by GuillermoTell15,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
There are some PS1 games that use raw sector reads/LBA addresses to grab data. I had not heard of Ridge Racer using it (usually get it for music for Square (Enix) games) but I suppose I am not that plugged into the PS1 ROM hacking scene.
 

GuillermoTell15

Member
OP
Newcomer
Joined
Jan 26, 2018
Messages
8
Trophies
0
Age
29
XP
66
Country
Spain
Ok, this is what I got:
The CD-ROM contains the following files:

Captura de pantalla 2020-10-16 132807.png


From what I found, the game assets are located in R4.BIN. Inside it there are car vertices, scenery TIM textures, track vertices, etc.

The file follows the following structure (after sector info cleaning):

Captura de pantalla 2020-10-16 133514.png


There is a header marked in red, it may stand for the file count. Then, there are a bunch of 4 byte sets marked in yellow. They look like addresses, as the value always increases. I was unable to understand their meaning. It looks like the filesystem starts at 0x1000.

On the other hand, the car sections look like this (I used Promessa as an example):

Captura de pantalla 2020-10-16 134123.png


The file starts with what looks like a fixed header of value 05 00 00 00 18 00 00 00 30 02 00 00 40 02 00 00, under the yellow bar. Marked in red there is the car name. By far I've found 640 coincidences, but there are 321 cars in the game so, 2 instances per car? and the Pacman car is missing. The file size doesn't look like is fixed. The textures may be inside, but they are not TIM for sure.

If someone is interested, I can continue explaining what I found about the cars' vertices. I'm not sure about sharing the game's files as it may go against the forum rules, more info would be appreciated.

Thanks.
 
Last edited by GuillermoTell15,

GuillermoTell15

Member
OP
Newcomer
Joined
Jan 26, 2018
Messages
8
Trophies
0
Age
29
XP
66
Country
Spain
Ok, if someone wants to have a look inside a car file sample, here you have one. It's a raw binary rip from the game files.

I hope someone with more experience in game files than me can understand how the info is stored. The geometry's there, not sure about the textures, in case they're there, they aren't in TIM format.

Interesting things I found:
-The vertices start at 0x236C with a padding of 2, short signed, little endian. Looks like this case has 290 vertices.
-At 0x34E0 there are more vertices. These look like the lights. 32 of them? As above, padding 2, short signed and little endian.

Here is how they look in hex:

Captura de pantalla 2020-10-17 171327.png


And rendered:

Captura de pantalla 2020-10-17 171443.png


The car in game:

latest


Thanks.
 

Attachments

  • Promessa.zip
    15.7 KB · Views: 223
Last edited by GuillermoTell15,

GuillermoTell15

Member
OP
Newcomer
Joined
Jan 26, 2018
Messages
8
Trophies
0
Age
29
XP
66
Country
Spain
Good news!
Thanks to the Nana tool I was able to get a lot of info.

First of all, I was right, the texture is inside the car file. No compression! :yay: Here you can see it:

Captura de pantalla 2020-10-18 030011.png


It's 256 bytes wide and 4 bpp, as you can see in the screenshot.

Also, I had a look inside the main file, R4.BIN, and found the lost Pacman car. For some reason, it's named Promessa in the game's files so, I had it located, but it wasn't properly identified.

What's left is:
-Locate CLUTs (no idea how these work!).
-Texture extraction (in progress).
-Locate faces.
-Locate texture mapping.
-Rebuild the whole 3D model.
-Something else I missed? :unsure:

If someone has experience in any of these fields and wants to help, I'd be very pleased.

Thanks!
 
Last edited by GuillermoTell15,

aybe

New Member
Newbie
Joined
Dec 9, 2020
Messages
1
Trophies
0
Age
42
XP
34
Country
France
hey man, still there ?

this will read the fat and extract the blobs in r4.bin, there are 934 of them:

Code:
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            const string path = @"C:\Temp\R4.BIN";

            using var reader = new BinaryReader(File.OpenRead(path));

            reader.BaseStream.Position = 0;

            var count = reader.ReadInt32();

            var positions = new int[count + 1];

            for (var i = 0; i < positions.Length; i++)
            {
                positions[i] = reader.ReadInt32() * 2048;
            }

            for (var i = 0; i < positions.Length - 1; i++)
            {
                var position1 = positions[i];
                var position2 = positions[i + 1];
                var length = position2 - position1;

                reader.BaseStream.Position = position1;

                var bytes = reader.ReadBytes(length);

                File.WriteAllBytes($"{path}.{i:D5}", bytes);
            }
        }
    }
}

from what i've seen, a car is like this: 3d data, sounds, textures (blob 23 for instance)

use tim2view to detect where tim files are in a file

etc, etc, etc good luck,

:)
 
Last edited by aybe,

Silent_Gunner

Crazy Cool Cyclops
Banned
Joined
Feb 16, 2017
Messages
2,696
Trophies
0
Age
29
XP
4,727
Country
United States
Hey, if you want to get into PS1 hacking, might I suggest contacting someone in the scene?

There's this guy in particular. He's doing a lot of Resident Evil stuff nowadays (including working on a restoration of Resident Evil 1.5 started by Team IGAS...at least, I think he's still working on it), but he's also done translation work for the PS1 version of Persona 2 Innocent Sin, Mizzurna Falls, and others! :)

https://mobile.twitter.com/REBehindtheMask
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • S @ salazarcosplay:
    @BakerMan what systems do you have
  • S @ salazarcosplay:
    what are your favorite games
  • S @ salazarcosplay:
    what are you currently playing?
  • Mondooooo @ Mondooooo:
    Just started God of War 2 on the PS2
  • Mondooooo @ Mondooooo:
    why we saying hello again for?
  • Xdqwerty @ Xdqwerty:
    @Mondooooo, cuz you both werent here
    +1
  • Mondooooo @ Mondooooo:
    oh btw, did you know that the teenage mutant ninja turtles is having an r rated live action movie?
  • S @ salazarcosplay:
    I did not know that
  • S @ salazarcosplay:
    but it would make sense
  • Mondooooo @ Mondooooo:
    just look it up
  • S @ salazarcosplay:
    from the perspective that the original audience that saw it as kids are now grown adults
  • Xdqwerty @ Xdqwerty:
    I heard the original comic books were as dark as that
  • Mondooooo @ Mondooooo:
    it's called the last ronin
  • Mondooooo @ Mondooooo:
    while that was a kid-friendly endeavor, this new take will adapt the story Teenage Mutant Ninja Turtles: The Last Ronin. The outlet notes that this new iteration is being written by “Tyler Burton Smith, who co-wrote the upcoming R-rated action movie Boy Kills World and who wrote the 2019 iteration of Chucky horror franchise Child’s Play.”
  • Mondooooo @ Mondooooo:
    The film, titled ‘The Last Ronin,’ will be targeted at adults and promises a high-body count tale
  • Xdqwerty @ Xdqwerty:
    I grew up with the 2012 show
  • Mondooooo @ Mondooooo:
    so yeah, they're will be lots of kills
  • S @ salazarcosplay:
    so kinda like how they went r rated in the Loan movie for wolverine
  • Mondooooo @ Mondooooo:
    and remember that time when someone had the idea to make scooby doo r rated?
  • Mondooooo @ Mondooooo:
    where shaggy is a stoner and a pothead?
  • Mondooooo @ Mondooooo:
    that's a true story
  • Xdqwerty @ Xdqwerty:
    @Mondooooo, the first scooby doo live action film?
    Xdqwerty @ Xdqwerty: @Mondooooo, the first scooby doo live action film?