• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Brawl model extractor

Status
Not open for further replies.

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
http://www.patriotmods.com/brawlhacks/utilities/ais_0.1.1.exe

Meh, this is just a little project I've been working on recently. Since up until now both the model converters that have been released have flaws that restrict them to what files they can and can't extract I decided to write my own. To my knowledge it should work on any model ripped from the game.

It can accept either .pac or .brres files and will output a Collada .dae file in the same directory. Probably not of much use right now, but I figured I'd share now that I think I've got all the major bugs worked out. I still need to add texture support and I might get animation working in the future.

Both William's and Sabretooth's converters were used as a reference. Please report any bugs you find here.

== Update by Pharrox ==

Well, I've decided to let Bionic Sonic close this thread for now.

This project has really started to get to me and as I have stated I don't really see any point in wasting time doing something that will be done better anyway. I am currently changing my focus to another project that I've been wanting to work on for quite some time and will post the details of that when I have something releasable since I don't want a repeat of the current situation. I plan to post all my notes here after I get a chance to update them so if anyone is curious about Brawl's specs they can take a look.

Also it was just brought to my attention that there is some new user claiming that I stole his work. I will just state right now that this is NOT TRUE. To clear up any credit problems I will say right now that most of my research is based on Sabretooth's model extractor, however no code was directly copied. Sabretooth knows about this and is also the one who first explained to me the way that weights are applied (which is probably the hardest part of model decoding). William's extractor was also referenced for decoding polygon formats and position type ids. Gary's tplconv was used as a reference for texture extraction. No code was directly copied.

While my main focus will be on my side project for now, I will likely return to this if there hasn't been much progress within a decent amount of time (1 - 2 months) (and after talking to Kryal).


Thanks for all your support on this and, hopefully I'll have something more for you guys in the next few months

~Pharrox
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
How are you using it? You need to drag a .pac or .brres file onto it to get it to extract. I forgot to add a check to make sure there's a file passed to it. Simply running the program with no file will cause a crash. It'll be fixed soon.
 

pghazanfari53

Smash Rookie
Joined
Nov 19, 2008
Messages
13
I think you should first work on converting the models BACK into .mdl0. It shouldn't replace the model completely because that would get rid of the animation data and stuff, but just replace the actual model part.
 

Phantom Wings

Smash Apprentice
Joined
Jul 29, 2008
Messages
150
Nice job Pharrox, I just got a chance to try it out now and it's pretty sound. The only problem I've found so far is that the normals appear to be in the wrong direction - though that could just be because I'm using Max with a Collada plugin. It wouldn't be a problem except that when I try to flip them it affects something in the way the mesh is setup causing it to look all blocky.

Can I ask you if you're going to continue working on this? If you perfected this to use textures, animations, and the ability to repack them all I imagine that there would be a lot of people who could find a lot of use in something like that.


I dragged and dropped a [character]R1.brres and nothing was extracted.
Check this directory:

C:\Documents and Settings\<user name>\

When I used it, it placed the files in there.
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69
I found that the only way for these applications to work for me is to "open with" the program. Maybe this is your guys' problem too.

Simply right click on the pac/brres file and go down to "open with..." or "open with > Choose program". There should be a list of applications. To add yours click the "browse" button and find the application. If this doesnt work Im not sure what the problem is.



Also Pharrox the models come out really choppy in photoshop. Is it like that in collada max as well?
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
Nice job Pharrox, I just got a chance to try it out now and it's pretty sound. The only problem I've found so far is that the normals appear to be in the wrong direction - though that could just be because I'm using Max with a Collada plugin. It wouldn't be a problem except that when I try to flip them it affects something in the way the mesh is setup causing it to look all blocky.

Can I ask you if you're going to continue working on this? If you perfected this to use textures, animations, and the ability to repack them all I imagine that there would be a lot of people who could find a lot of use in something like that.
I'll take a look at the normals problem and see what I can find.

