Spoiler tag

Wednesday, June 1, 2011

JSRF Tool v0.2 - Level model extract & Sounds extraction

Hello JSRF fans!

This post is focused on the new version of the JSRF tool, if you're not really interested in using the tool you probably don't need to read this boring technical description which I'll try to keep short and simple anyways.

So I haven't had time to work on this project at all, but I have taken a few days to try to fix some things, and it was hard to remember how things worked, but here's honestly a more or less efficient extraction tool.

When you open a JSRF .dat or .bin it will load nodes in the tree, I gave a color for each type:

Red nodes = Materials
Purple nodes = Models
Yellow nodes = Textures
Grey nodes = unknown/empty

Models (MDLB) and textures

In this version MDLB are all exported fine, still in .obj but with also the .mtl (material) so the texture is assigned to the model.
To export a model with textures create a "textures" folder in the same folder you export the model and use the "export all" yellow button to export the textures in the textures folder (it is important to use "Export All" since it gives the texture identifier number assigned to the material of the model for the .mtl to find)



Levels

As for level models (MDLBL) they all export fine with the right texture, but there is one model type which I never got around to extract properly so they just won't export, those are name "triangle strip" type in the "Triangles info" when you have an MDLBL selected.

The level models are located in the "Stage" folder and are split up in many files, you can only extract things from the .dat for the stages, these contain models and textures.
For instance the garage models and textures are split in the files:
-stg00_00.dat
-stg00_01.dat
-stg00_02.dat
-stg00_03.dat
-stg00_04.dat

You have to extract all the models and textures (to a folder named "textures" in the same folder you extracted the models) from those files to get the garage.
You may notice there are some "MDLB" in the stages files, those are objects also called props which are placed many times in the level, probably their spawn and position/rotation are defined in the .bin which I didn't look much into.

The level sky model/texture is in the files ending by "_t.dat" for the garage "Stg00_t.dat"

Sounds 

This one works perfectly and doesn't really need to be explained, just open a file in the folder "files\Media\Sounds\SE" and it will automatically switch to the "Sound" tab, you can either extract all the files to .wav format, or click one and play it.

Misc

I added a settings tab so you can define the JSRF folder files, export models/texture folders, so the tool now will open the latest folder you selected for exporting files.
There is also a "replace texture" button, which lets you inject textures, but it was quickly implemented, only us it if you really know what you're doing anyways, more explanations on the "readme.txt" file in the tool .zip file.

Let me know any particular problem in the comments ;)



