Durik256 Posted May 31 Share Posted May 31 (edited) 8 hours ago, h3x3r said: I mean decompress and read decompressed buffer. I think noesis can do that right? code: Spoiler def CkeckType(data): if data[:4] != b'TPEK': return 0 if unpack_scx(data)[:4] != b'INVO': return 0 return 1 def unpack_scx(data): # your unpack code return unpack_data def LoadModel(data, mdlList): bs = NoeBitStream(unpack_scx(data)) # other code/ create model return 1 Edited May 31 by Durik256 Link to comment Share on other sites More sharing options...
h3x3r Posted May 31 Share Posted May 31 Well i did but it throw error. RuntimeError: Tried to set offset beyond buffer size. (2054986872 > 107774) def noepyCheckType(data): if data[:4] != b'TEPK': return 0 if unpack_scx(data)[:4] != b'INVO': return 0 return 1 def unpack_scx(data): bs = NoeBitStream(data) bs.read(4) Chunks = bs.readUInt() for i in range(Chunks): ChunkOffset = bs.readUInt() ChunkDecSize = bs.readUInt() ChunkComSize = bs.readUInt() EoT = bs.tell() bs.seek(ChunkOffset, NOESEEK_ABS) compData = bs.readBytes(ChunkComSize) data += rapi.decompInflate(compData, ChunkDecSize) bs.seek(EoT, NOESEEK_ABS) return unpack_data def noepyLoadModel(data, mdlList): bs = NoeBitStream(unpack_scx(data)) Should i also add handler for unpack_scx? Link to comment Share on other sites More sharing options...
Durik256 Posted May 31 Share Posted May 31 (edited) 1 hour ago, h3x3r said: Well i did but it throw error. RuntimeError: Tried to set offset beyond buffer size. (2054986872 > 107774) Should i also add handler for unpack_scx? at a minimum you are returning a non-existent "unpack_data" and adding the unpacked data back into the data. Here's what I saw with a quick inspection. I'll quickly adapt my unpacker for this. it works: Spoiler #by Durik256 from inc_noesis import * def registerNoesisTypes(): handle = noesis.register("Ridge Racer Slipstream ", ".SCX") noesis.setHandlerTypeCheck(handle, noepyCheckType) noesis.setHandlerLoadModel(handle, noepyLoadModel) return 1 def noepyCheckType(data): if data[:4] != b'TEPK': return 0 if unpack_scx(data)[:4] != b'INVO': return 0 return 1 def unpack_scx(data): bs = NoeBitStream(data) export_data = b'' bs.seek(4) # TEPK num = bs.readUInt() print('num:',num) for x in range(num): offset, decSize, comSize = bs.read('3I') print(offset,decSize,comSize) cpos = bs.tell() bs.seek(offset) data = bs.read(comSize) export_data += rapi.decompInflate(data, decSize) bs.seek(cpos) return export_data def noepyLoadModel(data, mdlList): bs = NoeBitStream(unpack_scx(data)) return 1 Edited May 31 by Durik256 1 Link to comment Share on other sites More sharing options...
h3x3r Posted May 31 Share Posted May 31 (edited) Thank you. It works. EDiT: i just noticed i am wrong with template and script. I must rewrite it. There is change in table struct. 1 entry consist 2 int32 from which first is type and second offset. EDiT: Updated previous script. Now it should open any car file without unpacking. Scene files have diff struct so i don't want bother with it. Also checked textures but they are mess. I can preview most of them but some of them are still off. Most likely there is involved some PVR code. My best bet could be PVRTexTool... Also i would like to thanks durik for decompression code. Edited June 2 by h3x3r Link to comment Share on other sites More sharing options...
FengoVolkov Posted June 2 Share Posted June 2 You can use aluigi's offzip to decompress them offzip -a -1 <input file> <output folder> -0 Every single one of the files are compressed. The SCN files, ie "0harbourline_765_CW.SCN" have the locations of each object as well. Which, are also needing to decompressed with offzip. It's just plain text once decompressed. I'm not sure what the FOG, PE, SP2, and SPL2, files are. They are also all plaintext, the .TEX files are also plaintext, but they contain each of track objects textures and what is supposed to be applied to them. One of the UVs is for the material, one of the UVs is for the diffuse. And, for what it's worth, I didn't actually thread existed, I had been using offzip and 3D Object Converter, which converted all of my SCX files to OBJ. That's all well and good, but I lose one of the UVs in doing that, so I can only apply the lightmap, but not the diffuse. Which kind of defeats the purpose. Plus the scale the models are converted to is COMPLETELY off, so the SCN location data becomes completely useless as well. Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted June 4 Author Share Posted June 4 (edited) On 6/1/2024 at 4:07 AM, h3x3r said: Also checked textures but they are mess. I can preview most of them but some of them are still off. Most likely there is involved some PVR code. My best bet could be PVRTexTool... for some reason importing Ridge Racer Slipstream textures doesn't work for me. It gives me this error. and I'm using latest version of PVRTexTool EDIT: okay I figured out a solution from Fengo that it's a compressed pvr file, I have to use offzip to decompress it and open it in PVRTextool which now it works Edited June 4 by UndercoverBoy833 Link to comment Share on other sites More sharing options...
FengoVolkov Posted June 4 Share Posted June 4 I've attached some files pertaining to the scenes. I've got all of my Slipstream models decompressed for ease of use, I had used 3D Object Converter, cause nothing here worked, but 3D Object Converter does not support two UV maps. It seems that UV1 is for the lightmap, and UV2 is for the diffuse. So included with the *.SCX file is a *.TEX file, which is just plain text, and one *.SCN file which is also plain text, but it is one of the more important files, as all the track parts are imported to origin and the SCN has object transformation data and where the actual mesh files are supposed to be located. I had started to put the files together manually, but realised the UVs were only for the lightmaps, which would require me to manually redo the mapping for every single object, which is just.. not something I want to do, or think I have the skill to actually do, UV Mapping is a bit of an art, one that I am not.. great at. Quote vertices (float) normals (float) UV map 1 (float) UV map 2 (float) minimap meshes are 36 stride, cars is 32, courses is 40 Some additional details from a friend about the format. I've gone ahead and already decoded it with aluigi's offzip as I had mentioned previously. Hopefully this is helpful. SCN+More.zip Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted June 7 Author Share Posted June 7 (edited) oh boy, time to rearrange every Ridge Racer Unbounded car model submeshes out from this mess, (I'm using Durik's noesis plugin of Unbounded .vhcl file). Textures .bmap is basically dds file with extra headers so deleting those headers should be able to open it in image editor. EDIT: at least I can rearrange it myself using the base it has so wish me luck. Edited June 7 by UndercoverBoy833 Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted June 24 Author Share Posted June 24 (edited) since I finally have dumped Critical Velocity which is a Japanese spin-off game of the Ridge Racer series for the PS2, thx to ikskoks's bms script posted here, is there anyone who can look into this car samples? .pac could be the model and .erp would be the texture oh btw I've already checked in xentax archived post regarding someone asked for Ridge Racer Driftopia game dumping but no one looked into it. car.7z Edited June 24 by UndercoverBoy833 Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted July 2 Author Share Posted July 2 more sample files on Critical Velocity Sprout carsprout sample car.7z Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted August 19 Author Share Posted August 19 So I wanna bump my own topic after a while and about Ridge Racer Unbounded .vhcl. Since it is a bugbear asset, one plugin I knew was for Wreckfest, Fengo did modified the Wreckfest plugin to support Ridge Racer Unbounded model. So I think I wanna post his example of how it was done. Ridge Racer Slipstream model plugin works as intended (compressed version) but the model was too big in 3d workspace after I imported to blender. Would anyone tend to change it to size 1:1? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now