• 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)]

Mr.Chuy

Chuy
Joined
Dec 29, 2009
Messages
1,817
Location
Somewhere in Texas
I know it's more work to explain than it is to do yourself, but could you just tell me how to do it?
I know how to do it as well
It's basically the model adding option but renaming it so it matches clr0 instead
the only problem people may have doing it is renaming color animations :/
 

moosehunter

Smash Ace
Joined
Nov 8, 2008
Messages
885
Just wondering, but how easy would it be to make a standalone command line brstm converter from BrawlBox's?
 

moosehunter

Smash Ace
Joined
Nov 8, 2008
Messages
885
Any chance that you might be willing to take the time to do it? That would be absolutely amazing.
 

Kryal

Smash Ace
Joined
May 28, 2009
Messages
560
(I thought you had already done by 10-31-2010)

I'm looking forward to seeing your code! Well,I have to begin making other new functions...
Not yet. Being late is something I'm good at. That and I program all week so coming home to more 'work' isn't exactly fun.

The mouse-picking and rotating is working great. There's just some small problems with the math and combining the angles. Instead of adding the angle differences, you have to combine the two rotations with matrices and then decompose it to a quaternion. From there, convert the quaternion to euler and add the difference. The problem is the Quat -> Euler conversion ATM.

The bulk of the math is complete, like the plane/sphere intersections. This has applications in other things as well should you need to use them.

-EDIT-

Oh yeah, Fallout NV is a deadly black hole. If you value your time stay away from it!
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
I'm not a professional programmer so it's my fun to program, but if I were you,I would be thinking same thing...
Please take it easy and relax at your home.
 

Kryal

Smash Ace
Joined
May 28, 2009
Messages
560
Okay, it's done (for the most part). Look at revision 38 on the BrawlTools SVN.
http://code.google.com/p/brawltools/source/detail?r=38

I have also built a preview release so you can test it out:
http://brawltools.googlecode.com/files/BrawlBox%20v0.64%20Preview.zip


Lots of changes yes, but our focus is on:

Maths / Matrix / Vector3
GLPanel / GLContext / ModelEditControl

All the work takes place in ModelEditControl:

Take note of the PostRender event, which renders the rotation orb when a bone node is selected.
  • At the very end of PostRender, ghost nodes are drawn into the z-buffer for every bone. The z-buffer is cleared prior.
  • New display list objects are employed through GLContext.GetSphereList / GetRingList / GetCircleList. These all contain primitives with a radius of 1. Rendering to the desired radius is simply a matter of calling glScale with the desired radius.

Take note of the MouseDown event, which handles bone node targeting.
  • First, the currently-selected bone is tested against the mouse point.
  • Take note of how the 'radius' variable is calculated, scaling the orbRadius constant to the camera distance.
  • The GLPanel.ProjectCameraSphere method is called for the current bone. This either intersects the bone sphere or its camera-facing plane using a ray from the mouse point.
  • This point's distance is then compared to the bone node, and tested against the radius and the orbit ring.
  • If the point falls within radius: convert the point to local-space, get its angles, and test for axis snapping.
  • If the point falls within the orbit ring, enable orbit snapping.
  • If the point falls within neither, transfer to hit-detection. (We will try selecting a new node)
  • After snapping flags have been set, call GetOrbPoint. This retrieves the world-point that intersects our snapping plane, using a ray from the mouse point. Take note of how the normals for the planes are calculated. The point is then clamped to a distance of 'radius' from the node center.
  • Convert this point to local-space and store it. This will be our origin point.
  • Store the bone's old rotation values. These will be used for escape-key cancelling.

Part 2: If no bone is selected use hit-detection
  • Get depth of mouse point. If < 1 we found something.
  • UnProject the point to world coordinates.
  • Compare all bones to this point, finding one whose distance matches the node radius. (Not the rotation orb)

The MouseMove event is where the rotations are updated:
  • Call GetOrbPoint to retrieve the snapped world-point.
  • Convert the point to local-space. We will compare this to our origin point.
  • Create a matrix by multiplying the bone's transformation to an Axis/Angle matrix.
  • The Axis/Angle matrix is created by Matrix.AxisAngleMatrix, just supply the origin point and the new point.
  • With this new matrix, derive the resulting angles by calling GetAngles.
  • Subtract the bone's frame angles from the resulting angles to get the difference. Notice how GetAngles is used twice.
  • Truncate the difference by wrapping the degrees from >180 and <-180. This allows the angles to continually increase/decrease.
  • Apply the new angles by adding the difference to the bone's frame state. (I let the anim panel handle this so that keyframes are created)

