Pages: 1
poudink |
Posted on 06-08-20, 04:16 pm (rev. 25 by poudink on 02-07-21, 06:51 am)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Giant Red Paratroopa
Not Edible Karma: 3386 Posts: 1049/1447 Since: 02-12-16 |
Ever since NSMB hacking started in the late 2000s on Jul, more and more of the game's file formats have been figured out and became editable. With the recent completion of a certain Blender plugin which finally made Maya SDK plugins obsolete, SPA has become just about the only format in the whole game that is still uneditable. Until now. While this tutorial won't be going over how to make your own completely custom particles (not because I don't know how, but because drawing in a hex editor is too tedious for anybody to bother), I will be going over how to delete particles (we can finally get rid of those pesky snowflakes in the World 5 worldmap), how to replace any particle with any other particle from the game (as well as other games that use the SPA format), as well as (incomplete) format documentation for anyone who might want to create a proper SPA editor tool or people who really want to draw custom particles in hex, made from various information shared by Gericom and Ed_IT.
Tools Needed
Note About SM64DS If you are not an SM64DS modder or are not planning on taking particles from SM64DS, you can skip to the next section. SM64DS is the earliest known game to use the SPA format, and as such certain things hadn't exactly been set in stone. While the format remains largely unchanged from its more recent counterparts, SPA files contained within the game do not harbor the .spa file extension and instead end with "_spa.bin". Simply renaming the file to end with a .spa extension will make it work just fine in MKDSCM and you'll be able to carry on with the tutorial. That being said, most of the game's particles aren't actually contained in the game's file system at all and are instead embeded inside the arm9 binary. You should be able to find it in a decompressed arm9.bin be searching for the following: 20 41 50 53 31 30 5F 31 41 01 2E 00 00 00 00 00 File starts at the beginning of the search data. It's 0xC214 bytes long. Finding Your Particle The first step to editing the particle you want to edit will always obviously be to first find the particle you want to edit in the rom and then in your hex editor. This is what MKDSCM is needed for, as it is still the only program with the ability to view SPA files. Open your rom in MKDSCM and navigate to the particle folder, which contains every SPA file in the game (assuming you're modding NSMBDS). Then, open each file one by one and check every particle in them until you have found the one you were looking for. Write down the particle ID and extract the SPA file. Now, open the SPA file you've extracted in HxD. Every particle starts with 20 54 50 53 (" TPS" in text) and ends at the start of the next particle, except of course for the last particle which ends at the end of the SPA file. Their order within the file is the same as their order in MKDSCM, as such particle ID 0 will be the first particle in the file, particle ID 1 will be the second, and so on. Based on the particle ID you wrote down earlier, find the instance of 20 54 50 53 that belongs to your particle (I recommend using Find (Ctrl+F) and Find again (F3) for that) and select all of it. Write down the offsets, just in case. Then, move on to either Deleting a Particle or Replacing a Particle. Deleting a Particle Replace the particle you've selected with this (thanks Ed_IT): 20 54 50 53 06 F0 01 7C 40 00 00 00 60 00 00 00
10 00 00 00 70 00 00 00 00 00 00 00 70 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Save and insert the edited SPA in the rom with NSMBe. Replacing a Particle Repeat everything you did in Finding a Particle to find your replacement particle. Copy it in HxD and paste it over the particle you wanted to replace. You can take any other particle from the game you're editing or any other game that uses the SPA format. Multiple versions of the SPA format exist, but the SPT block, which is what we're editing, is the same for each of them. Here is listed each game that is known to use SPA as well as what version of the format they each use:
Save and insert the edited SPA in the rom with NSMBe. Documentation SPA Header:
SPT Particle Header:
*TexImageParam:
Sources https://drive.google.com/file/d/1imob87CKxextWIbCSDYB8A0UJGe_bDpW/view?usp=sharing https://nsmbhd.net/thread/2988-export-a-spa-to-a-bmp/ https://nsmbhd.net/thread/84-help-question-asking-thread/?from=1140#64906 TODO
_________________________ Nothing to say, so jadnjkfmnjamnfjkldnajfnjkanfjdksan jsdnvj m. |
Pages: 1