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

[Modset4.2] Open BrawlBox/Lib Development Thread [PW's SSS support(PAT0 editing)]

Kryal

Smash Ace
Joined
May 28, 2009
Messages
560
Finished porting. I may release soon.


Do I have to delete these lines?
Code:
state._scale._x = (float)Math.Round(Math.Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]), 4);
state._scale._y = (float)Math.Round(Math.Sqrt(p[4] * p[4] + p[5] * p[5] + p[6] * p[6]), 4);
state._scale._z = (float)Math.Round(Math.Sqrt(p[8] * p[8] + p[9] * p[9] + p[10] * p[10]), 4);
No, you don't need to remove them. That's how you get the scale values.

I didn't clarify what I meant about the problem with scaling. The problem with distortion is unavoidable, simply because that's how scaling works. It distorts the matrix. Open any modeling program and apply scale + rotate and you'll see the same thing.

It appears that rotating a bone that is affected by scaling causes the rotation to be irregular at certain points. This is most likely due to the use of the frame matrices, which have scaling applied. What you will probably need to do is replace the use of frame matrices and construct new ones by stripping out the scale values.

Get the effective scale from the frame matrix like so:

ScaleX = sqrt(00² + 01² + 02²)
ScaleY = sqrt(04² + 05² + 06²)
ScaleZ = sqrt(08² + 09² + 10²)

Multiply the inverse (1 / scale) by each value in the column. Leave the 4th column alone because this holds a valid world location for the bone. You can then use this matrix to convert to/from local-space. I may be easier just to show you...
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Ah,I may have understood your words.
Code:
        public Matrix GetProperMatrix()
        {
            Matrix m = this;
            float ScaleX, ScaleY, ScaleZ;
            fixed(float* p=_values)
            {
                ScaleX = (float)Math.Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
                ScaleY = (float)Math.Sqrt(p[4] * p[4] + p[5] * p[5] + p[6] + p[6]);
                ScaleZ = (float)Math.Sqrt(p[8] * p[8] + p[9] * p[9] + p[10] * p[10]);
            }
            for (var i = 0; i < 12; i++)
            {
                if (i == 0 || i == 4 || i == 8)
                    m[i] /= ScaleX;
                else if (i == 1 || i == 5 || i == 9)
                    m[i] /= ScaleY;
                else if (i == 2 || i == 6 || i == 10)
                    m[i] /= ScaleZ;
            }
            return m;
        }
I do need to study math more.
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
PAT0 functions still have bugs. Wait for Modset4.1.

@pokelover
I'll post code when I finish fixing PAT0 functions.
this sounds great :D can't wait!

Ah,I may have understood your words.
Code:
        public Matrix GetProperMatrix()
        {
            Matrix m = this;
            float ScaleX, ScaleY, ScaleZ;
            fixed(float* p=_values)
            {
                ScaleX = (float)Math.Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
                ScaleY = (float)Math.Sqrt(p[4] * p[4] + p[5] * p[5] + p[6] + p[6]);
                ScaleZ = (float)Math.Sqrt(p[8] * p[8] + p[9] * p[9] + p[10] * p[10]);
            }
            for (var i = 0; i < 12; i++)
            {
                if (i == 0 || i == 4 || i == 8)
                    m[i] /= ScaleX;
                else if (i == 1 || i == 5 || i == 9)
                    m[i] /= ScaleY;
                else if (i == 2 || i == 6 || i == 10)
                    m[i] /= ScaleZ;
            }
            return m;
        }
I do need to study math more.
lol, it kinda looks like action script in flash :3
hope you get it work
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
@Shadic
BrawlBox seems to be fixed but I'm not sure.
If you don't mind, could you send me your animation file(this is best) or tell me what character motion were you editing?

EDIT
Thank you! I got your file.
 

GeminiCrossFade

Smash Ace
Joined
Mar 16, 2010
Messages
811
This may not be the right place to post this and please tell me if it isn't but.
Could anyone with experiece using the Modset 4.0 brawlbox PM. Im trying to learn animating.. and even though this couldn't be any easier im still having difficulties trying to understand how to use it.

Thank you for your time
 

DarkDragoon

Smash Champion
Joined
Dec 19, 2007
Messages
2,694
Location
AZ
NNID
LordDarkDragoon
Drag and Drop Animation? I love you guys.

Now if model importing worked I'd be able to die happy...
-DD
 

pokelover980

Smash Ace
Joined
Oct 4, 2007
Messages
905
Drag and Drop Animation? I love you guys.

Now if model importing worked I'd be able to die happy...
-DD
Next week I have a lot of time on my hands (because Thanksgiving Break :D), so I'm going to spend some time trying to see if I can finish up the MDL0 format definition, or if I can't, at least fix a few of the bugs in BrawlBox 0.64.
 

