Page 8 of 9

Re: RaceRoom Racing Experience .kluns

Posted: Sat Nov 07, 2020 6:49 pm
by shakotay2
Zangano wrote: Fri Nov 06, 2020 10:58 pm I couldn't keep my hands off it and had to try it out directly tonight.
well, keep up that spirit! 8)
May I ask you if the hood (car_template_9.obj) has missing faces on your side too, shakotay2?
You may - and 'yes', but it doesn't look like "missing faces" to me because the misses are symmetrical/mirrored and too "regular". I guess there should exist further sub meshes that will fill the gaps.
Besides the 3D stuff: Is it possible to extract the textures at all with the current Raceroom version?
The only bms script for RRR Exp textures I have just searches for the DDS signature:
findloc OFFSET binary "\x44\x44\x53\x20"
In car_template.kluns from the Audi there's no findings.

Re: RaceRoom Racing Experience .kluns

Posted: Sat Nov 07, 2020 10:41 pm
by shakotay2
yeah, there's spoiler bytes in the FIs' block, what the heck.
Here's the missing sub mesh I spoke of in the post before:
.
kluns_FIs_spoilerbytes.png
So you have to make two corrections to the FI count here!
From car_template.kluns_17.h2o, FIs start address and (assumed) count:
0xf5c6da 29664

spoiler bytes address -(FIs start address) / 4 = FIs' count
0xF74098 - 0xf5c6da = 24175 FIs, valid count

assumed count - valid count:
29664 - 24175 = 5498, missing FIs

For some unknown reason the assumed FIs count (29664) is 74 too big. (As I wrote, no time to solve this, atm.)
-> second correction of FIs' count: 5498 - 74 = 5424.

Re: RaceRoom Racing Experience .kluns

Posted: Sun Nov 08, 2020 12:01 am
by Zangano
Thanks for your additional information, shakotay2!
I try my best with your new feedback hoping to get something to work.

Re: RaceRoom Racing Experience .kluns

Posted: Sun Nov 08, 2020 2:07 am
by Zangano
Thank you for your help! It worked - without your information I would have been lost.

audi_hood_complete.png

Now I will try to get some of the .obj~ files corrected. Hopefully no mission impossible.

Re: RaceRoom Racing Experience .kluns

Posted: Tue Nov 10, 2020 9:32 pm
by Zangano
shakotay2 wrote: Wed Nov 04, 2020 10:23 am As a simple workaround you could replace the bad vertices by v 0.0 0.0 0.0. You might try out this with a hundred v x y z lines but I assume the underlying problem (change of FVFsize?, whatever) won't be solved by this.
Maybe cause I am an "ultra-n00b" or it's a sudden loss of any talent... I am not able to produce any good mesh. :tard:

By trying your workaround, e.g. car_template_7.obj~ with its car_template.kluns_15.h2o, I get this result:

car_template-kluns_15-h2o_workaround.png

Re: RaceRoom Racing Experience .kluns

Posted: Tue Nov 10, 2020 9:51 pm
by shakotay2
that's weird but if you look at the test.obj, it's not surprising:

Code: Select all

# 0xd73275: verts= 1756
v 0.527344 1.035156 1.232422 
v 0.559082 1.032227 1.224609 
v 0.552246 1.058594 1.142578 
v 0.274902 1.058594 1.283203 
v 0.408691 1.047852 1.262695 
v 0.274902 1.086914 1.200195 
v 0.406494 1.075195 1.179688 
v 0.142334 1.065430 1.293945 
v 0.274902 1.058594 1.283203 
v 0.142334 1.092773 1.210938 
v 0.274902 1.086914 1.200195 
v 0.000031 1.067383 1.297852 
v 0.142334 1.065430 1.293945 
v 0.000031 1.095703 1.214844 
v 0.142334 1.092773 1.210938 
v 0.419434 0.987305 1.437500 
v 0.542480 0.978027 1.407227 
v 0.413818 1.017578 1.350586 
v 0.535645 1.005859 1.321289 
v 0.276855 0.999512 1.458984 
v -1.309570 13048.000000 -0.000095 
v 99.812500 11048.000000 463.750000 
v 14.382813 13640.000000 0.000111 
v 463.250000 12968.000000 -0.001769 
v 0.649414 13640.000000 5372.000000 
v -1.309570 13048.000000 -0.000095 
v 0.265137 12904.000000 1343.000000 
v -1.060547 11200.000000 0.000048 
v -0.001524 9352.000000 1.311523 
v 0.000320 9096.000000 -4348.000000 
v -4340.000000 16200.000000 0.006100 
v 0.265137 12904.000000 1343.000000 
v -1597.000000 11728.000000 0.000762 
v -0.001524 9352.000000 1.311523 
v -42912.000000 20576.000000 20.984375 
v -4340.000000 16200.000000 0.006100 
v -0.003534 14752.000000 7420.000000 
v -1597.000000 11728.000000 0.000762 
v 0.000317 21520.000000 -20.984375 
v -42912.000000 20576.000000 20.984375 
v -0.001513 15712.000000 0.000762 
v -0.003534 14752.000000 7420.000000 
v -0.000065 9912.000000 -69568.000000 
v -671.000000 2070.000000 -0.000095 
v 0.000442 5180.000000 8696.000000 
v 99.812500 11048.000000 463.750000 
v 1.058594 1.283203 1.000000 
v 1.038086 1.386719 1.000000 
v 1.035156 1.382813 1.000000 
v 1.067383 1.297852 1.000000 
v 1.065430 1.293945 1.000000 
v 0.959473 1.514648 1.000000 
v 0.951660 1.485352 1.000000 
v 0.987305 1.437500 1.000000 
v 0.978027 1.407227 1.000000 
v 0.972656 1.538086 1.000000 
v 0.959473 1.514648 1.000000 
...
After 20 vertices everything goes bogus... will require more research.
.
test_20verts.png
Using 0xd73a87 as a new vertex start you get a point cloud of about 1600 "good" vertices but finding the belonging FIs is hard.

