• 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!

MDL0 file information needed for Converter

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
hey pharrox...
I'm custom making a bone right now...
and I need to know how the bytes work...

I've exported a bone from fort waffles bone adding program, and changed the offset...
but there's more I need to do than that:

Frame matrix: what does this do, and where is it located??
inverse bind matrix: what does this do, and where is it located??
header length: can also be called datablock length (almost always 208)
mdl0 offset: nothing to know
string offset: same here
bone index: obvious
node ID: what does this do, and where is it located??
flags: I have unread notes on these
pad1 and 2: nothing needed
everything in black: obvious
parent and child offsets: obvious, but what's their locations??
next and prev offset: just now understood those XD, but what's their locations??
part2 offset: what does this do, and where is it located??

if I can...
I might try my skills at html+js on working on a bone editing program, similar to brawlbox
(I still can't program a gui for crap) XD
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Can't say I'm positive, but I believe it's xyzXYZ
you're right...

and I figured out something...
the min bounds are the furthest verts in the negative direction
the max bounds are the furthest verts in the positive direction

I did a comparison using blender and brawlbox...
in blender:
-X: -5145
+X: 5145
and in brawlbox:
EMin: -514466
EMax: 514466

very simple comparison
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
ok... can you help me pharrox??
Daniweb is failing with this...
how do you identify the differant data types in the mdl0
(from the relocation table)
I've posted a piece of the code from will's converter over at Daniweb, for someone to convert to python...
but no-one has been active in a while
can you tell me??
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
KK I need some datas explained to me
anyone willing to help??

color
material 1
material 2

I've already understood most of the color data...
but the 1 thing I don't understand is:
how do 16bit color values such as 'FE 6C' work??
I already know these only include RGB values (no alpha)
but how do you get the differant colors from these??

eg: '0F 00' = R:08 G:E3 B:00

mat 1 and 2... I dont understand at all
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Good to see a model importer thread going again. I hope to see good things from this, good luck.
I've got an exporter out as well...
along with my own method...

here's a hack I did with my method:

it's a simple edit yes...

but I'm just proving it can be done... <:/

thanx though :)
 
Last edited:

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
thanx :)

I need help with the materials so I can release this...

I'm releasing V3 with his dark Green thunder
shown here:

that was done with just a simple color edit...
but not all his MDL0's have color group...

there's some that are controlled by the materials
once I can getthose changed, I'll release this :)
 
Last edited:

Oshtoby

Smash Apprentice
Joined
Sep 6, 2006
Messages
181
Location
Burholme, Philadelphia, PA, USA, North America, Ea
thanx :)

I need help with the materials so I can release this...

I'm releasing V3 with his dark Green thunder
shown here:
*Picture*
that was done with just a simple color edit...
but not all his MDL0's have color group...

there's some that are controlled by the materials
once I can getthose changed, I'll release this :)
What do you mean "release this?" What do you mean by "this?" Do you mean you'll release the importer/exporter? Or do you mean you'll release your Pikachu hack? Either way, looking cool! There should be more people showing hype for this, honestly. Would your method be able to export models that were hand made? Or would it only be able to import models from the game, edit them, and then export them back into the game? If this could do handmade models, this would revolutionize Smash Brothers hacking.
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
What do you mean "release this?" What do you mean by "this?" Do you mean you'll release the importer/exporter? Or do you mean you'll release your Pikachu hack? Either way, looking cool! There should be more people showing hype for this, honestly.
I ment my Pikachu hack...
and thanx :)

I'm surprised I'm not getting as much help as I should be on the importer and exporter

Would your method be able to export models that were hand made? Or would it only be able to import models from the game, edit them, and then export them back into the game? If this could do handmade models, this would revolutionize Smash Brothers hacking.
as of right now...
it's only for editing models
it just exports an mdl0 vert data file -_-

I intend to make this import and export full mdl0's...
after that...
I'm taking it to the next level (brres)
(but that will have to include any file that can go into a brres)
IDK... this will have to be rethought when I get to it...

