[Intermediate] 50 Costume Code Implementation Guide

Started by KingJigglypuff, February 26, 2019, 11:16:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

February 26, 2019, 11:16:52 PM Last Edit: January 12, 2021, 04:16:24 AM by KingJigglypuff
-Introduction-
For those out of the loop, PyotrLuzhin had plans for a 20 Costume Project (dubbed 20 CP), which would allow users to surpass Brawl's 10 costume limit (15 if you took the time to edit cosmetics to prevent cosmetic bleeding) with a new 20 costume limit. In Pyotr's absence, DukeItOut has released a 50 Costume Code (dubbed 50 CC), which further pushes that limit to 50 costumes. This guide will help you implement 50 CC into your custom build.

-Credits-
PyotrLuzhin: For his work on 20 CP.
DukeItOut: For his work on 50 CC.
Sammi_Husky: For his work on the bx_fighter.rel

-Requirements-
-Your sc_selcharacter.pac file (located in pf > menu2).
-Your info.pac file (if using a Project M-based build, located in pf > info2).
-Your STGRESULT.pac file (located in pf > stage > melee).
-Your InfFaceXXX.brres files (located in info > portrite). You must extract every single file and put them into their own folder. If you're missing any vBrawl files, then dump them from your ISO and insert them into the same folder (skip any file conflicts, as otherwise, you would be replacing your custom InfFace files by mistake).
-Duke's edited sora_menu_main.rel file (place this inside the pf > module directory)
-BrawlCrate (Current version is v0.23)

-Disclaimers-
General Disclaimer: In case of potential user-side mistakes, please back up your build before attempting to implement 50 CC into it as we will not be held responsible if something happens in your build.

Disclaimer for adding costumes: Avoid using Costume 12, as that's what FitFighterDark uses.

Disclaimer for Brawl users: The Stock Icons used on the Stage Selection Screen (sc_selmap.pac) are currently unsupported by the 50 CC Engine. While they can be converted to prevent crashing, I would recommend editing your sc_selmap.pac file to remove them them through other means, as I will not go over on how to convert your sc_selmap.pac file.

Disclaimer for BrawlEx/PMEX Users: In addition to the requirements above, you'll also need to replace your bx_fighter.rel (located in pf > module) with this edited version (made by Sammi_Husky and I). Additionally, you'll need to increase the size of whichever CSSSlotXX.dat files you plan on adding additional costumes to in addition to editing your FighterXX.dat files to enable the two unknown flags under the HasCostume flags (you can use BrawlCrate to do both of these tasks).

Note: This edited bx_fighter.rel is based off of BrawlEx v2.0.0.0, so make sure to update your common2 and common3 files to the latest version before progressing.

Disclaimer for adding more than 10 costumes: Upon adding an 11th costume, BrawlCrate's conversion will assume your 11th costume onward is a new Cosmetic ID and will require you to manually rename any associated textures and PAT0 entries, or else they will crash upon loading (because the game tried to find a texture that doesn't exist)