Some things to watch out for:

Bone scaling may affect how these points are converted to local-space.
I ditched the Quaternion method because conversion is a nightmare. However, converting a matrix to euler angles can be problematic. You may notice that the rotations look fine, but the angles are odd. This particularly happens to the y-angle.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
@RandomTBush
It's not a problem. I can port it to 0.63d.

I'm going to look into your code,Kryal. Good job!
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
yeay! I just love it, so much!
much easier to make rotate it so it is just you wanted :3
but a bug/glitch I saw

all the character that is "not replaced" (and vertexed hacked) has all the bones.
but all the replaced character like my dusknoir has only one bone :/
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
@pikazz
I think it's problem of 0.64. I'd like to port functions to 0.63d in a week.
Wait a moment.
 

Kryal

Smash Ace
Joined
May 28, 2009
Messages
560
Hey, Kryal? I think you packed up the wrong BrawlBox. That one's still version 0.63d.
So I did! I have multiple copies of the project folder, and it was past midnight. I fixed the download.


yeay! I just love it, so much!
much easier to make rotate it so it is just you wanted :3
but a bug/glitch I saw

all the character that is "not replaced" (and vertexed hacked) has all the bones.
but all the replaced character like my dusknoir has only one bone :/
Those models may not be linked properly. Since I was working on the asset loaders months ago, I changed how everything is loaded and stored.
 

DiamondbodySharpshooter

Smash Journeyman
Joined
Nov 3, 2009
Messages
416
Curious, is this the release that will let us add custom stage icons?

And a question I wanted to ask, how will that work? Will we be creating and adding additional files to the sc_selmap.pac?
 

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
The issue that Pikazz is referring to seems to only happen to models that have bones added.

Simply use the unedited model, Pikazz.
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
The issue that Pikazz is referring to seems to only happen to models that have bones added.

Simply use the unedited model, Pikazz.
aaah, that was a other thing xD

just thinking loud, but whats happened if we combinate "bone adder" and this update.
possible working bone adder, you press on a part on a body and it will get a bone attached to the part :D

i know, easier said than done. but I guess we are at least 33% forward to it, thinks left is to knew how to add new bones in the model file, still have all the indexes right and be able to add them through brawlbox/ model preview
 

Shadic

Alakadoof?
Joined
Dec 18, 2003
Messages
5,695
Location
Olympia, WA
NNID
Shadoof
Rotating objects such at platforms from being horizontal to vertical seems to also stretch them out, somehow.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
When you want to add bones, you will soon realize that you have to rebuild MDL0.
If we can do it, it means model importer is done.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Curious, is this the release that will let us add custom stage icons?

And a question I wanted to ask, how will that work? Will we be creating and adding additional files to the sc_selmap.pac?
This isn't release. Official Modset4.0 is coming in a week. And 4.0 has the function which you want.
 

Kryal

Smash Ace
Joined
May 28, 2009
Messages
560
Rotating objects such at platforms from being horizontal to vertical seems to also stretch them out, somehow.
Any model that is 'skinned' cannot be transformed without distortion. Also, scale may have something to do with it. Always try modifying a model's animation first.

When you want to add bones, you will soon realize that you have to rebuild MDL0.
If we can do it, it means model importer is done.
Correct. Programs that inject data into the model are not properly linked. Resizing a block of data in the slightest requires a full rebuild. That's just how the file format is unfortunately. We're still very close to accomplishing that, if someone is willing to take the time and effort to complete it. The MDL0 definition is probably 95% complete, and data management has already been reworked in the SVN.

-EDIT-

Yes, scale is causing problems for me. Bero, for the Matrix.GetAngles method you may need to strip out the scale values before deriving angles. Have a look at Matrix.Derive on how this is done. It causes problems for any node that is affected by scaling.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Finished porting. I may release soon.
Yes, scale is causing problems for me. Bero, for the Matrix.GetAngles method you may need to strip out the scale values before deriving angles. Have a look at Matrix.Derive on how this is done. It causes problems for any node that is affected by scaling.
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);
 