Re: RaceRoom Racing Experience .kluns

Posted: Fri Jun 18, 2021 10:35 pm
by portoalto
Hi
As the last post is already 6 months old, I would like to know if the work on the tool is still continuing
in order to facilitate the extraction of models with the new encryption, or if, on the contrary,
this development has ended completely?
I apologize in advance for reviving this old theme and thank you

Re: RaceRoom Racing Experience .kluns

Posted: Fri Jun 18, 2021 11:06 pm
by shakotay2
portoalto wrote: Fri Jun 18, 2021 10:35 pm Hi
As the last post is already 6 months old, I would like to know if the work on the tool is still continuing
in order to facilitate the extraction of models with the new encryption, or if, on the contrary,
this development has ended completely?
Hi.
If you are talking about the Make_obj tool from here:
shakotay2 wrote: Sat Apr 13, 2019 4:49 pm
you can see it's 2 years old, so no, I don't think about touching that again, sry.

(You'll need the special Hex2obj version from here, btw:)
shakotay2 wrote: Sat Jul 13, 2019 12:37 pm
The progress from half a year ago (driven by Zangano) was achieved by corrections of .H2O and .obj~ files, afair.

Plus some fiddling with "spoiler bytes" in the face indices' blocks, see here:
shakotay2 wrote: Sat Nov 07, 2020 10:41 pm
(Maybe not the best solution, but a solution.)

And, well, from this last post:
shakotay2 wrote: Tue Nov 10, 2020 9:51 pm
you may see I'd lost the motivation to fiddle around with some weird sub meshes. And it's just lack of time to dig into this again.
I think > 95% of any model is extracted fine, isn't it?

(Or maybe wait until another Zangano "pops" up. :) )

Re: RaceRoom Racing Experience .kluns

Posted: Sat Jun 19, 2021 7:02 pm
by portoalto
Thanks for the answer.
It's a shame because this game has one of the hardest encryption to decode and is one that has less interest in ripping models
despite having interesting cars.
But your choice is perfectly understandable and real life is above all else.
Thanks for what you and Zangano did.

Re: RaceRoom Racing Experience .kluns

Posted: Tue Jun 29, 2021 7:08 pm
by [SGAN]Jay
zimex25 wrote: Wed May 01, 2019 4:10 pm
shakotay2 wrote: Mon Apr 22, 2019 8:21 pm
zimex25 wrote: Mon Apr 22, 2019 6:47 pm Many object have crazy smooth or broken mesh. I just wait for better version like previous version.
I'm sorry to tell that a better version is very unlikely to be created since I don't have any clue about the unfitting counts in "newer" kluns files.
That's the reason why I created this workaround:
shakotay2 wrote: Sat Apr 13, 2019 4:49 pm
You might try out to reduce the counts in the H2O files created by *-kluns_redux.exe.

Or use *-kluns_raw.exe to avoid broken meshes ("raw" means the created H2O files contain original counts (which may be uncorrect for unknown reasons)).

