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

Smaller, simpler sc_selcharacter.pac

Ondo

Smash Apprentice
Joined
Jun 20, 2007
Messages
160
This is an altered version of sc_selcharacter.pac (from common5.pac) that looks and behaves exactly the same as the default Project M 3.02 version (except for never showing the flashing new over characters). However, it's significantly smaller, hopefully making it easier for modifications to be made without running in to space issues, and it simplifies some things by removing support for unlocking characters. For example, to change the position of characters you can just change the position of the bones of the MenSelchrPos_TopN model, instead of altering frame 43 of its animation.

If you're not interested in creating your own CSS, this probably isn't of any interest. If you are, the technical details that follow still might not be of interest to you, but I'd be happy if you wanted to use this pac as the base you modify. If you want to alter an existing CSS to reduce its size, these details should help.

I'll cover things I did primarily to reduce the size first (roughly in order of how much space they save), then things done primarily to simplify editing a bit (though they also saved space).

Changes done to save space:
First, and easiest - MiscData[30] contains MenSelchrFaceA through MenSelchrFaceI; they are the models for the nine different sizes that faces can be, shrinking as you unlock more characters. For Project M, with 42 characters always available, only MenSelchrFaceI is needed - the others can be deleted (from 3DModels, AnmChr, AnmClr, and AnmTexPat).

Another thing that saves a chuck of space is going through and switching the compression of everything in char_bust_tex_lz77 from LZ77 to ExtendedLZ77. Not sure if this will help avoid space issues, since these are loaded and uncompressed when needed, I think. It may make space issues worse, since I think the extended algorithm requires a little more memory to do the decompression. So try switching it back if you have issues.

I also switched the compression of the entire sc_selcharacter.pac to ExtendedLZ77. Which I would expect to have no effect on space issues, due to everything being decompressed before use. It does makes it smaller, though, and could help fit more on a 2GB card, at least.

The MenSelchrFaceB.001 texture, in MiscData[30], is a copy of Mario's first CSP. It needs to exist (and have a palette) but is not shown. I replaced it with a 4x4 black square in CI4 format.

The various MenMainBack textures can be deleted. They are from the old background that was replaced in Project M.

The model for "New!" can be removed, if you don't want it showing up. (I don't think it makes any sense for Project M.) To do so, look for MenSelchrNew in the different sections of MiscData[30] - for the model (in 3DModels), remove everything except one bone. Delete the texture. For the animations (in AnmChr, AnmVis, and AnmClr), remove all the children of the animation but do not delete the animation itself. (If the model or animations are completely deleted, the game will freeze when going to the selection screen.)

MenSelchrCoin has 4 different animations, MenSelchrCoin_TopN__0 though MenSelchrCoin_TopN__3. For AnmClr, these are the colors for the four different players. In AnmChr, AnmVis, and AnmTexPat, only the first one is used, and __1 though __3 can be deleted.

There are a number of blank name images for character slots that aren't used - specifically, MenSelchrChrNm.201, 351, 381, 411, 421, 441, and 471. These textures can be deleted, and the references to them in AnmTexPat > MenSelchrCname4 > Card010 and Card011 > Texture0 can all be removed.

For the AnmChr of MenSelchrFaceI, you can find every bone in the animation that has only one frame, make sure the values in that frame match the values for that bone in the model, and then remove that bone from the animation. This could be done for every animation, I think, but I only did it for this one. It doesn't save much space (around 1,500 bytes for this one, before compression), but it does make it so you can edit the bone on the model and not have it overridden by the animation (at least for the ones where the animation was removed; you still will want to check that first).

In char_bust_tex_lz77, there's a MiscData[41] with only blank images. That can be removed.

Changes done to simplify things:
The basic method is taking the models with animations based either on the number of characters in the CSS or the size of the face models, and removing that animation since we now always have 42 characters and are using FaceI.

MenSelchrPos covers the positions of the faces, the main icons for selecting characters, and has a separate animation for every number of characters from 0 to 50. To simplify, copy the translation data from frame 43 of the AnmChr to the bones of the 3DModel, then removing the children of the AnmChr (but not deleting it entirely, because the game looks for it). Do the same to the AnmVis. Also, I like reordering the bones of the 3DModel to put them in numerical order (instead of having 2 after 19, for example), and deleting the bones for pos43 through pos50.

IMPORTANT WARNING - editing the MenSelchrPos model, which has bones but no polygons, will not work in BrawlBox 0.71 (and earlier, I think). Use BrawlBox 0.73b, available here.