pokelover980

Smash Ace
Joined
Oct 4, 2007
Messages
905
When I get more time I may take a look at the MDL0 format and attempt to complete it's definition, as well as make an attempt at finishing the rebuilder. School's got me down right now, though, so my time I spend coding usually goes into my projects that I've decided I really want to finish.
 

n64billy

Smash Ace
Joined
Feb 4, 2009
Messages
614
Location
Behind you!
The new Rotation Orb is great! There should be functionality for "Undo" and "Redo" though (Or more easily.. Ctrl Z and Ctrl Y)
 

RandomTBush

Smash Ace
Joined
Aug 10, 2009
Messages
889
Location
Donut Plains
Hrm, the PAT0 editing definitely isn't working right (for me, anyway). I tried adding a new entry, and the whole thing got corrupted...

(EDIT: Tried again by adding the icon as "name.54", since that's what the new entry forced itself to be called. Crashed as soon as it got to the map screen, and I didn't even link to it or anything.)
 

Shadic

Alakadoof?
Joined
Dec 18, 2003
Messages
5,695
Location
Olympia, WA
NNID
Shadoof
I just checked out the new animation editor features.. And I think I may have done a poor job at clarifying exactly what I would have liked to see. :c

Instead of the Checkbox making it so you don't paste bone translations, could you make it so that it only pastes bone translations?

Also, I had this error when I tried to save a Motion.pac:
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan

Wasn't this what you wanted? It pastes only Translation.

@RandomTBush
I'll fix problems soon.
 

pikazz

Smash Lord
Joined
Dec 6, 2009
Messages
1,868
Location
Sweden, Umeå (Currently in Seattle)
NNID
pikamaxi
I love how brawl hacking is getting closer and closer the ultimatum :D
but i feel kinda sad all my PAT0 search was in misery :(
Correct. Programs that inject data into the model are not properly linked. Resizing a block of data in the slightest requires a full rebuild. That's just how the file format is unfortunately. We're still very close to accomplishing that, if someone is willing to take the time and effort to complete it. The MDL0 definition is probably 95% complete, and data management has already been reworked in the SVN.
aah, I see :3
but what happeneds if we start already now to try to make to rebuild a MDL0 at 95% :3
maybe the rest 5% will come up then :3
or someone could try to look at the other 5%

my PAT0 search was too 95% finished

EDIT: how can we edit PAT0 :/
are little confusing about it

EDIT 2: will it be something like "add new PAT0" like the srt0 one? :3
cause I like to have more PAT0 files on jigglypuff x3
 

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
...How Strange.

I WAS going to report a bug involving the BB preview messing up the bone names when saving animations, but it was fixed in the modset. Cool.

Don't worry, I recovered the animation since I had a backup and the math was still there so it was a matter of renaming the bones back.
 

pokelover980

Smash Ace
Joined
Oct 4, 2007
Messages
905
Hey Bero, could you update the SVN to have the code for this modset? I'd like to try to start developing on BrawlBox again, and I wanna start off on this revision.
 

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
You are not supposed to open brawllib.dll....

Not yet considering I don't know the rules of how PATO works.

I also don't see the entries for the XXXXXPrevbase.XX.....
 

Dantarion

Smash Champion
Joined
May 21, 2007
Messages
2,492
Location
Santa Barbara, CA
This has PAT0 support?
*downloads*

TexFileIndex and PltFileIndex need to be changed to comboboxes that allow you to selecction from the Texture/Palette's in that PAT0 node. Otherwise, one has to crossreference the list 24/7, which isn't good.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
PAT0 functions still have bugs. Wait for Modset4.1.

@pokelover
I'll post code when I finish fixing PAT0 functions.
 

pokelover980

Smash Ace
Joined
Oct 4, 2007
Messages
905
PAT0 functions still have bugs. Wait for Modset4.1.

@pokelover
I'll post code when I finish fixing PAT0 functions.
Okay, sounds good to me. I wasn't going to be able to develop again right away anyways, it would likely be a week or two before I get a decent amount of free time.
 
Top Bottom