^notice I say 'when' and not if...
I really intend to get this compleated...

once I do...
I should be able to export custom models...
(well... even alone with just mdl0 compatibility)

I intend to use brawl for game development...
that sound big enough for ya >:D
 

Oshtoby

Smash Apprentice
Joined
Sep 6, 2006
Messages
181
Location
Burholme, Philadelphia, PA, USA, North America, Ea
I'm surprised I'm not getting as much help as I should be on the importer and exporter
Here's a tip: No one goes in the "Tutorials, FAQs & Help" part of this forum. You want more help? Say that you're beginning a project, give it a fancy name of some sort, and post it on the "Smash Workshop General" board. It works, I've seen it done in the past.

Keep in mind though that you'll get a lot of people banging at your door asking "ARE YOU DONE YET," and all that. You'll most likely feel rushed and pressured, then. If you're looking for more attention, though, that's the way to do it.
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Here's a tip: No one goes in the "Tutorials, FAQs & Help" part of this forum. You want more help? Say that you're beginning a project, give it a fancy name of some sort, and post it on the "Smash Workshop General" board. It works, I've seen it done in the past.
KK thanx :)

1 Q though...
what to name it??

Keep in mind though that you'll get a lot of people banging at your door asking "ARE YOU DONE YET," and all that. You'll most likely feel rushed and pressured, then. If you're looking for more attention, though, that's the way to do it.
oh that's ok :)
I've got a little trick up my sleeve for that
now I can try it out :D

I'll do it later today... -_-
*cough* school orientation *cough cough*

EDIT:
you know what...
maybe I won't at this moment...
I'll develope it a little more first...
but I'll be sure to keep the idea in mind :)

also... @anyone with knowledge
how do you referance the string offsets in the mdl0??
I'm trying to add a bone by hand... and I'm almost done :D
I just need to change the string offset value
(I'm changing it to adding a string to the end of the mdl0)

and I know...
doing this means I'll have to change every following mdl0 offset...
that'll be easy... just add 208 to every offset *awsome face*
 

Mecha the Slag

Smash Rookie
Joined
Apr 25, 2010
Messages
9
I've been following this for a bit in hope of progress, and Tcll, you have my full support on this. Keep it up!
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Any update on this at all?
well besides adding vars to the seperate functions, and not knowing how to use most of the data in blender, no...

speaking of which, I've recently started a thread over at blender forums about this...
and I'm still waiting for some replies...

right now I'm having a hectic time building a brawl file hex editor with hex highlighting written in html/js,
on my slow computer that likes to cut the net on me...
(wireless) D:<
I use the net as my guide for programming
(just type in what I need to know in google)
the hex editor is built for the mdl0 format right now...
I'll add more options to it once I get to those files in blender...

once pharrox shows his but back here... XDD
progress on this should start kicking up again... :)

and thanx for the support mecha :D
glad to have a few "fans" :)
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
oh...
where's Pharox when I need him :/

I've got the mat1 block partially figured out,
but nothing on the mat2 block

I really need some help with this, and he's the only one I know of that knows the mdl0 materials...
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
I really want to help but I don't so much about the mdl0 files D: sorry

But I can't wait until the mdl0 converter is done :D great work!

you could try to google after him or maybe it is a stupid idea xD
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
I tried google before...
it wasn't friendly with that search :p

and it's not a converter...
it's an im/exporter for blender

and I finally got some info as well :D

to break it down, here's the layout to importing an mdl0:
1: read the data
2: seperate the data
3: convert the data
4: send the data to blender...

I currently have differant people helping me with each step:

1: me :p (100%)
2: Daniweb (8%)
3: SB, Daniweb (60%)
4: Blender forums (9%)

the percentages are the progress I have done on those steps...

but yea...

I now have a bunch of info from Daniweb to help me out with step 2 :D
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
ah, I see :3
a in/exporter x3
the more people info are gather, more easier is it to make right? :3
make sense