17 comments:

  1. It's been a while, nice to see you finally got this release out.

    What was the reason I couldn't get the sage base? I's it because it's a triangle strip? I do remember having it at some point. Maybe if I fiddle with the export settings.

    ReplyDelete
  2. Yeah long time, better late then never I guess.

    As for the level models its still the triangle strips, while I solved the problems with the striped MDLB and how its textures were applied I couldn't figure out for the level models.
    Its just that the stripped level models probably have "degenerate triangles" I tried many methods but couldn't get it working, basically it gets some messed up triangles and this screws the materials groups.

    It still tries to export but since I am not converting the triangle strip properly it sometimes fails to convert the triangle strip and just exports the model without the triangles instead of crashing.

    ReplyDelete
  3. WOW i'm so impressed with your JSRF blog!! I'm a really big fan! I wish there was a JSRF 2! Do you have twitter? Follow me - www.twitter.com/chasneen

    ReplyDelete
  4. Hey thanks! I think every JSRF fan wishes for another sequel, hehe. I don't have a twitter but I'll check yours out ;)

    ReplyDelete
  5. Wow, What you've done is amazing creating a tool to let anybody easily extract models and textures from this awesome video game thats a really huge accomplishment, i'm a really huge JSRF fan and i think if someone would take the time to crack the codes and create programs he must be trying to recreate JSRF on the PC or maybe just mess with the game, i was thinking about making a JSRF sequel, but creating a game by yourself can be very hard, thats why we should create a team and work on this as a project,let me know what yall think???
    because to be on a blog like this you must have a love for JSRF.....

    ReplyDelete
  6. Thanks, while I though maybe to port the game to pc its pretty much impossible for me, first off I wouldn't have time or intrest for that, I would rather make my own indie games first seeing how hard and timeconsuming trying to make such port would be.

    In order to make that you'd need to program the game engine, so you need a really good programmer (which I am not at all) also I may be able to get models and textures but I haven't figured out animations and bones, I hardly think I'll solve that :/ and haven't looked at level data such as grinding postions, object placement, cinematics...

    It would be a very very long task and hard to make such "port" to even get something decent it would need a lot of people and time working on it, I barley have time to post something in the blog atm, but hey we can at least check out the models =)

    Then of course if someone would like to make a port or a mini game why not though, I am not sure what SEGA would think about that, I am just letting people view the art assets because its one main thing I love about the game ;)

    ReplyDelete
  7. This is great, I'm a big fan of JSRF. I've also been involved in reversed engineering/ripping games, and I was interested in making my own maxscript for this game but I see you have already made a tool for it :P

    ...but I don't have my modded Xbox anymore, is there any other way to rip Xbox games or should I just download it?

    Also I'm also a 3D modeler and I'm kinda interested in the shaders. Do the materials have the information on how the cel shading works? I want to try and replicate it in UDK.

    ReplyDelete
  8. You can download the iso and extract the files then open the .dat with the tool.

    From what I figured out I am not really sure of where or what the materials are, I colored red the node type in the tool as material but it may not be an actual material, these nodes basicaly have 2 values one gives the texture "ID" (unique identifier) and the other I am not sure of what it is, it may be some shader ID or a shader parameter but if that is all there is about the material I guess the game has only a few types of materials.

    From previous renders I did to reproduce that shader I would say you need a lambert or a phong and an outline shader, I am sure you can get decent results with the material nodal editor in UDK.

    Also the shadows of the levels are precalculated, there are models for it, these are "Shadow volumes" don't know if you could use these in UDK though you might just want to make a lightmap.

    ReplyDelete
  9. Thanks, yeah I'll try and find a good torrent when I have the time. You gonna try and get the bones and animations working?

    You should also have a look around the Xentax forums, there's many like minded people who love reverse engineering game files (there are also a few annoying requesters and leeches haha).

    ReplyDelete
  10. For the iso just type on google "snesorama jsrf" first link, megaupload if you prefer anyways.

    I have posted the first version of the tool on Xentax though didn't seem to get much people intrested.
    I might seek for help there, to tell the truth I abslutley don't consider myself a "reverse engineer" I don't know ASM or reverse engineer any executable, all I found here was looking with a hex editor at the game files.. hardcore! xD

    If someone with ASM/IDA reverse engineering could take a look at the .xbe executable of the game I am sure he could find the functions to load the files and figure out all the stuff, pretty sure the programming is simple, though the way models and materials are stored in the files seems messy to me.

    As for animation/bones I know they're on the .bin just like .dat things are stored by blocks which I can list and extract individually as a binary file.

    For instance quite sure the characters animations and bones are in the .bin file though I really can't figure out any of it, I do see some floats, decimals and integers/bytes that make sense but the patterns change from one file to another and there doesn't seem to be a regular structure or header, probably it varies depending on the model, number of bones etc.

    I have tried comparing exported rigged models formats such as ".x" and it doesn't look much like it, the game probably has a custom format and I can't find any simmilar pattern between files to get started on that.
    I have seen some values which may be "weight maps" and number of values which match the vertrice count but other then that it wasn't enough for me to figure out more.

    But I haven't looked at that for a few months now, I might give it yet another try, but this stuff takes time and patience I just have other things to focus on atm.

    ReplyDelete
  11. hehe awesome. Yeah I only have basic knowledge of model files, I also work with a hex editor haha!

    A friend from another forum taught me so I can look for vertices, faces, weights, etc. and their counts. I love it when the files are in tri-strip form where it's usually verts(x,y,z) then normals, then weights, then UVs but I've never known how to look for bones.

    Anyways, thanks for the tool and good luck, I'll check back in a month or so to see if there's any progress.

    ReplyDelete
  12. Hey thanks, if you know about tri strips I'd like to get help on that! =)
    I am still unable to convert levels models wich are triangle strip to triangle lists, I was told it might be because of "degenerate" triangles still I can't convert them properly.

    ReplyDelete
  13. @neodos
    Hmmmm, i see it would be very difficult and time consuming to make a PC transport and i agree, the art assets used in this video game are very unique and artistic, but like you said at least we can look at the art assets,
    Ive been using Blitz3D to program games and programming is not an easy thing to do, i feel like JSRF is a game that i can learn from to create my own kind of games, the shades used in JSRF are different instead of trying to be really real its more of a fantasy looking game, but then again who really wants a game that is realistic, usually people play video games to escape reality and enter a virtual world which
    they can live a life other than there owns or just to "show your friends who's boss" in a creative way, i have grown a passion for this and loving making video games, when i have time. A question for neodos "are you an actual programmer for indie games or are you going to be some time soon? I'm just curious because of the last comment you made.

    ReplyDelete
  14. Now I'm worried that I've mixed tri-strip with something else haha.

    This is what I meant before: http://img543.imageshack.us/img543/5581/alkdsf.jpg

    I'll try and explain, my programming vocab is very small so I might sound a bit silly. I might of mixed up tri-strips with tri-lists so you might already know this.

    I have a loop that last as long as the vert count, and it'll append the vert floats into an array and the UV's in another array.

    Here's the loop in Maxscript form:
    for x = 1 to vertcount do(

    vx=readfloat f
    vy=readfloat f
    vz=readfloat f
    n1=readfloat f
    n2=readfloat f
    n3=readfloat f
    tu=readfloat f
    tv=readfloat f
    p9=readshort f
    p10=readshort f
    p11=readshort f
    append Vert_array[vx,vz,vy]
    append UV_array[tu,tv,0]
    )

    With the face indices I have another loop that lasts as long as the indice count / 3. The loop reads 3 shorts and appends them to another array.

    for x = 1 to indicecount/3 do(
    fa=readshort f #unsigned+1
    fb=readshort f #unsigned+1
    fc=readshort f #unsigned+1
    append Face_array[fc,fb,fa]
    )

    Then there's some maxscript code that uses the infomation and turns it into a mesh, magic lol.

    So...yeah, that's mostly what I know when it comes to ripping models. Doing it in Maxscript is pretty cool since there's no compiling, etc. and you can see the results straight away since you are doing it in a 3D program. Hopefully it's useful in some sort of way haha.

    ReplyDelete
  15. DOES anyone know why the "REPLACE TEXTURES" button doesne't work ??
    I'm trying to change the players textures, (Clothes..) i can extract and edit, but then the REPLACE Textures button doesn't work ....
    veryy annoying !
    ;)

    ReplyDelete
  16. I disabled it for player files, it only works for levels atm.

    ReplyDelete
  17. I'm a little confused on how you get the files to extract. How do you get the game onto your computer?

    ReplyDelete