Or you might upload one of the problematic kluns files.
Porsche 964 Cup, hood: https://imgur.com/rJ151XQ Many objects have issue like this. I hope for better tools for this game [roll] https://mega.nz/#!P1smnISA!Tiq1GFUQx_oR ... DwFR93gZgY
do you still have this 964 model? the link is dead... can you let me have it please?

Re: RaceRoom Racing Experience .kluns

Posted: Fri Oct 29, 2021 10:30 am
by Machinedramon
so after a review of this game i came to some interesting conclusion, maybe not perfect but still could be a help for many...


first of all the problem lies in the script for bms unpacking the .public files, they still use lzma2 but has some extra parameters that introduces a jump on the files that basically if you don't account it for your verts/textures will get totally ducked up. But, here the workaround for that, just go and grab the steam depot that is from 14 march 2017(google a bit and be careful of the tools you use, given r3e is free, i'd use another steam account to download the old depot; for you cannot use the steam console anymore for that). Once you have the old depot, the files will unpack correctly for that version, although there are not special tools that are able to unpack it from the get go I was able to code in python a script for mrp that works more or less good, this is by no means a final script and only works under my control of variables, if anyone is savvy enough of python and thinks they can modify the code to make it work, be welcome. (Just in case, I wont provide unpacked converted files in here.)


tip: there are 2 functions here I use to parse the file before I even can extract the geometry, one is to search for DDS textures and extract them to a "curfolder"; that you will need to change it(works for car_template, cockpit_template and liveries once all unpacked from .public) the second function that is for the positions will print in console the positions of the meshes in the file and generate the geometry based on the API of MRP.-

tip 2: this doesn't work for tracks for tracks have massive sizes, before being able to process tracks there will be need a better split method or using pure python(I think MRP is not suited to work on such big files).

Code: Select all

import mrp
import sys
from nines import *
f = mrp.get_bfile()

flag_array = [0x76 ,0x64 ,0x65 ,0x63 ,0x6C ,0x2F]
dds_array = [0x44 ,0x53 ,0x20]
dds_pos = []
positions = []
meshes = []


f.seek(0,2)
eof = f.tell()



f.seek(0)
def positions_search():
    for i in range(eof):
        try:
            byte_test = f.readByte()
            if byte_test == 0x2f:
                test_array = [f.readByte() for i in range(6)]
                f.seek(-6,1)
                if test_array == flag_array:
                    positions.append(f.tell()-1)
                    
        except:
            pass #end of file
            
    print(positions)
#------------------
#car silvia
#positions = [1054460, 1141186, 1182168, 1206030, 1241211, 2814624, 3583656, 3907010, 4327617, 4491844, 4536153, 4541726, 4560902, 4599182, 4599864, 4615904, 4729584, 4797377, 4815129, 4832881, 4850633, 4850950, 4853883, 4854130, 4858982, 4864270, 4867707, 4979600, 5012269, 5026962, 5063495, 5073563, 5073880, 5076837, 5086905, 5091793, 5095230, 5207243, 5239768, 5254461, 5290778, 5358372, 5387142, 5454736, 5483322, 5483639, 5486500, 5486697, 5491549, 5496837, 5500274, 5612167, 5644116, 5658809, 5695342, 5705410, 5705727, 5708708, 5718776, 5723664, 5727101, 5839090, 5871183, 5885876, 5922193, 7151679, 7154567, 7598201, 7598601, 7601533, 7854963, 8010845]
#cockpit silvia
#positions = [12586361, 12643287, 12839298, 13446622, 13448259, 13777777, 13779158, 13906890, 14082034, 14438510, 14766485, 14782807, 14783844, 14818022, 14819059, 14819976, 14821013, 14822050, 14823087, 14823284, 14824441, 14843166]
#-------------------
#car mustang imsa
positions = [1054468, 1141194, 1182176, 1206038, 1241648, 1286949, 1292109, 1324735, 1328663, 3431297, 3955457, 4644783, 5035256, 5165772, 5415566, 5422351, 5437343, 5453951, 5462387, 5622325, 5628637, 5766067, 5770855, 5908319, 5987404, 6010812, 6034220, 6057628, 6057945, 6064106, 6067123, 6084024, 6170573, 6198358, 6261989, 6264897, 6265214, 6271375, 6274283, 6282363, 6285380, 6286244, 6303145, 6389694, 6418055, 6481276, 6524838, 6557252, 6600814, 6633136, 6663608, 6694080, 6724552, 6724869, 6731030, 6734047, 6750948, 6837497, 6865474, 6928599, 6931507, 6931824, 6937985, 6940893, 6948973, 6951990, 6952854, 6969755, 7056304, 7085049, 7148270, 7160566, 7278224, 7351918, 7362814]




