Engineer Durik256 Posted May 31, 2024 Engineer Share Posted May 31, 2024 (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, 2024 by Durik256 Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted May 31, 2024 Engineer Share Posted May 31, 2024 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...
Engineer Durik256 Posted May 31, 2024 Engineer Share Posted May 31, 2024 (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, 2024 by Durik256 1 Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted May 31, 2024 Engineer Share Posted May 31, 2024 (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, 2024 by h3x3r Link to comment Share on other sites More sharing options...
FengoVolkov Posted June 2, 2024 Share Posted June 2, 2024 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, 2024 Author Share Posted June 4, 2024 (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, 2024 by UndercoverBoy833 Link to comment Share on other sites More sharing options...
FengoVolkov Posted June 4, 2024 Share Posted June 4, 2024 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, 2024 Author Share Posted June 7, 2024 (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, 2024 by UndercoverBoy833 Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted June 24, 2024 Author Share Posted June 24, 2024 (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, 2024 by UndercoverBoy833 Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted July 2, 2024 Author Share Posted July 2, 2024 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, 2024 Author Share Posted August 19, 2024 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...
UndercoverBoy833 Posted October 26, 2024 Author Share Posted October 26, 2024 So I've tried using Wreckfest (bugbear) blender plugin for importing Ridge Racer Unbounded assets and it partially works but has missing body/chassis parts and no UVs. The example above is Fengo edited the plugin to import Ridge Unbounded fully tho it still doesn't have UVs. Preview of Ridge unbounded car model using Wreckfest plugin Link to comment Share on other sites More sharing options...
BluBlu Posted November 11, 2024 Share Posted November 11, 2024 On 1/31/2024 at 6:22 AM, UndercoverBoy833 said: test import of RR7 maps/areas, probably because the addon script code for map ARCL format is unchanged Hi, I'm interested in importing maps from RR6/7, would it be possible to have this plugin? Thanks. Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted December 21, 2024 Author Share Posted December 21, 2024 On 11/11/2024 at 7:36 AM, BluBlu said: Hi, I'm interested in importing maps from RR6/7, would it be possible to have this plugin? Thanks. this should do it https://github.com/GreenTrafficLight/Ridge-Racer-Blender-Addon Link to comment Share on other sites More sharing options...
boyserOne Posted Thursday at 01:04 PM Share Posted Thursday at 01:04 PM sorry for the stupid question guys, i am trying to get texture from RR7 cars can someone please explain how you got the R7T from the TEX files? (tex file without an extension) Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted Thursday at 04:33 PM Author Share Posted Thursday at 04:33 PM (edited) 3 hours ago, boyserOne said: sorry for the stupid question guys, i am trying to get texture from RR7 cars can someone please explain how you got the R7T from the TEX files? (tex file without an extension) You need quickbms in order to do that. QuickBMS script code by h3x3r: ############################ # Ridge Racer 7 tex unpack # ############################ endian big get baseFileName basename idstring "RPT" getdstring dummy 0xD savepos baseOffset get files uint32 for i = 0 < files get offset uint32 math offset + baseOffset savepos tmp goto offset getdstring dummy 0x8 get fileId uint32 getdstring dummy 0x18 get size uint32 math size + 40 string name p= "%s/%u.r7t" baseFileName fileId log name offset size goto tmp next i I also have the alternative code for QuickBMS script ############################ # Ridge Racer 7 tex unpack # ############################ endian big get baseFileName basename get Magic uint32 if Magic == 1380996096 # RPT getdstring dummy 0xC savepos baseOffset get files uint32 elif Magic == 1098015564 # ArcL get files uint32 getdstring dummy 0x8 savepos baseOffset elif Magic == 1346454347 # PACK get files uint32 endif for i = 0 < files if Magic != 1346454347 get offset uint32 math offset + baseOffset savepos tmp else get offset uint32 get fileNum uint32 get fileSize uint32 savepos tmp endif goto offset getdstring dummy 0x8 get fileId uint32 getdstring dummy 0x18 get size uint32 math size + 40 string name p= "%s/%u.r7t" baseFileName fileId log name offset size goto tmp next i so just use any one of them which works fully for you. Edited Thursday at 04:33 PM by UndercoverBoy833 Link to comment Share on other sites More sharing options...
UndercoverBoy833 Posted Friday at 06:26 AM Author Share Posted Friday at 06:26 AM so anyone had any luck on ripping Ridge Racer Unbounded models as the model format .vhcl was Bugbear asset? I knew the blender plugin of Wreckfest exists to import assets and supports the model, but not fully enough for Ridge Racer Unbounded formats as I've tested it a while ago. Same for Ridge Racer Driftopia archive which I'm curious how many cars were and what were look like. the reason I'm asking is so that I can port cars to other racing games as mods. I did tried use Ninja ripper for Unbounded models, however I couldn't get the result that I need for. I also did tried to import Critical Velocity model that's fine, but the parts in the 3d view are kinda a mess to see. Link to comment Share on other sites More sharing options...
boyserOne Posted Friday at 11:14 AM Share Posted Friday at 11:14 AM 4 hours ago, UndercoverBoy833 said: so anyone had any luck on ripping Ridge Racer Unbounded models as the model format .vhcl was Bugbear asset? I knew the blender plugin of Wreckfest exists to import assets and supports the model, but not fully enough for Ridge Racer Unbounded formats as I've tested it a while ago. Same for Ridge Racer Driftopia archive which I'm curious how many cars were and what were look like. the reason I'm asking is so that I can port cars to other racing games as mods. I did tried use Ninja ripper for Unbounded models, however I couldn't get the result that I need for. I also did tried to import Critical Velocity model that's fine, but the parts in the 3d view are kinda a mess to see. worked! thank you very much 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