Page 9 of 9

Re: RaceRoom Racing Experience .kluns

Posted: Sat Apr 02, 2022 4:23 am
by Foxbody
Hi there, first of all I'd like to say thank you for the reply and I apologize for not looking closer. This is a bit overwhelming over my head but I have read these pages many times now trying to wrap my head around it better, digging trying to get some results. I started by using shakotay2's page 5 tutorial. I was able to generate h2o, then to obj's (which has lots of spiky mess in blender, regardless of redux or raw exe). I am just supremely lost at editing the converted data to a format that can be processed via hex editor for clean preview, I've tried the few YT tutorials and the built in tut. I am just struggling big time.
I then sourced depot 211501 from March 14, 2017 as you listed to get a better operating klun.public/.klun situation. Unfortunately raceroom.bms generates completely empty .klun files. An issue I did not experience on the newer build that I am not sure what to go about, thus creating unusable .klun files.

I am not going to lie, your attached "mrp" script in the post above I am really struggling to figure out how it plays into the process or how to use it.

Again, I apologize as this is quite far from my forte, although I am really trying to better grasp the process to get this car and it's accompanying textures for a game project I have been working on for 2 years now. Thanks so much for your time and again I apologize for any ignorance on the topic.

Re: RaceRoom Racing Experience .kluns

Posted: Sun Apr 03, 2022 5:42 pm
by Machinedramon
Foxbody wrote: Sat Apr 02, 2022 4:23 am Hi there, first of all I'd like to say thank you for the reply and I apologize for not looking closer. This is a bit overwhelming over my head but I have read these pages many times now trying to wrap my head around it better, digging trying to get some results. I started by using shakotay2's page 5 tutorial. I was able to generate h2o, then to obj's (which has lots of spiky mess in blender, regardless of redux or raw exe). I am just supremely lost at editing the converted data to a format that can be processed via hex editor for clean preview, I've tried the few YT tutorials and the built in tut. I am just struggling big time.
I then sourced depot 211501 from March 14, 2017 as you listed to get a better operating klun.public/.klun situation. Unfortunately raceroom.bms generates completely empty .klun files. An issue I did not experience on the newer build that I am not sure what to go about, thus creating unusable .klun files.

I am not going to lie, your attached "mrp" script in the post above I am really struggling to figure out how it plays into the process or how to use it.

Again, I apologize as this is quite far from my forte, although I am really trying to better grasp the process to get this car and it's accompanying textures for a game project I have been working on for 2 years now. Thanks so much for your time and again I apologize for any ignorance on the topic.
The tutorial ShakoTay posted is pretty much a way to try and circumvent the garbage in the files, the MRP script is a script though to work on a program called Moder Researcher Pro, problem is that one is a payed program, I might have a look at it again and try to change the script into a standalone python somewhere along the line, but yeah, the textures and the models will either be broken with newer files, the tutorial of shako I'm not sure if its gonna work on the files of the old cars, and then also there is the problem that even if you had the correct files mrp is not for free...

Re: RaceRoom Racing Experience .kluns

Posted: Fri Jan 27, 2023 6:55 pm
by saso
Hello everyone I'm an Italian modder and I apologize for my English but I'm using the translator.
I know the topic is dated but I want to try to ask for help anyway.
I can't extract the internal textures of the car that I need, a few years ago I used Ninja Ripper but with the change of the hard disk all the files were deleted and now I don't know why Ninja ripper with Raceroom doesn't work anymore "maybe they put a protection" :evil:
Can someone please help me to extract the internal textures of the car or explain me how to do it? I tried with the various Quick Bms scripts but I can't extract anything.
I am attaching the files but I don't know which is the right one of the internal textures of the cockpit and I am uploading all the Public files that are there
Many thanks to anyone who can help me

https://www.mediafire.com/file/9t9w6ax6 ... me.7z/file

Re: RaceRoom Racing Experience .kluns

Posted: Fri Jul 21, 2023 9:33 pm
by zimex25
bump, somebody making one-click converter?

Re: RaceRoom Racing Experience .kluns

Posted: Sat Jul 22, 2023 4:52 pm
by shakotay2
zimex25 wrote: Fri Jul 21, 2023 9:33 pm bump, somebody making one-click converter?
Haha, "one-click converters" for .kluns are out of stock. :D

You're better off trying to get the model-of-your-interest the way Zangano did:
Zangano wrote: Tue Nov 03, 2020 11:34 pm
(In case you have an interesting model I might give it a go. But don't expect too much.)

Re: RaceRoom Racing Experience .kluns

Posted: Sun Jul 23, 2023 11:29 am
by zimex25
shakotay2 wrote: Sat Jul 22, 2023 4:52 pm
zimex25 wrote: Fri Jul 21, 2023 9:33 pm bump, somebody making one-click converter?
Haha, "one-click converters" for .kluns are out of stock. :D

You're better off trying to get the model-of-your-interest the way Zangano did:
Zangano wrote: Tue Nov 03, 2020 11:34 pm
(In case you have an interesting model I might give it a go. But don't expect too much.)
Your work was very important but imo the best converter will be "one click" because in this moment effect is this same like from Ninja Ripper.

Re: RaceRoom Racing Experience .kluns

Posted: Wed Sep 27, 2023 12:03 am
by JanB23
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).

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.
Excuse me for bump an ancient theme but, MRP gave this error:

Traceback (most recent call last):
File "MR", line 3, in
from nines import *
ModuleNotFoundError: No module named 'nines'

Afaik i'm installed full phyton; can you help me please? thanks in advance (i'm understand if not, anyway thanks)