I need to say lucky you, I bet more than 10 helping you right know about gathering/making that tool
well, to be the only one that looking in texture pattern hacking, it takes some time and I can't ask somebody if I got stuck D: since I know (for sure) the most about pat0 files right know. only 5% left that need to be discovered and just those 5% is the missing part for fully complete custom patten hacking ;_;

oh, sorry for offtopic ^^;
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
ah, I see :3
a in/exporter x3
the more people info are gather, more easier is it to make right? :3
make sense

I need to say lucky you, I bet more than 10 helping you right know about gathering/making that tool
well, to be the only one that looking in texture pattern hacking, it takes some time and I can't ask somebody if I got stuck D: since I know (for sure) the most about pat0 files right know. only 5% left that need to be discovered and just those 5% is the missing part for fully complete custom patten hacking ;_;

oh, sorry for offtopic ^^;
actually...
you could be of some use to me when I bump this thing up to brres level :)

pat0 files would be used as color IPO's in blender...
I've never really played with IPO's, so IDK too much about them... :/
besides bone/object animation

but you'd greatly help out :D
knowledge is a useful tool :)
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
I'm trying to figure out step 2 of the import process of reading an mdl0 (data separation)

or basically put: the relocation table...

the group indexes specified in the header are link to the certain spots in the relocation table...
how is my question??

I saw the code in Will's Converter which gave (data16 + (index * 4))...
but I'm not exactly sure how that works??

I thought I understood the number I was getting...
but is that number for the beginning of the group index list, or the end??

and also...
Pharrox knows the bone weights as well...
and now I could use the knowledge... :/

so yea... thanx :)

EDIT:
be sure to read my past comments as well...
those are Q's that I still need answered...
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Bump...

Pharrox...
Vile...

>_>
<_<

why am I alone here D:<

eh... you guys are prbly busy with something else... *shrugs*
reply whenever you can or have time I guess...

just tryin to keep this thread alive...
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
well...
I PM'd Pharrox a while ago...
he never replied...

I don't blame him though, he's got other things to attend to <_<
somewhat like me, I mean me as somewhat like him...
(he's got more than me)

but yet I find alot of time to make on the cpu :p

anyways...
I found out some new stuff about the mdl0 file that wasn't posted
maybe I can get some help in understanding what the unknowns are

so yea...
the groups in the mdl0 header link to areas in the relocation table...
(that much was known)
what I didn't know was each group offset had it's own header

here’s what I know of the header so far:
0×00(4) = block length
0×04(4) = num offsets
0×08(4) = ‘FFFF0000′
0x0C(2) = ?? (’0020′,’0001′,’0002′,’0004′,’0008′(all I’ve found so far))
0x0E(10) = pad(10)
0x18(#) = data offsets

I was using melee's dat files to compair these,
but as it turns out, there's only little that's similar between them...
the offsets themselves are the same though
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
nothing...

I thought for sure someone would reply if I posted info :/

speaking of info
I've got more

I now know the relocation offsets are 16 bytes in length

but I have no idea what everything means, or how to use them... :/

anyone >_> <_<
please... =3=
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
kk...
this thread really needs to pick up on things...

every time I need info on something, I end up not getting a reply until a month later... D:

srsly...
this thing (the importer) could've been complete by now
but it's still at ~60%

wtf D:
 

Mobious-1

Smash Cadet
Joined
Sep 15, 2005
Messages
28
Location
Hawaii
Hey Tcll,
I've been following your work for a little while now as I've been interested in importing brawl models into Blender. I know a bit of C and Java, but unfortunately I don't know anything about parsing model files so I doubt I can be a significant help. If there's anything trivial you need to get done like testing or something I'd be happy to lend a hand.

Just wanted to thank you for what you done so far and let you know there are people anticipating your hard work.
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Hey Tcll,
I've been following your work for a little while now as I've been interested in importing brawl models into Blender. I know a bit of C and Java, but unfortunately I don't know anything about parsing model files so I doubt I can be a significant help. If there's anything trivial you need to get done like testing or something I'd be happy to lend a hand.

Just wanted to thank you for what you done so far and let you know there are people anticipating your hard work.
can you tell me how a bit of C++ code works??
if so, then meet me on Daniweb :)

http://www.daniweb.com/forums/thread302070.html
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
@Mobious-1:
thank you btw :)
glad I got fans ^_^