Sora Master2.0

Smash Journeyman
Joined
Nov 28, 2007
Messages
313
About the new modset, I'm loving it. I hope this isn't spam, but I'm taking a 3-D course dealing with animating. I'm far from good, but hopefully I'll get somewhere with this. I'd love to learn more and just saying keep up the gorgeous work you guys are doing. It's fantastic how far were going to make this game more awesome(us meaning you guys. =p)
 

Eternal Yoshi

I've covered ban wars, you know
Joined
Mar 3, 2007
Messages
5,450
Location
Playing different games
NNID
EternalYoshi
3DS FC
3394-4459-7089
......anyone has a clue on what to input in TexFileIndex and Key?
I don't see much of a pattern here.

I'm referring to MenSelmapPreview's PATO.
 

RandomTBush

Smash Ace
Joined
Aug 10, 2009
Messages
889
Location
Donut Plains
Well, PAT0 editing seems to be half-working now. I'm able to add new entries, but there's still one problem. It seems that while it does add new entries, it always forces them to be named "NewEntry", even when you change the ordering around... But it didn't crash for me, unlike what happened when I tried doing so with the previous version.
 

br3compactor

Smash Ace
Joined
Apr 6, 2010
Messages
792
Location
Brazil
Please teach us how to add the new images, RandomTBrush. :(

The ones for stage previews, stage icons, and stage names.
 

RandomTBush

Smash Ace
Joined
Aug 10, 2009
Messages
889
Location
Donut Plains
Please teach us how to add the new images, RandomTBrush. :(

The ones for stage previews, stage icons, and stage names.
Well, I'll let you know once I get it working. While Bero fixed the PAT0 saving, I somehow screwed up the main menu. I'm almost certain it was my fault for changing the order all around, but I made it so that every icon was blank, with Battlefield's portrait and the F-Zero emblem.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
@Dantarion
In fact, I don't have an idea about index numbers. At first, I thought it was positions of textures,but this seems to be wrong. If you have an idea, please tell it to me.

Well, last BrawlBox was OK? If so, I'll update OP.
 

Dantarion

Smash Champion
Joined
May 21, 2007
Messages
2,492
Location
Santa Barbara, CA
Here is how PAT0 works AFAIK:

PAT0 file has list of textures.
PAT0 file has list of palettes.

PAT0 file has entries, that contain a index of the texture and palette.
The game looks up a entry number, then returns the proper texture.

The issue is that BrawlBox is currently showing the index numbers as numbers, when instead it should show a dropdown box using the list of textures and palettes.

To add a new texture to a PAT0 right now, one most add the texture to the PAT0 file, then add an entry, then find the index of the texture in the PAT0 list by counting from the top, and then type in the index manually
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
@Dantarion
Well, for example,MenSelmapIcon.00 is first in common5/sc_selmap_en/MiscData[80]/AnmTexPat/MenSelmapIcon/iconM
But its texture is 16th in common5/sc_selmap_en/MiscData[80]/Textures.
How can I get texture indexes?

@pokelover
Finished committing.
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
@Dantarion
Well, for example,MenSelmapIcon.00 is first in common5/sc_selmap_en/MiscData[80]/AnmTexPat/MenSelmapIcon/iconM
But its texture is 16th in common5/sc_selmap_en/MiscData[80]/Textures.
How can I get texture indexes?
I can help cause I know kinda PAT0 very much...
(wow, first time I feeling useful)
it is kinda easy to find them.

in "texture file" (in the new BrawlBox Modset) you will see this.
The numbers on the side of textures name is the indexes for each texture ;)

but if you want how to find them in hex is kinda special but i am sure you know that already :awesome:
 

Dantarion

Smash Champion
Joined
May 21, 2007
Messages
2,492
Location
Santa Barbara, CA
@Dantarion
Well, for example,MenSelmapIcon.00 is first in common5/sc_selmap_en/MiscData[80]/AnmTexPat/MenSelmapIcon/iconM
But its texture is 16th in common5/sc_selmap_en/MiscData[80]/Textures.
How can I get texture indexes?
common5/sc_selmap_en/MiscData[80]/AnmTexPat/MenSelmapIcon/iconM

The indexes are the ones in the PAT0 file, for both the textures and the palettes
 

RandomTBush

Smash Ace
Joined
Aug 10, 2009
Messages
889
Location
Donut Plains
Oop. Came across another bug.

While editing the PAT0 entry for "MenSelMapPreview", only a few out of the 147 entries show up in the list (it ends at "MenSelmapFrontStname.18" when it should end at "MenSelmapPrevbase.59"). After adding in a single new entry, it blanks out the names for all of the rest of them after saving and opening it up again...
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
may I request something (kinda) easy thing?

In Model view, you can export animations and replace animations.
but what happened if we give it one more option?
"replace with only rotations". it is like the replacement but instead for all, it only replace the rotations in a whole animation :3
 

br3compactor

Smash Ace
Joined
Apr 6, 2010
Messages
792
Location
Brazil
Pointless as it's currently possible AND easy.

EDIT:

Sugestion.

PLEASE, PLEASE, PLEASE!!! Create a box that you can check in the model previewer that allows you to see the other models in the .pac.

This would be the stage makers lifesaver. It would make stage creation 10 times easier not to have to look every single time in the collision previewer, then go back to modding the model, then go check it out again.

The other models could have a slightly lower opacity but that's not really needed.
 

Sora Master2.0

Smash Journeyman
Joined
Nov 28, 2007
Messages
313
May I request a tool or switch that switches between move and rotate? The new drag and drop animating is awesome, and it would be improved with a move tool. Or maybe there is one I don't know about?
 

NintendoShadowMario

Smash Journeyman
Joined
Aug 4, 2010
Messages
252
Pointless as it's currently possible AND easy.

EDIT:

Sugestion.

PLEASE, PLEASE, PLEASE!!! Create a box that you can check in the model previewer that allows you to see the other models in the .pac.

This would be the stage makers lifesaver. It would make stage creation 10 times easier not to have to look every single time in the collision previewer, then go back to modding the model, then go check it out again.

The other models could have a slightly lower opacity but that's not really needed.
That box idea would make life alot easier.
 

HeavenBot

Smash Rookie
Joined
Nov 25, 2010
Messages
11
Location
South Carolina
If at all possible, is there any chance there could be multiple animations running at once?
An example being the previously stated "all model" check box. You have all models out, and you run one animation involving only one model, and another involving a separate model at the same time.
 

Akuma2120

Smash Ace
Joined
Mar 27, 2008
Messages
826
So is it possible to change the icons for stages with the stage roster expansion with the newest release?

Anyone mind just giving me the gist of what you have to do if it is possible, I couldn't understand any of the previous comments in this thread.
 

Captain Kwark

Smash Apprentice
Joined
Jun 28, 2008
Messages
137
I have a problem with PAT0 editing. What I did was adding three new entries and named them MenSelmapIcon.70, 71 and 72 and put in new textures with the same names.

Then I've changed the Custom SSS code to enable the newly added icons. 70 = 46 hex etc.

But the problem is it only shows the last added icon. Which is MenSelmapIcon.72.

Here is last part of the Custom SSS code.

Code:
* 06407AAC 00000090
* 01010202 03030404
* 05050606 07070808
* 0909330A 0B0B0C0C
* 0D0D0E0E 130F1410
* 15111612 17131814
* 19151C16 1D171E18
* 1F19201A 211B221C
* 231D241E 251F2932
* 2A332B34 2C352D36
* 2F373038 3139323A
* 2E3BFFFF 40[COLOR="Lime"]46[/COLOR]41[COLOR="lime"]47[/COLOR]
* 42[COLOR="lime"]48[/COLOR]4301 44024501
* 46024701 48024901
* 4A024B01 4C024D01
* 4E024F02 50025102
* 52015301 54015501
* 56015701 58015901
* 5A015B01 5C015D01
 

AMKalmar

Smash Ace
Joined
Mar 10, 2009
Messages
887
Location
Hamilton ON CA
Is it now possible to make custom icons for the CSS? For example, a Red Alloy icon instead of using Captain Falcon's? Or... does the code itself get in the way of that?
 

Segtendo

Smash Hero
Joined
Dec 1, 2009
Messages
5,021
Location
Illinois
NNID
Segtend0
3DS FC
2552-4940-9357
Is it now possible to make custom icons for the CSS? For example, a Red Alloy icon instead of using Captain Falcon's? Or... does the code itself get in the way of that?
Looking at a sc_selcharacter.pac and the info Dant provided above, I can't find a way to add CSPs for alloys...
IDK if sc_selcharacter.pac has PAT0 files.
 

ds22

Smash Lord
Joined
Aug 30, 2009
Messages
1,662
Location
Rotterdam, The Netherlands
Looking at a sc_selcharacter.pac and the info Dant provided above, I can't find a way to add CSPs for alloys...
IDK if sc_selcharacter.pac has PAT0 files.
They have, for the CSS character icons.
There in MiscData[30] from MenSelchrFaceA_TopN__0 to MenSelchrFaceI_TopN__0 in the face6 section.
Problem is, when you add a new entry, save it, close and open the file again, the whole list in face6 is wiped out.
 

Akuma2120

Smash Ace
Joined
Mar 27, 2008
Messages
826
Ok, um how do you open PAT0 files? And where are they exactly, even using Modset 4.1 of BB I can't see a file called PAT0 anywhere in the sc_selmap.pac in common_5
 
Top Bottom