MenSelchrCoin is the circle object that you drop on a character to mark who you pick - it gets smaller as the faces get smaller. To simplify, copy the data from frame 9 of the AnmChr to the bones of the 3DModel, and remove the children of the AnmChr except for scaleN (if scaleN is removed you can't use A to pick up the coin again after placing it on a character - no idea why). For scaleN, reduce it to just 1 frame with the data from what was frame 9.

MenSelchrCursorB is the flashing box around the face you're coin is on or over. To simplify, copy the data from frame 9 of the AnmChr to the bones of the 3DModel, and remove the children of the AnmChr. Do the same for MenSelchrShadow (the shadow cast by the face, plainly visible in the vanilla Brawl CSS but less noticeable in Project M), except use frame 10 instead.

Here's the download link. Let me know if you have any questions.
 
Last edited:

Amazerommu

Smash Lord
Joined
Jan 4, 2013
Messages
1,147
Location
Kentucky
OOOOOOOOOOOOOOOOOOOOOOOH! This might fix a problem I was having with 12 Costume Ganondorf a while back...
 

Moydow

The fairest of them all
BRoomer
Joined
Aug 24, 2014
Messages
10,543
Location
https://experiencepoint.xyz
Interesting. I already knew some of these, but you have a few things in here I wouldn't have thought of doing, like taking out the MenSelchrFace files (since I tend to be wary of just deleting files). This should help with keeping sc_selcharacter below the size limit without having to downgrade all the textures to CMPR.

also, at least from my own experience, changing the char_bust_tex_lz77 MiscDatas to ExtendedLZ77 does help avoid crashing the game if you go past 3.79 MB - I discovered that one myself when mine hit 3.8 MB or so, and changing them to ExtendedLZ77 fixed it. Might not apply to everyone though.

Another (really minor) thing - if you put this sc_selcharacter.pac in the /menu2/ folder, and extract the sc_selcharacter 2 and sc_selmap PACs to there as well, and then delete all from common5.pac, you can cut out the last 2 seconds of "Now Loading" screen at start-up. (yeah 2 seconds is not a lot of waiting, but still) It does make it easier to ensure you're not breaking the file size limit though.
 
Last edited:

Amazerommu

Smash Lord
Joined
Jan 4, 2013
Messages
1,147
Location
Kentucky
Another (really minor) thing - if you put this sc_selcharacter.pac in the /menu2/ folder, and extract the sc_selcharacter 2 and sc_selmap PACs to there as well, and then delete all from common5.pac, you can cut out the last 2 seconds of "Now Loading" screen at start-up. (yeah 2 seconds is not a lot of waiting, but still)
Holy... frackin... shrimp. I am so doing this (even if it is only a 2 second benefit lol). So you extract sc_selchar 1 and 2, and sc_selmap into menu2 and delete them from the common5.pac. That doesn't cause freezing or anything?
 
Last edited:

Moydow

The fairest of them all
BRoomer
Joined
Aug 24, 2014
Messages
10,543
Location
https://experiencepoint.xyz
Holy... frackin... shrimp. I am so doing this. So you extract sc_selchar 1 and 2, and sc_selmap into menu2 and delete them from the common5.pac. That doesn't cause freezing or anything?
Extract them to /menu2/, make sure you take the _en out of the names (so you end up with sc_selcharacter.pac, sc_selcharacter2.pac, and sc_selmap.pac), and remove them from common5.pac. That's it. Hasn't failed on me personally yet, but your mileage may vary.
 

Axonn

Smash Rookie
Joined
Jul 3, 2014
Messages
17
NNID
Axonn1018
3DS FC
3454-1237-0469
Wow I am literally downgrading CSPs at the moment to save space until I browsed upon this. Will definitely give this a try!
 

Ondo

Smash Apprentice
Joined
Jun 20, 2007
Messages
160
also, at least from my own experience, changing the char_bust_tex_lz77 MiscDatas to ExtendedLZ77 does help avoid crashing the game if you go past 3.79 MB - I discovered that one myself when mine hit 3.8 MB or so, and changing them to ExtendedLZ77 fixed it. Might not apply to everyone though.

Another (really minor) thing - if you put this sc_selcharacter.pac in the /menu2/ folder, and extract the sc_selcharacter 2 and sc_selmap PACs to there as well, and then delete all from common5.pac, you can cut out the last 2 seconds of "Now Loading" screen at start-up. (yeah 2 seconds is not a lot of waiting, but still) It does make it easier to ensure you're not breaking the file size limit though.
Thanks, both those things are good to know.

OOOOOOOOOOOOOOOOOOOOOOOH! This might fix a problem I was having with 12 Costume Ganondorf a while back...
Cool. I'm going to be trying this out, hopefully it'll help out a bit.
Wow I am literally downgrading CSPs at the moment to save space until I browsed upon this. Will definitely give this a try!
I'm interested in how this goes for you guys.

One other technique I haven't implemented yet, and forgot to mention - the CSPs are 128x160, but the texture UVs (of MenSelchrCchar4) are set so only the top 91.69% of the image is shown. So it's possible to resize all the CSPs to 128x148 (so 7.5% smaller) and mulitply the Y component of the texture UVs by 160/148, and have the final result look the same.

I haven't done this yet because I didn't want to resize every CSP. I'm planning to try it with the Smash 3 CSPs in the future (while seeing if I can avoid using CMPR for any of them).

Also, here's another version that saves even more space, but using techniques that do change the appearance of the CSS. It does three things - removes the shadows by the faces completely, removes the names on the faces, and removes the word "SMASH" that moves around in the background. The first two are pretty clear, but to explain the third - I like the way the background looks better with just the grid lines, and the SMASH texture was 512x512, so even with CMPR it was huge. It compressed extremely well - removing it saved around 150KB uncompressed and 8KB compressed; in comparison, everything except the final ExtendedLZ77 compression in the version that doesn't change the appearance saves around 325KB uncompressed and 140KB compressed. However, when I had size issues (when replacing the 80x56 CMPR face textures with 64x64 RGB5A3 textures; later I figured out how to use CI8) it was the uncompressed size I needed to reduce, not the compressed.

You can download this version here.
 

Ondo

Smash Apprentice
Joined
Jun 20, 2007
Messages
160
So I updated this to PM 3.5, did the work to resize every CSP, found a way to reduce the CSP size even more by converting pixels that are never seen to translucent, and switched to CI8 for most of the CSPs.

I posted that version in a new thread, here, as I'm now planning to consolidate all my work into one thread. (In particular, all my other CSS work will be based off this, so I thought it made sense to have them share a thread.)
 

Amazerommu

Smash Lord
Joined
Jan 4, 2013
Messages
1,147
Location
Kentucky
So I updated this to PM 3.5, did the work to resize every CSP, found a way to reduce the CSP size even more by converting pixels that are never seen to translucent, and switched to CI8 for most of the CSPs.

I posted that version in a new thread, here, as I'm now planning to consolidate all my work into one thread. (In particular, all my other CSS work will be based off this, so I thought it made sense to have them share a thread.)
Whoa, how'd you set individual pixels to translucent? I would like to be able to do this when I add custom CSPs and such.
 

Ondo

Smash Apprentice
Joined
Jun 20, 2007
Messages
160
Whoa, how'd you set individual pixels to translucent? I would like to be able to do this when I add custom CSPs and such.
Um, I tried to cover that in the other thread? I may not have done a good job...

I have an image with the pixels set to transparent for the parts I want to keep, and black for the parts I want to switch to transparent. Then I use ImageMagick (http://imagemagick.org/) to do it - on the command line doing 'convert MenSelchrFaceB.001.png -crop 128x148 +repage Mask.gif -compose DstOut -composite MenSelchrFaceB.001.png' will both reduce MenSelchrFaceB.001.png to 128x148 and convert the pixels that are black in Mask.gif to transparent.

I've also got a batch file that will run that command on every .png in the directory and all of its subdirectories, and their subdirectories, and so on. It replaces all the PNGs with a new version, so it's dangerous. (I made the masks gif files instead of png just so that batch file wouldn't try to convert them.)

That's my method, but I'm much more of a programmer than an artist; there may be a better way for other people.
 

Amazerommu

Smash Lord
Joined
Jan 4, 2013
Messages
1,147
Location
Kentucky
Um, I tried to cover that in the other thread? I may not have done a good job...

I have an image with the pixels set to transparent for the parts I want to keep, and black for the parts I want to switch to transparent. Then I use ImageMagick (http://imagemagick.org/) to do it - on the command line doing 'convert MenSelchrFaceB.001.png -crop 128x148 +repage Mask.gif -compose DstOut -composite MenSelchrFaceB.001.png' will both reduce MenSelchrFaceB.001.png to 128x148 and convert the pixels that are black in Mask.gif to transparent.

I've also got a batch file that will run that command on every .png in the directory and all of its subdirectories, and their subdirectories, and so on. It replaces all the PNGs with a new version, so it's dangerous. (I made the masks gif files instead of png just so that batch file wouldn't try to convert them.)

That's my method, but I'm much more of a programmer than an artist; there may be a better way for other people.
Ya I saw the explanation in your other thread after I posted that haha. Sorry!
 

Ondo

Smash Apprentice
Joined
Jun 20, 2007
Messages
160
am I able to get a mirror of this? The download link isnt working
Um, there's a newer version available, described at https://smashboards.com/threads/ondos-css-workshop-less-compressed-csps.379510/page-2#post-21059120. (I've been really unorganized with my SmashBoards posts, sorry.)

That link also isn't working, for the same reason... I'll go ahead and send you a PM with the newer version, though I have to remove some of the options to reduce it below the 5MB file attachment limit. (I can send those separately if you're interested.)

If anyone else wants this, or any of my other stuff, feel free to PM me. And if anyone wants to set up a mirror of it somewhere, please let me know - I'd appreciate it, and could send the files along to you.
 
Top Bottom