-Required Codes-
Before you begin, you'll need to insert the following codes into your codeset (GCT file):
Sorry but you are not allowed to view spoiler contents.
This code is the 50 CC Engine and will require converting all your BPs and Stock Icons to work with the 50 CC system (I'll go over how to do so with the next section).

Quote* 00692507 00000032
* 046A17D8 30346400
* 00692DA7 00000032
This code applies a patch to the Stock Icons used in the Classic Mode CSS and Co-Op Single Player Mode CSS. For organization purposes, you can just add this code to the end of the 50 CC Engine code.

Now this next code is entirely dependent on if you're using a Project M or PMEX based build.

If your build is based off Project M, then search for this code...
Sorry but you are not allowed to view spoiler contents.
..and replace it with this code.
Sorry but you are not allowed to view spoiler contents.
This code replacement will convert the Stock Icons used in Multiplayer battles for 50 CP compatibility.

However, if your build is based off of PMEX, then you would instead search for this code...
Sorry but you are not allowed to view spoiler contents.
...and replace it with this code.
Sorry but you are not allowed to view spoiler contents.
This code does the same thing as the previous, except edited to be compatible with PMEX's memory range.

Once you have your codes inserted and your files extracted, you'll then need to use BrawlCrate to convert your files.

-Converting sc_selcharacter.pac-
After opening your sc_selcharacter.pac in BrawlCrate, navigate to MiscData[90], right click on any of the Stock Icon textures and click "Convert to Expanded 50-Stock System". After converting, a PAT0 animation will be leftover. Delete this, as the sc_selcharacter's Stock Icons do not require a PAT0 animation to work. Save afterward.

-Converting info.pac-
After opening your info.pac in BrawlCrate, navigate to MiscData[30], right click on any of the Stock Icon textures and click "Convert to Expanded 50-Stock System". The associated PAT0 animation will automatically update alongside the conversion. Save afterward.

-Converting STGRESULT.pac-
After opening your STGRESULT.pac in BrawlCrate, navigate to MiscData[120], right click on any of the Stock Icon textures, and click "Convert to Expanded 50-Stock System". After converting, a PAT0 animation will be leftover. Open this PAT0 animation, rename its texture reference from "lambert87" to "stock_lambert87", export it, navigate to MiscData[110], and replace the PAT0 animation of the same name with the PAT0 you exported. You can then delete the leftover PAT0 in MiscData[120]. Save afterward.

-Converting StockFaceTex.brres-
After opening your StockFaceTex.brres in BrawlCrate, open the Textures folder, right click on any of the Stock Icon textures, and click "Convert to Expanded 50-Stock System". After converting, a PAT0 animation will be leftover. You can delete this PAT0 animation and save afterward.

-Converting InfFace files-
When converting any stock icons, you'll be met with a window asking if you want to convert your InfFace files. If this is your first time, click Yes, navigate to the folder you extracted your files to, select it, and click OK. After you've done this once, you can click No whenever the window pops up.

Update (01/11/2021): When I say to update the InfFace files, this means all of them, Single-Player content included. This post update includes a shared zip file to update the BPs for Sandbag, Master Hand, Crazy Hand, and the Alloys. https://cdn.discordapp.com/attachments/301887313708056588/798404965876891658/Single_Player_50CC.zip

Once you're done converting all your files, you can now insert them back into your SD Card (or Virtual SD Card if emulating) and enjoy the benefits of expanding your costume count.
I don't take requests.

My PSA Thread
[move][/move]

Now, Pikachu can realise its true potential with 49 hats!

It's absolutely fantastic that this is up now, I need to look at it soon as I can. haha.
I still talk to myself! If anyone wants to use anything I've done, feel free to! But do tell me where you use it, I want to see the finished product!

February 28, 2019, 02:26:07 AM #2 Last Edit: February 28, 2019, 02:28:54 AM by DukeItOut
A few other things to keep conscious about:

Both Brawl and PM packed the costume flag data tightly together. If not using BrawlEX, you'll need to find free memory space to move expanded characters to so that they don't fight. (If you've rearranged your common .pac files akin to how PM did, free space should be available around 80546000-80547000 for this kind of thing.)

Keep conscious that this does not avoid sc_selcharacter.pac filesize limitations. You either need to use a code to load RSPs on the CSS (which is not compatible with .pcs files and is unstable) or use colorsmash once you hit a certain size, though otherwise things are basically the same.

Likewise, this holds true for the PM-style stock icons in-game, too. Once you get to about beyond 200 additional of what LTE has (which itself is probably around 70 more than in PM), you'll start needing to either compromise UI resolution or use generic stock icons like with Brawl.

Similar stock icon issues plague the SSS in terms of compromising filesize, which is related to the lack of current support for SSS stocks.

If my build doesnt use stock icons or BP's can I skip those portions?

If your build doesn't use either of those, then you don't even need to use 50 CC, as what 50 CC does is multiply Cosmetic IDs for Stock Icons and BPs by 50 to prevent cosmetic bleeding with more than 10 costumes.

CSPs don't bleed into each other, as those go by ID, rather by name.
I don't take requests.

My PSA Thread
[move][/move]

March 01, 2019, 03:35:42 AM #5 Last Edit: March 01, 2019, 03:42:20 AM by Lillith
It's entirely possible I'm blind or missing something obvious, but what needs to be done involving BPs? They're all funky and distorted and such ...For a bit of reference, currently I'm only using this to expand to 20 costumes, not the full 50 (So treating them like Wario, just using 2 cosmetic slots), if that helps.



Edit: It's also entirely possible that this is a by-product of not doing everything, seems my BP names are messed up too. If so, then damn.
I still talk to myself! If anyone wants to use anything I've done, feel free to! But do tell me where you use it, I want to see the finished product!

I have an entire section in the tutorial dedicated to InfFace file conversion.

Quote from: KingJigglypuff on February 26, 2019, 11:16:52 PM-Converting InfFace files-
When converting any stock icons, you'll be met with a window asking if you want to convert your InfFace files. If this is your first time, click Yes, navigate to the folder you extracted your files to, select it, and click OK. After you've done this once, you can click No whenever the window pops up.
I don't take requests.

My PSA Thread
[move][/move]

Ah, I keep forgetting that that's what they're actually called. Yikes.
Apologies for the stupidity, haha.
I still talk to myself! If anyone wants to use anything I've done, feel free to! But do tell me where you use it, I want to see the finished product!

Would you mind going over how to edit the FighterXX.dat? At first I didn't think it was needed since I was able to get 15 costumes working without it but then I ran into a problem trying to load Costumes 12 & 13.
Costume 12 loads the Dark files ("Emerald" characters from Subspace) while 13 always freezes. I think it's supposed to be loading the Fake files which most characters don't have but even Samus froze despite having those so I'm not sure.
Sorry but you are not allowed to view spoiler contents.


Anyways since you said that we'd have to edit it to allow 15 costumes I'm assuming that it'll move which ID the Dark & Fake costumes use, however I'm not sure how to edit it in BrawlCrate.
This is what the file looks like when I open it in BrawlCrate:
Sorry but you are not allowed to view spoiler contents.


There were no options to add "Has CostumeXX" or to add anything really. I thought maybe you had typed the wrong file name and it was actually supposed to be CosmeticXX.dat or SlotXX.dat but those don't deal with the actual Costume IDs.



Another thing, the code to fix the Classic Mode Stock Icons is the correct one right? I tried a few times in case I messed something up but either you accidentally posted the wrong code or it's just not being loaded for me. Originally I had it attached to the main 50CC but then tried it as a separate code and it still didn't load. I am using a Virtual SD Card to play the American copy of Brawl on the Dolphin Emulator. Since you didn't provide a separate code for it, it shouldn't matter that I'm using a PMEX Build but might as well mention it just in case.
I make YouTube videos, SM64 hacks, Brawl Hacks (obviously), NSMBW hacks, and GoldenEye 007 Mods. I also have a short attention span and tend to switch around a lot and put things on hold. But when I do finish things, 95% of the time I gave 120% effort, the other 5% of the time I give 100% effort.

I'm not so sure on everything yet, still need to test it properly, but I do know that you need to set all of those 'Has Costume' things to false, as the masquerade code implies that sets the 50 costume thing properly, the CSSSlot thing is to set how many costumes 'actually' get used. I'm not so sure on costumes 13/14 yet, although when I tried on Dolphin it did indeed seem to try to load the 'Fake' costume for 14
I still talk to myself! If anyone wants to use anything I've done, feel free to! But do tell me where you use it, I want to see the finished product!

Looks like I forgot FighterXX.dat only goes up to the 11th costume. Additionally, I forgot to mention you're supposed to skip FitFighter12, as costume slot 12 will load FitFighterDark instead. No idea about FitFighterFake though, as I'm using FitFighter13 and FitFighter14 just fine.

Though for the FighterXX.dat configuration, in addition to your vanilla costume selection, you'll need to enable both Unknown Flags under your costume count.

Quote from: StupidMarioFan1 on March 02, 2019, 08:35:15 AMAnother thing, the code to fix the Classic Mode Stock Icons is the correct one right? I tried a few times in case I messed something up but either you accidentally posted the wrong code or it's just not being loaded for me. Originally I had it attached to the main 50CC but then tried it as a separate code and it still didn't load. I am using a Virtual SD Card to play the American copy of Brawl on the Dolphin Emulator. Since you didn't provide a separate code for it, it shouldn't matter that I'm using a PMEX Build but might as well mention it just in case.
Yes, the codes provided in the opening post are the correct ones. So it must be an issue on your side, but I wouldn't know how I could help you troubleshoot it. Would you happen to have a codeset for your build on hand? Additionally, you could send your build to me prior to attempting the 50 CC conversion? As that might be the best way to help you troubleshoot, as I would be experiencing your issues firsthand.
I don't take requests.

My PSA Thread
[move][/move]

Quote from: KingJigglypuff on March 02, 2019, 02:19:06 PM
Yes, the codes provided in the opening post are the correct ones. So it must be an issue on your side, but I wouldn't know how I could help you troubleshoot it. Would you happen to have a codeset for your build on hand? Additionally, you could send your build to me prior to attempting the 50 CC conversion? As that might be the best way to help you troubleshoot, as I would be experiencing your issues firsthand.

I had a few characters added to my PMEX build but I've tested it on a clean PMEX v0.5 and still got the same problem. Besides the Costume 13 freeze everything else works as intended.
Here's the gct as well as the text file incase I simply used the wrong program (used GCTEdit v1.0) however I doubt that was the problem since the actual costume code works.
Sorry but you are not allowed to view spoiler contents.
I make YouTube videos, SM64 hacks, Brawl Hacks (obviously), NSMBW hacks, and GoldenEye 007 Mods. I also have a short attention span and tend to switch around a lot and put things on hold. But when I do finish things, 95% of the time I gave 120% effort, the other 5% of the time I give 100% effort.

Since they're in the beginning of your codeset, maybe they're being overwritten by a later code, perhaps? Could you try putting the 50 CC codes at the bottom of your codeset, rather than the top?

For inserting codes, I just hex edit the GCT.
I don't take requests.

My PSA Thread
[move][/move]

A question before I look into this: Is the 50 costume code compatible with BrawlEx Clone Engine v2.0.0.0 Extended Edition (RSBE.Ver)?
Brawlex Advancements (Supplement to the Brawlex thread's original post)
I use RSBE Brawlex v2.0.0.0 Extended, Win 11, and 3ds Max (3ds Max Guide). Refresh to see my imports!

Now that's something I wouldn't know, as it's not something I'd use, but in theory, it should.
I don't take requests.

My PSA Thread
[move][/move]