I just wanna get this part done so I can finish the brawl side of this script...

here's what's left before a release:
figure out the 16 byte relocation offsets
finish adding the conversion methods for the 11 groups
(verts, UV's, and colors are done)

with the brawl side finished, switch to the blender side
get the methods for storing the converted data in blender.

so that's what's left of that...

after that, I'll study on the other formats,
and bump this thing up to brres level. :D
(any file that goes in a brres will be imported)
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
hey JSYK:
I've found some old notes I had on the mdl0 format...

most of the names are wrong, but the structure and ideas are right...

and JSYK:
I'm importing strait from the mdl0 now :D

I only have verts set to import...
but there's still a few probs with it :/

I'm adding a debugger and a logger to export what it does get
(vert data will be exported in obj format)

I'll post the info to show progress what progress has been made once it's finished

I'm updating notes as well with other stuff I didn't know about
may as well post those later :/
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
now's the time I need this, as I'm now getting into the faces
I'm posting it here so I don't have to go back every time to read it...

Ah, Brawl's vertex weights, the bane of anyone trying to fully learn
Brawl's model structure. The weights are actually in a couple
different places. In the header of the MDL0 file, I'm sure you will
see a long series of 0xFFFFFFFF, this is a quick way too find the
first listing.

Every joint in a model has a weight entry for itself, even if it isn't
actually used for weighting any vertices directly. In the MDL0's
header there will be a few 32 bit ints, followed by the aforementioned
block of 0xFFFFFFFF, and then a few more 32 bit ints. The first set
of ints are the indexes of the joints which have vertices that are
weighted only by them (a weight of 1.0 from that joint). After that
there will be a 0xFFFFFFFF entry for every weight used by them model
with influence from multiple joints, and finally the last set of ints
will be the indexes of joints which do not have have any vertices
weighted directly to them.

Next you will need to skip down a bit to the root entry titled
"NodeMix". This is the block of entries which start with either 0x03
or 0x05. I always forget which is which, so I may have it backwards,
but I believe that 0x05 is for weights which are only influenced by
one joint and the 0x03 is for weights with multiple joint influence.
The first set of weights (the ones weighted by a single joint) will
simply list the index of the weight (determined by where the weight
appeared up in the MDL0 header), followed by the index of the joint
which influences it. After that are the weights influenced by
multiple joints which will first have a 16 bit number for the number
of joint influences, followed by that number of entries with a 16 bit
index (the index of a weight which is influenced by only one joint
(not the index of the joint itself)), followed by a 32 bit float
telling the amount of influence that weight/joint has.

I should also mention that in each joint's header is the index of the
weight which it has full influence over. I don't think this is
actually ever used in game, but I figure I should mention it just in
case for the sake of completeness.

Next is the matter of how the weights are applied to the geometry.
There are two ways weights can be applied. The first id for a mesh
which is controlled entirely by a single joint, and the second is for
a mesh which will have different vertices weighted by different vertex
weights. For the first way, if the 8th byte of a polygon block is not
-1, then the entire mesh listed in that block will be weighted by the
weight with the index listed at 0x08. Also, the position of the mesh
will be multiplied to the inverse bind matrix of the joint that
controls it.

Second and finally, there is the matter of how they are applied when
the vertices in a mesh are controlled by multiple weights (0x08 ==
-1). I'm going to assume for this that you already have a basic
understanding of the Wii's primitive lists and draw functions (0x90
for a triangle, 0x98 for tristrip, etc.). In the list of primitive
draw commands there will be entries for transform matrices (0x20 for
position, 0x28 for normals, 0x30 for texture coords, and 0x38 for
lights (not really ever used)). Bear in mind I don't have my
computer, or any files for reference right now, so this may be
slightly off, but I'm sure that you could find any slight errors I
might make for this next part. I believe, after the flag byte (0x20
being the important one) there will be a 16 bit index of a weight,
followed by a 16 bit memory address which the Wii will use for finding
the transform matrix. You will need to find the index of this address
by doing a little math. I believe that for 0x20 the index is:

ActiveWeightIndex = (Address - 0xB000) / 0x1E

This index I will call the ActiveWeightIndex. After which will be a
series of draw commands with their vertex description. The first byte
will be the ActiveWeightIndex and the weight that controls it will be
the weight from the first index of that 0x20 entry. Also, if that
vertex's weight is controlled by a single joint (a weight of 1.0), then
you must multiply the position of that vertex by the inverse bind
matrix of the joint that controls it. Vertices that are weighted by
multiply joints do not have any transforms applied to them.

I hope this helps out a little and is at least somewhat
understandable. I tend to be pretty bad when explaining things like
this. If you need any clarification, feel free to ask. It is quite a
bit complicated and several people have asked me how it works, I
myself had to have it explained to me by Sabretooth, who is the real
genius here for being the one to actually figure it out. I also just
feel like mentioning that I'm playing around with the models in
Pokemon Battle Revolution, and the weights are giving me some trouble
there as well. Nintendo just can't make it easy for us.
as for progress, well...
I've gotten verts to import into seperate objects...
the objects arn't named correctly though for whatever reason :/
^^^ will be fixed

here's an image showing the progress:


there's still alot of work that needs to be done on it... :/
(reguarding vars)

but this is progress to say the least :p
 
Last edited:

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
sry I've been gone for a while...
I've been a little lazy, and having to deal with skool, as well as my tonz of projects D:

I hope to get back to this soon :/

I'm almost finished with my REFT interactive hex table...
it's at about 76% complete ;)
(for people who want to learn the reft format)

my MDL0 importer is at the level of that image :(

I still need to do revisions...
lv5 while loops tend to return errors :/

hey at least I'm updating XD

EDIT:
still need to learn materials Pharrox...
(if you ever come around) :/
 

Proverbial Lemon

Smash Rookie
Joined
Nov 23, 2010
Messages
1
Location
Sellersburg, IN
I've been lurking on here for a while and I've been following your project truthfully for like only a day. However I do feel that this looks very promising. Keep up the good work Tcll don't give up.

I know you don't seem to be getting much help but if you keep going then I know you'll be able to get this done. I'd like to help you as much as the other people who'd love to but can't because we aren't skilled in programming.

If you need anything basic or just some testing even I'll be here. Sorry I can't be of any real help other than a Cheer Leader XD.

Good luck,

Proverbial Lemon
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
I've been lurking on here for a while and I've been following your project truthfully for like only a day. However I do feel that this looks very promising. Keep up the good work Tcll don't give up.

I know you don't seem to be getting much help but if you keep going then I know you'll be able to get this done. I'd like to help you as much as the other people who'd love to but can't because we aren't skilled in programming.

If you need anything basic or just some testing even I'll be here. Sorry I can't be of any real help other than a Cheer Leader XD.

Good luck,

Proverbial Lemon
actually, I forgot to mention Blender got the best of me... :(
^it's the complicated import functions I can't get working to save my life...
I've started on a converter though...

once I figure out how to make plugins, this thing should really start taking off ;)

so I'm giving up on my importer for now, but who says I can't fill someone elses shoes :D
*cough* Pharrox and Will *cough cough*
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
anyone got anything (notes) on these:

mat1
mat2
polys

I kinda need them, like now... :/

btw, mat 1 is ~50% figured out

please reply

BTW:
Materials1 = Shaders
Materials2 = Materials
Textures1 = Textures
Textures2 = Pallets (not sure how the shaders use these yet, but i'll find out...)
 
Top Bottom