Jump to content

Compressed Generic Palette editing


Chocolate Kitty
 Share

Recommended Posts

What you'll need is Feditor, a ROM, nintenlord's compressor, a hex editor(I use HxD), and your palette(s) of course.

First thing to do is find the animation you want the generic palette to in Feditor(as in the animation). I'll use the male mage as an example because it's fairly simple.

6uCLk.png

see the part I have highlighted? that's what you came looking for.

Now, open your ROM in the hex editor and search for that text string.

6uDQ5.png

now you want to look for the next name in the text side(in my case it's magf_mg1). Usually I highlight it to see exactly where it starts in the hex.

6uDRB.png

this is the beginning of that animation's data, but the 4 bytes that come before it(or the last 4 bytes of the animation you're looking for) are what's actually important.

In this case they are

F4 A0 EF 08

^ this is the address to that animation's compressed palette

0x8EFA0F4

^

Now, open up Nintenlord's compressor.

You'll want to make sure your screen looks something like this:

6uEjB.png

Input should be your ROM, output should be a blank .dmp file. Make sure to make the compression LZ77(this should look familiar to any older hackers). Put your offset into the "Input Info Offset" section and leave everything else blank. Run it and your file should look something like this.

6uEl9.png

see those 80 bytes? those are the 4 palettes you see for units(well 3, you don't normally ever see the 4th).

The order of the 20 byte palettes is

Ally

Enemy

NPC

OTHER

basically what you want to do is replace the enemy one(and any others you wish to replace) and save your .dmp file.

Now you need to just compress the data, which isn't too difficult.

6uEtX.png

your input should be the file you just edited and your output should be a new empty .dmp file.

run it, and copy that data into free space in your ROM.

Let's say you put the data in at 0x9124356(totally not a made up offset), you want to go back to where you found the original palette offset and replace it with the new one.

So

F4 A0 EF 08 --> 56 43 12 09

and that's it.

Side note:

for animations with multiple animations like the brigand(axe, handaxe, unarmed) or eliwood knight lord(sword, lance, durandal, unarmed), you'll need to find and replace all of the palette offsets. However, you should only need one actual compressed palette(unless you want the palette to change for some reason).

Edited by Skitty of Time
Link to comment
Share on other sites

Ahah I'm glad (?).

...... Wait Kitty

Unless I'm doing something wrong, this doesn't work for some reason.

[spoiler=wut]wut.png

I wanted to replace Amelia's default palette with the one you can see in the upper left corner, so I followed the tutorial and repointed my data, but the game and FEeditor still display the old palette.

Obviously that's because it is still pointing to the old palette somewhere, but I'm confused... I HAVE replaced the offset, after all. Meh?

Edit: Ok, I managed to replace it.

midnightsun49.png

I just replaced the last one of 20... yes, because there were 20 pbrf_sp1 in my ROM. Heck, there are 20 copies of ALL the animations data. Which means that the previous 19 were totally useless scrap data. And they're huge.

I suppose that's due to FEeditor which rewrites the data at the end of the ROM... what a waste of space. Does that happen every time I up the max index? Seriously, I'm disappointed, I thought that just a bit of the whole thing got rewritten under those circumstances.

So yeah folks, remember to search throughly and replace the last one you find, if you misused FEeditor like me

Edit 2: I just hope this doesn't happen every time I insert a new animation. It'd be a pain in the ass for space management.

If it happens only when I up the max index, then I can just up it by 10-20 at once and insert some placeholder animations that I'll replace later. This way the whole stuff gets rewritten only once. Not sure, though, it's just a theory. I really don't understand how FEeditor manages space

Edited by Alfred Kamon
Link to comment
Share on other sites

FE8 palettes work "weird" (compared to FE7 that is)

this is all I know on this front

as for the module, it's good for practically nothing else but that at this point >_>; I mean it's so old it uses a name I haven't been called in ages. o_O

Edited by Blazer
Link to comment
Share on other sites

every time you increase the max index of an array (text, portrait, etc) FEditor makes a complete copy of it and writes it somewhere else, then marks the space used by the old array as free space (i'm not sure about the last part but it makes sense)

in hindsight it should really corrupt or blank out the data as well so people don't run into issues like this but OH WELL I STOPPED WORKING ON FEDITOR AFTER HEXTATOR GAVE UP ON IT

Edited by CT075
Link to comment
Share on other sites

@Blazer: Weird? What do you mean? I don't know how palettes are in FE7, so I can't really understand. Are there 80 bytes there?

All I know is that FE8 doesn't use 80 bytes (20 per Allegiance) but after the first 20 (player palette) it has 30-35 bytes that must be coding something like "keep these colors and use the default ones for those others".

Basically the hair etc. stays the same, and the other colors become default red, green or gray.

Ah, I just tried with a custom compressed palette (80 bytes -> less bytes using the compression method of this topic) and that *does* work, however...

midnightsun50.png

This happens only in the link arena and only for the Ally palette.

Any ideas on why this happens? IIRC, I saw something similar in Ninja's LP of TLP some time ago.

@Cam: Ah ok, understood.

Well, I guess I can manually get the begin and end of that kind of data and transform it in 00s... It may also consider it free space, but it still is rather confusing to keep it like that.

Edited by Alfred Kamon
Link to comment
Share on other sites

it's entirely possible that fe8 is smarter about palettes than fe7 and just compresses the palettes as a set of 4 (as opposed to compressing single palettes which is what fe7 does a lot >_>)

Link to comment
Share on other sites

Ooooh!

Hey guys, I found that out! It's quite curious, haha!

FE8 palettes are FIVE sets of 20 bytes, compressed!

1) Ally palette (main story)

2) Enemy palette

3) NPC palette

4) Other palette

5) Ally palette (Link Arena)

So basically you put your 80 bytes altogether, you copy-paste the first 20 at the end of it (or you could make your own, custom Arena Link palette if you don't want the same as the one used in the story) then you compress the whole stuff, repoint, and voilà! Palette done.

@Cam: Oh that sucks. I didn't know that FE7 was so tedious about palettes. There's only one set in FE8.

Btw I just realised that that Troubadour palette sucks. Oh well, time to make another one.

Edited by Alfred Kamon
Link to comment
Share on other sites

I vaguely recall FE7 palettes also having 5 sets of palettes, but only for certain ones, idr exactly what though

and the TLP problem was just me not optimizing every palette in the game for the link arena, don't take it to mean anything special lol

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...