And yep, it's still very much a work in progress. My current priorities are:
1. Textures
2. .dae -> .brres
3. Animations (don't look TOO complicated)


Also Pharrox the models come out really choppy in photoshop. Is it like that in collada max as well?
Could you post a picture of what it looks like in Photoshop so I could check it out?
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69
Could you post a picture of what it looks like in Photoshop so I could check it out?
here...


you can definitely see that it is lucario but it looks like he got thrown in a blender and then he was re-assembled XD

Im pretty sure that this isnt my computer doing this but its possible.

hope this doesnt put a damper on your progress:dizzy:


oh, but trophy models come out just fine. I only am having problems with the character and Item models.
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
Hm, the only thing I can think of is that it might be caused by the fact that my program doesn't assign any polygons a surface (yet). [snip]
 

Phantom Wings

Smash Apprentice
Joined
Jul 29, 2008
Messages
150
Pharrox, I recently tried to extract a stage model but it appears that they don't work. I've heard that stages are encrypted so that may acount for it but I just thought I'd bring it up here.
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
To extract stage models you need to use SSBExtract to extract the .pac, then use lz77ex to decrypt the .bin files and rename the output of those to .pac.

It should be able to extract the models after that.
 

Phantom Wings

Smash Apprentice
Joined
Jul 29, 2008
Messages
150
Alright, thanks for the info.


I tested the latest version of your extractor... The results are a bit weird so I'll try and explain it as best I can.

v1.1
normals in viewport: Correct
normals when rendered: Incorrect and culled.

v1.2
normals in viewport: Incorrect
normals when rendered: Incorrect and culled.


So even though you flipped the normals in the newer version, it only flipped it in the viewport... Seeing as it has the same effect when rendered regardless of the version I'm using, I'm going to guess that there's just some option that I accidentally have enabled in my renderer that's causing it to render funny. So the flip you added in the latest version probably wasn't necessary after all.
 

Knightcrawler

Smash Journeyman
Joined
Jun 19, 2007
Messages
224
Location
Orange county, CA, USA
Try putting on "render backfaces" and a smooth modifier. "Render backfaces" shouldn't be turned on for video game modeling, but if it looks like his when those two options are applied, then yeah the face normals need work. You can do it manually, but it'll probably get screwed up again when you import it. So if that works, it's a problem with the program. As to why it looks like light's reflecting off it funky uh... I'm no expert at this kind of stuff, but I think the vertex normals weren't calculated correctly. Again, you can recalculate them, but it should be fixed in the program.
 

Phantom Wings

Smash Apprentice
Joined
Jul 29, 2008
Messages
150
Yeah, I hear ya. I'd already found out the option for rendering backfaces, and there's another option for lighting backfaces properly as well... I don't think it should be a problem - if it goes in that way, and goes out that way, then it should work fine, no?
 

Knightcrawler

Smash Journeyman
Joined
Jun 19, 2007
Messages
224
Location
Orange county, CA, USA
There's only one way to find out. Well, it'll be trouble when making a new model (or adding any new faces at all to an existing model). How is someone supposed to know what will get flipped and what won't?
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69
Could you try this file and see what happens.

http://rapidshare.com/files/218366689/lucario.dae.html

That's Sabretooth's Lucario model converted to Collada using Autodesk's fbx converter. It was my main reference when writing this. Sorry about rapidshare, my web host is a piece of crap.


Well now its perfect XD
at least I know my photoshop and video card are fine.

Before you do anything else let me try to re-download the tool. Maybe it only works right on certain computer verions:confused: I dont know.

Im using Windows XP just for the heck of it.
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69
Well i compared your file to my file and they have different file sizes.

Which file are you using?
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
I think I have found the problem in with Photoshop, and I'm working to fix it. Will hopefully have it working in a few days.
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69
I think I have found the problem in with Photoshop, and I'm working to fix it. Will hopefully have it working in a few days.
alright, Thanks for working so hard to help this. I hope im not causing too much trouble XD. At least I can be a testee in case problems like this come up later.

PS: If you would like any help with this just ask. I will be happy to [try to] help you with anything. lol
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
Well I've figured out texture animations (really simple) but I have a problem. It doesn't seem like Collada can export texture animations and after looking at fbx found that it couldn't either.

Does anyone know of a good format that can be used for the texture animations, or better yet, a way to implement them in Collada?
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
FBX doesn't support texture animation either, and to my knowledge there is no 3ds dev kit.

For now I'm just going to stick with collada. To handle texture animations I'm just going to use my own format which my program can modify for the reverse conversion. I'm about 30% done with the Collada->.brres converter.
 

WeirdoZ Inc.

Smash Apprentice
Joined
Nov 14, 2008
Messages
165
Location
Melbourne, Australia
That's fair enough.

On another note, the models I convert are coming out kinda borked. I'm only trying to view them in a viewer called Deep Exploration, but when I view them they come out fragmented.

Here's what I get:


I opened that converted Lucario you posted earlier and that works with no issues at all.

Is it a problem on my end, or is it something you should perhaps look into?
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
My current guess is the same as the photoshop problem. Even though the geometry is all there, the models have absolutely no surface data (textures, materials, or anything).

It's something I'm currently working on, but I'm having a very hard time with that part of the model data. I know where the surface info is listed, but I can't find how the data is applied to the polygons. They aren't in the same order, and neither of them have pointers to the other as far as I can find.
 

Mackorony101

Smash Cadet
Joined
Apr 14, 2007
Messages
69
My current guess is the same as the photoshop problem. Even though the geometry is all there, the models have absolutely no surface data (textures, materials, or anything).

It's something I'm currently working on, but I'm having a very hard time with that part of the model data. I know where the surface info is listed, but I can't find how the data is applied to the polygons. They aren't in the same order, and neither of them have pointers to the other as far as I can find.
If it helps I found out that the textures are applied backwards kind of, at least for the trophy models. If you flip the texture vertically the texture is normal.

here is when I apply the normal texture.


here is when I flip it vertically(it shows in the right pic).



thought this might help if later on you run into the problem
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
My problem isn't with the textures not lining up on the model, but with the textures not lining up in the model data. In the model data there are blocks for polygons, positions, normals, uvs, textures, etc. At the start of each polygon it lists which set of positions, normals, and uvs are to be used for it, however I can't seem to find where it says which set of textures need to be applied to that polygon.

In other words, even though my program can see the textures and the geometry, it can't match them up. It has no way of knowing (yet) whether it should apply Pikachu's body texture to Pikachu's body instead of his eye.
 

Knightcrawler

Smash Journeyman
Joined
Jun 19, 2007
Messages
224
Location
Orange county, CA, USA
Two ideas:

1) It might be in the mesh info. I haven't found a mesh yet that has multiple textures applied to it, so it'd make sense to save space by only listing the texture once, there.

2) It might be in the texture data. For instance, the texture might say "apply me to mesh .01, .02, and .05."

As for the eyes, there's something special going on with them...

*Edit*

3) It might be entirely in the UV data. If you've seen Brawl UVmaps, they're pretty messed up and way outside the normal boundaries for a UV. Maybe their position determines what texture they map to. So like anything between (50,-150) and (-50,-50) (I dunno the usual actual values of a UVmap, sorry. :-P) would be one texture, etc..
 

Pharrox

Smash Journeyman
Joined
Jan 26, 2007
Messages
397
Location
Belleville, MI
I'm sure it isn't in the mesh or texture data, however I think you might be onto something with the uv idea :). I'll have to test it when I get home from work today.

EDIT: Dang it! I really thought you'd figured it out too. Just got done testing, and uv placement doesn't seem to be it. It fit perfectly, too! I'll probably have to do some really thorough testing on tuesday.
 
Status
Not open for further replies.
Top Bottom