curfolder = "E:\\Escritorio\\silvia\\car_model\\sylvia old\\output\\textures\\cockpit\\"
#curfolder = "E:\\Escritorio\\silvia\\car_model\\sylvia old\\output\\skins\\team a\\"
def dds_search():
    for i in range(eof):
        try:
            byte_test = f.readByte()
            if byte_test == 0x44:
                test_array = [f.readByte() for i in range(3)]
                f.seek(-3,1)
                if test_array == dds_array:
                    dds_pos.append(f.tell()-1)
                    
        except:
            pass #end of file
    for i in range(len(dds_pos)):
        cur = i
        f.seek(dds_pos[cur]-4)
        size = f.readInt()
        buffer = []
        cur_dds = curfolder+"texture_"+str(cur)+".dds"
        for i in range(size):
            buffer.append(f.readByte())
        file = open(cur_dds, 'w+b')
        binary_body = bytearray(buffer)
        file.write(binary_body)
        file.close()

#positions_search()
#dds_search()
#print(len(positions))
#print(hexl(flag_array[:-1]))

#sys.exit()
for i in range(len(positions)):
    cur = i
    f.seek(positions[cur]+7)
    loop = True
    cur_loop = 0
    while loop:
        cur_loop = cur_loop + 1
        try:
            byte_test = f.readByte()
            if byte_test == 0x2f:
                test_array = [f.readByte() for i in range(5)]
                f.seek(-5,1)
                if test_array == flag_array[:-1]:
                    f.seek(5,1)
                    loop = False
                    #print("header size = ", cur_loop+5)
                    #print("current end of header = ",f.tellHex(),"\t int after = ",hex(f.readInt()))
        except:
            print("some fucking error happened in item ", cur, positions[cur])
            pass #end of file
        if cur_loop == 100:
            print("loop limit exceeded")
            loop = False
            break
    #print(hex(f.readInt()))
    stride = f.readInt()
    version = f.readInt()#????
    vc = f.readInt()
    unknown = f.readInt()
    fic = f.readInt()
    verts = []
    faces = []
    uvs = []
    print("mesh "+str(cur),"special flag = "+str(version),f.tellHex(),stride,vc,fic)
    #print(f.tellHex())
    for i in range(vc):
        vert = tuple([round(f.readHalfFloat(),4) for i in range(3)])
        #print(vert)
        verts.append(vert)
        if stride > 20 and stride != 60:
            f.seek(14,1)#20
            uv = tuple([round(f.readHalfFloat(),4) for i in range(2)])
            uvs.append(uv)
            f.seek(stride-24,1)
        elif stride <= 20:
            f.seek(2,1)
            uv = tuple([round(f.readHalfFloat(),4) for i in range(2)])
            uvs.append(uv)
            f.seek(stride-12,1)
        elif stride == 60:
            f.seek(14,1)
            uv = tuple([round(f.readFloat(),4) for i in range(2)])
            uvs.append(uv)
            f.seek(stride-28,1)
        else:
            sys.exit("what the fuck are these uvs?")
    #print(f.tellHex())
    for i in range(fic):
        fi = f.read3Int()
        faces.append(fi)
    curmesh = "Mesh_"+str(cur)
    mrp.create_mesh(curmesh)
    mesh = mrp.get_mesh(curmesh)
    mesh.set_vertices(verts)
    mesh.set_faces(faces)#,fm="TStripFF")
    mesh.set_uvs(uvs)#, tp="Float")
    mesh.set_uvs_indices(faces,fm="Triangles")#,fm="TStripFF")
    #mesh.set_normals(normals)
    mrp.render(curmesh)
    mrp.print_mesh(curmesh)
    meshes.append(curmesh)    
    
mrp.render(meshes)

sys.exit("end of code")
finally some screens of final result if done properly...(my script doesn't export materials, so you will have to find textures manually)

Image
Image
Image
Image


lastly another pro tip, the sounds could be theoretically extracted using ram dumps; I haven't tested if the march 2017 build allows to dump the sounds using the old method, it could work, I haven't tried yet.

Re: RaceRoom Racing Experience .kluns

Posted: Thu Nov 18, 2021 12:02 am
by portoalto
Machinedramon wrote: Fri Oct 29, 2021 10:30 am so after a review of this game i came to some interesting conclusion, maybe not perfect but still could be a help for many...


first of all the problem lies in the script for bms unpacking the .public files, they still use lzma2 but has some extra parameters that introduces a jump on the files that basically if you don't account it for your verts/textures will get totally ducked up. But, here the workaround for that, just go and grab the steam depot that is from 14 march 2017(google a bit and be careful of the tools you use, given r3e is free, i'd use another steam account to download the old depot; for you cannot use the steam console anymore for that). Once you have the old depot, the files will unpack correctly for that version, although there are not special tools that are able to unpack it from the get go I was able to code in python a script for mrp that works more or less good, this is by no means a final script and only works under my control of variables, if anyone is savvy enough of python and thinks they can modify the code to make it work, be welcome. (Just in case, I wont provide unpacked converted files in here.)


