| Decompressing LZ77 compressed sprites; finding and editing them | |
|---|---|
| Topic Started: Sep 26 2008, 07:33 PM (1,772 Views) | |
| MegaRockEXE | Sep 26 2008, 07:33 PM Post #1 |
![]()
BN Guides Author
![]()
|
Okay, since I have some decent experience in this now, I think I can show others how to do this. But why do it? What is "LZ77"? You do this if you want to edit sprites that aren't normally seen in the tiles. LZ77 is an image compression format that games use to conserve space or other reasons. For our uses, this accounts for sprites not normally seen via MD Sprite Hacking. You'll need to do this if you want to get the hang of it later. Sprites not seen include boss characters, some menus, and map tiles. Now, I will use BN6 as my example (as always) and hope you follow along. The program we will be using will be Nintenlord's LZ77 Compressor. It decompresses as well. Download it and give it its own folder. Run the program and your screen should look somewhat like the one on the download site. What I suggest is that you drop a copy of the ROM you'll open to make decompressing easier. On the program screen, click Browse on Input file and select the ROM. What should be done first, if you're doing another game besides BN6 for now, is to select "scan" on the right menu. Output file should be .txt. When the scan is done, you get a list of offsets. But for now, we'll just decompress. For Output File, you can simply add "gba" at the end of the default name to make it "Outputfile.gba". This will make a file in the program folder with that name in GBA format. On the right, under Actions, choose Uncompress. You will need to input an offset to decompress on the left. Here is the scan list I got for BN6 with some names listed (and additional offsets). [box=BN6 scan list]Results: 241EC4 mettaur 2dabc8 judgeman 334b0c 43a5ac 4a642c water wave 4a74a4 old stove overworld 4a7a14 4b5734 4b6744 4cad70 4d2820 BBS 4d3998 4d4ff0 4d701c 4dc2b0 4dcbd8 4fafe4 acdc town 500f34 acdc class 502c64 503248 503ca8 central town 505680 50936c 50ba6c 50c470 50e14c 50fed8 lan's room 51077c ^ 510d6c bathroom 511af0 511df0 5120c4 514748 515544 519bb0 51a0b8 51afc4 51bc78 51d7f4 51da84 521570 5222ec 525ab0 526ae8 527ba0 52a2b0 52c578 52df44 52e78c 532840 5354a0 537610 53d3cc 53ffec 542014 54781c 54c944 550ba8 552040 553128 556f10 5573c0 5584b0 559bb4 55a07c 55b194 55c7c8 55dd70 561074 564370 566218 56c72c 56d2ac 56e510 56fcd8 5752cc 57b794 57d8e8 57f500 580f14 582320 5843c4 586080 589f5c 58cdbc 58dfb0 58e530 58f128 598340 59a11c 5a55a8 5a6fb0 5b22f4 5b4e88 5cb0c0 5ccf64 5d08ac 5d0e50 5d19ec 5d2ef8 5d3768 5d44bc 5d4e60 5d7b34 5fef20 underground tiles 601954 610b1c 610c0c 610c24 6116e0 611840 611858 612a40 612ce4 612cfc 613620 613aa0 613ab8 61445c 614a00 614a18 614df8 61501c 615034 615378 61549c 6154b4 6157a4 615968 615bbc 615d08 615d20 616044 616258 616270 6165b0 616640 617080 617184 61719c 618e14 618e34 618e4c 61918c 619468 619480 61ad94 61cef8 620360 62c170 62d0b0 632298 634e74 6376c4 63b244 66447c 665558 673428 6806a0 691164 699eec 6a6d18 6a6f14 6a71d4 6a7294 6a7394 6a7454 6a7494 6a8154 6a8698 6a86b0 6a8c3c 6acf70 6ada28 6ae468 6ae488 6ae4d8 6b06e0 6b0700 6b0aa0 6ce51c 6ce724 6d78c0 6ddba0 panels 742318 7463f4 746e38 74e6e0 752818 7691e4 76a5b4 76e698 776a20 77e03c 782048 7822f4 78a4e0 78e728 7979cc 79c728 7a41c8 7aca44 7accc8 7adc00 7b25a4 7ba764 7bf09c 7bf348 7d16d0 7d27b0 7d4de0 7f4394 title screen[/box] Most will have something in it, and some won't. Pick one. I will pick Mettaur. Paste 241EC4 in the Offset box and click Run. A confirmation box should pop up. This means it worked. Now you can open the Output file the program made in Tile Molester to see the uncompressed contents. ![]() That's what was compressed. Now you can edit it all you want. The palettes are in there too. I'm not quite sure if APE would work here, but I doubt it would. But what's just as important is compressing it back. Okay, say you made some changes to it and saved. Now the process is reversed. In the program, make the input file the outputfile.gba and the output file as the BN6 ROM. Now, in the Output info field, put the original sprite offset, 241EC4. Make sure to check "Compress" under the Actions field. Once it's all set, click Run, and it should be complete. Now you can check your changes by opening up the ROM and seeing the sprite. You have successfully recompressed sprite data! Now, FYI, that scan list isn't the full thing. You haven't actually been able to edit any boss sprites and such. Those offsets can be found another way. In BN6, put this in the memory viewer. 32-bit . 08031CEC This is what I like to call the "Sprite List". Anything from the sprite categories explained in MD Sprite Hacking can be found here. Identify it. They are all offsets. The one in the upper-left is Megaman's in battle sprite. Remember from "finding sprites in TM"? Those offsets apply here, too. The offset you see in the memory viewer when finding the sprite is the same one you see here, just minus 4. Now, about compressed sprites. Scan the list for offsets that start with 88 instead of 08. These are the only ones that work. You will find the Mettaur's sprite offset here as well. I'll pick one at random. I see 882E8470. This is definitely compressed. In the LZ77 Compressor, make sure to set the input and output files properly. Put only the part of the offset without the 88. It will always be this way. So I would put 2E8470. Uncompress this and open the output gba file in TM (it should be readily available when you click Open). It's Falzter. In all its entirety. Palettes an all. Get how it works? Try them all to get the hang of it. Almost all the sprites in game are available to edit now! Any questions, ask here. I may have missed something or rushed something. |
| The Rockman EXE Zone | YouTube | |
|
|
|
| beastfang | Nov 3 2008, 06:48 PM Post #2 |
|
Dedicated Member
|
I get this stuff but how do you put the images in the TM to wear you can edit them? |
|
|
|
| MegaRockEXE | Nov 3 2008, 08:14 PM Post #3 |
![]()
BN Guides Author
![]()
|
Just open the file with it. That's why I say to save it as .gba so it can be opened in the right type. |
| The Rockman EXE Zone | YouTube | |
|
|
|
|
|
Nov 29 2008, 02:57 PM Post #4 |
|
Programmer!
![]()
|
nice i'm gonna try this tomorrow and ill tell you guys if i got it. |
|
|
|
|
|
Feb 4 2009, 06:16 PM Post #5 |
|
Programmer!
![]()
|
I said this WAY to late but I've got this easy. |
|
|
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Off-Topic · Next Topic » |