tip: there are 2 functions here I use to parse the file before I even can extract the geometry, one is to search for DDS textures and extract them to a "curfolder"; that you will need to change it(works for car_template, cockpit_template and liveries once all unpacked from .public) the second function that is for the positions will print in console the positions of the meshes in the file and generate the geometry based on the API of MRP.-

tip 2: this doesn't work for tracks for tracks have massive sizes, before being able to process tracks there will be need a better split method or using pure python(I think MRP is not suited to work on such big files).
I got a little lost.
1st - does that mean that your script cannot decrypt the new encryption of the files but only those from that date?
2nd - How can you download and install the version from that date? When you make a new account and try to install the game, you have to install steam and it only installs the latest version of the game

Re: RaceRoom Racing Experience .kluns

Posted: Thu Nov 18, 2021 4:39 pm
by Machinedramon
1st, its not my script, is bms script, the script has an algorithm to unpack all the contents inside the files; after some testing, not only the newer versions but already some of the cars released in 2017 are already compressed in another way, for example the Nissan r90ck, that one has a different type of file, after compression, which doesn't work with the script from bms = the file although can be used more or less, has a problem that there are jumps in the vertex pools that break the method for an automated 3d script.

2nd, you don't download the game per se in steam, steam doesn't allow downloading steam depots anymore, and that is the keyword there, steam depots. If you look up in google more about it, you will see that there are software/scripts made so you can download old depots, but as it is a way to give user/password to a third person you don't know, that's why I said its better to just create a fake account and add R3E to your new account library, before you can use any of those 3rd party software/scripts.

Re: RaceRoom Racing Experience .kluns

Posted: Thu Mar 31, 2022 5:02 am
by Foxbody
Hello! I apologize if this isn't the right place to write this, but I am having trouble sourcing models and textures from Raceroom using QuickBMS.

I am trying to get the 1985 FORD MUSTANG IMSA GTO . Using the "raceroom.bms" script I am able to convert the files from kluns.public to .kluns. But upon using "raceroom_kluns.bms" to convert either textures or models, I get an error
"Error: the requested amount of bytes to allocate is negative (0xb6ffbd00)

Last script line before the error or that produced the error:
64 getdstring DUMMY DUMMYSZ
coverage file 0 1% 699255 57673253 . offset 000aab79"

This I cannot convert the .kluns to .dds or the models to a usable format.

I apologize in advance as I am not incredibly savvy with this process. Any help to convert these would be greatly appreciated. Thanks so much.

Re: RaceRoom Racing Experience .kluns

Posted: Thu Mar 31, 2022 5:42 pm
by Machinedramon
Foxbody wrote: Thu Mar 31, 2022 5:02 am Hello! I apologize if this isn't the right place to write this, but I am having trouble sourcing models and textures from Raceroom using QuickBMS.

I am trying to get the 1985 FORD MUSTANG IMSA GTO . Using the "raceroom.bms" script I am able to convert the files from kluns.public to .kluns. But upon using "raceroom_kluns.bms" to convert either textures or models, I get an error
"Error: the requested amount of bytes to allocate is negative (0xb6ffbd00)

Last script line before the error or that produced the error:
64 getdstring DUMMY DUMMYSZ
coverage file 0 1% 699255 57673253 . offset 000aab79"

This I cannot convert the .kluns to .dds or the models to a usable format.

I apologize in advance as I am not incredibly savvy with this process. Any help to convert these would be greatly appreciated. Thanks so much.
well, that's exactly what the full post of the forum is meant to explain, next time better have a read first.... The issue is simple, the scripts were probably made somewhere before 2017, after 2017 they changed how the models are packed/compressed and it has some stuff that basically breaks the scripts cause now when unpacking there is data that should not be there that is just some garbage along the way, so yeah, scripts will only work if you get files that are old enough not to have been tampered with on the new game files... before you ask how, read a little bit, I wrote more or less a tutorial that should be useful if you can follow it, the mustan imsa GTO is one of the files that can be obtained (and no, dont bother asking me to share, i will not)