YesNoOk
avatar

Making character SFFs universally compatible  (Read 21602 times)

Started by Winane, July 04, 2004, 07:39:50 am
Share this topic:
Making character SFFs universally compatible
#1  July 04, 2004, 07:39:50 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Decided this is probably worth having a topic in the Tips and Tutorials forum, so I copy/pasted this from a post I made a while ago in the Help forum:

Here's how to make character SFFs optimized and compatible with both DOS and Linux Mugen:

If sprite 0,0 exists anywhere in the SFF, then it's best to put:
9000,0 first
9000,1 second
other sprites third
(In this case, it doesn't seem to matter whether 9000,0 or 9000,1 comes first, if both have individual palette.
But 9000,0 requires an individual palette, while 9000,1 does not.  So you may as well always put 9000,0 first.)

If sprite 0,0 does not exist in the SFF, then it's best to put:
9000,0 first
(9000,1 can come second only if its palette is shared)
normal sprites with shared palettes second
9000,1 (if it's got an individual palette) and any other individual palette sprites last

And in both cases, remember that all normal sprites other than the portraits should be set to use shared palettes (well, unless you want to take advantage of the way Linux handles the palettes to overcome the 255 color limit, at the expense of DOS Mugen compatibility...).
And of course, Sprmaker's -c and -f switches are also still your friends. :)  (Well, unless you've got more than 32767 sprites in your SFF, in which case -f may not be your friend.)


Anyway, it seems that the presence of sprite 0,0 makes Linux Mugen give all shared-palette sprites the same palette (normally the one specified by the current ACT file--haven't yet tested what happens when there is no ACT file), while its absence makes Linux Mugen give shared-palette sprites the same palette as the previous sprite.  So, if sprite 0,0 is present, I assume it's best to put both portraits at the beginning of the SFF in order to speed up Mugen's loading time, so it doesn't have to search all the way to the end of each SFF to find what it needs for the select screen.


It's also important to note that M.C.M. does not reveal what order the sprites in the SFF are in, nor does it let you specify what order to put them in, so I think it cannot be used to implement the guidelines I've provided here.  MEE does, on the other hand, but with it you have to worry about some major bugs in SFF2PCX (such as being likely to screw up the small portrait's palette), since MEE works as a front-end to that program.  You can make your SFF with programs other than Sprmaker if you want, but when you're done, I think you'll need to use Sffextract and Sprmaker and a text editor to then put the sprites in the proper order (unless you know how to circumvent MEE/SFF2PCX's bugs, which I don't really feel like explaining in this post :P ).


Let me know if this needs any clarification, correction, or additional information.


Edit:  This post isn't entirely accurate and complete.  Please read Reply #4, Reply #8, Reply #13, and Reply #17 below.  I'll tidy things up here later.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Last Edit: August 28, 2004, 03:27:50 am by Winane
Re:Making SFFs universally compatible
#2  July 04, 2004, 07:42:02 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Guess this might be worth reposting too, in case anyone has the same question:
But 9000,0 requires an individual palette, while 9000,1 does not.

Wasn't it the other way around, considering 9000,0 is the small portrait?...

9000,0 looks screwed up on the select screen in Linux if you don't give it an individual palette, so it needs one.  (In game, however, sprite 9000,0 will always receive the palette from the currently selected ACT file; or if there is no ACT file, then it will always receive the palette of the first sprite in the SFF.  This is in contrast to how most sprites are treated, which I've described above.)

9000,1 may be given an individual palette, but it will display correctly on the select screen if it uses a shared palette (in which case it will always be given the palette of the first sprite regardless, rather than the palette of the previous sprite edit: unless it comes before 9000,0).  It's not necessary to give it a shared palette, but if you've got enough extra room in your main palette, you may as well save 768 bytes in the SFF by giving it one.  (Edit:  In game, it's treated the same way as any other sprite.  So, sprite 9000,0 is presumably the only sprite that receives special treatment (not counting sprite 0,0's effect on the entire rest of the SFF in-game).)


This info corrected below.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Last Edit: August 28, 2004, 02:17:48 am by Winane
Re:Making character SFFs universally compatible
#3  July 04, 2004, 11:53:25 am
  • I'm a llama!
Let me know if this needs any clarification, correction, or additional information.
Yes, additional information: what is the best and easy tool to use to do this when using windows XP?
Re:Making character SFFs universally compatible
#4  July 04, 2004, 12:17:17 pm
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Well, I don't have Windows XP, so I don't know whether and how well each program works on it.
Personally, I just use Sprmaker and a text editor for compiling my own SFFs.  But for people who really want a GUI for whatever reason, well, it's up to you what you use to make the SFF.  Just make sure that you don't give any two sprites the same group and image numbers (which is really quite pointless to do, since only the first one will ever appear in Mugen), so that the current not-yet-complete version of Sffextract doesn't screw anything up when you use it to sort the final SFF, and you should be fine.

Or did I misinterpret your question?  The pronoun "this" in your post was kinda vague.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Re:Making character SFFs universally compatible
#5  July 24, 2004, 09:34:14 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
I just now did some more testing, and found that my understanding of how the palette stuff works on the select screen wasn't quite right.  (Guess I shouldn't have stopped experimenting once I found a reliable solution.)  So, this is the way it actually works in the newer versions of Mugen:

9000,0 and 9000,1 are actually treated equally, and all other images are completely irrelevant.

If both 9000,0 and 9000,1 are given individual palettes, then both will display properly on the select screen, of course.
If the first one in the SFF is set to use a shared palette, then it will be given a garbage palette.
If the second one in the SFF is set to use a shared palette, then it will be given the same palette as the other one (regardless of whether the first one's palette was individual or filled in with garbage).
So if neither is given an individual palette, then neither will display correctly.

The garbage palette is merely the 768 bytes immediately following the PCX data in the first of the two images.  (Note for those interested in the technical stuff:  By "PCX data", in this case I mean the stuff concluding with the requisite 0x0C (decimal 12) byte, i.e. the data preceding the palette in the 8-bit PCX format, regardless of whether the palette has been removed by the SFF compiler or not.)

If the subheader of the first image indicates its palette is shared, but its palette data wasn't actually removed, then it will display fine, since the next 768 bytes are actually its palette.  (So, I guess I shouldn't have called it a garbage palette, since in this particular case it's not. :P )
But if the subheader of the second image indicates its palette is shared, but its palette data wasn't actually removed, then it will still receive the palette data of the first image despite the presence of its own palette.

This new understanding has absolutely no effect on the image order I recommended in my first post, though.  Just thought some people might be curious. :)


By the way, in case anyone missed the announcement in the Releases forum, Sffextract as of version 0.8 is finally safe to use to fix SFFs with these guidelines (just so long as you use it properly, of course).  :D
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Last Edit: July 30, 2004, 12:17:48 pm by Winane

OrochiKOF97

Re:Making character SFFs universally compatible
#6  July 24, 2004, 02:22:46 pm
Quote
If both 9000,0 and 9000,1 are given individual palettes, then both will display properly on the select screen, of course.
If the first one in the SFF is set to use a shared palette, then it will be given a garbage palette.

My 9000,0 sprites use a shared palette and they display properly in MUGEN.  ???
Re:Making character SFFs universally compatible
#7  July 24, 2004, 03:46:20 pm
  • *****
    • cutemugen.free.fr
me too
Read more carefully the posts :D
#8  July 24, 2004, 07:12:30 pm
  • *****
  • can see your halo
    • Germany
    • Skype - panchasell
    • www.mugenguild.com/
If the subheader of the first image indicates its palette is shared, but its palette data wasn't actually removed, then it will display fine, since the next 768 bytes are actually its palette.

But, yes, it made me wonder at first, too.

Because I also have 9000,0 first and no problems.
"Several times now, Achamian thought he had glimpsed golden haloes about Kellhus's hands. He found himself envying those, such as Proyas, who claimed to see them all the time."
--R. Scott Bakker
The Thousandfold Thought (2006)
Last Edit: July 24, 2004, 07:13:31 pm by Sepp
Re:Making character SFFs universally compatible
#9  July 24, 2004, 09:38:31 pm
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Yep, what Sepp said.  :)

Besides, Clark's 9000,0 and 9000,1 sprites are both set to use their own individual palette.  :P

There might be some confusion with terminology here.  When I say an image is set to use a shared palette, I'm not referring to whether any other sprites are going to use its palette data.  I just mean that it's set to use the palette data from some other sprite, instead of its own palette data.  There's a byte in the subheader for each image that indicates this (whether to use a shared palette or its own individual palette).
And normally, when you tell it to use a shared palette, most SFF compilers will remove its palette data to save space.  But it is possible to set the subheader to indicate shared palette without actually removing the palette data at the end of the PCX file.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )

OrochiKOF97

Re:Making character SFFs universally compatible
#10  July 24, 2004, 10:12:43 pm
No, Clark's 9000,0 has a shared palette, and I understood what you posted above.
Re:Making character SFFs universally compatible
#11  July 24, 2004, 11:01:40 pm
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Um, nope, in the clark03.sff file from your Clark v0.91a, 9000,0 is set to keep its own palette:
Quote
; ElecbyteSpr 0.1.0.1
; 150 groups
; 1098 images
;
; Options
#
; Palette
1
; Shared palette
2
; End of options
;
; Output file
clark03\clark03.sff
; Individual palette
#
1
1

clark03\90000000.pcx
9000
0
0
0
clark03\00000000.pcx
0
0
35
106
etc...


By the way, here's a little more info about how Sprmaker works:
If you specify global shared palette, then the first image's subheader in the SFF will always be set to individual palette, even if you specifically tell it to set the first image to use a shared palette.
But if you don't specify global shared palette, and you do set the first image to use a shared palette, then the first image's subheader will be set to shared.  It will retain its palette anyway, though, so it won't affect anything in Mugen.
(Side note:  It looks like I recently broke processing of the latter type of SFFs in Sffextract.  Already fixed it, so it'll be in the next update, which I guess will be released as soon as Dark Saviour resurrects himself.  I've only noticed a few SFFs affected by it though (e.g. Splode's Hiryu & Deuce+Kitsune's Geese, if I remember correctly).)

Other than that, as far as I know, CharSffDtoW is the only SFF compiler that ever sets the subheader to shared but without removing the palette data.

Edit:  Decided not to wait for Dark Saviour.  Fixed Sffextract now released.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Last Edit: July 25, 2004, 05:05:25 am by Winane

OrochiKOF97

Re:Making character SFFs universally compatible
#12  July 25, 2004, 12:58:51 am
Quote
; ElecbyteSpr 0.1.0.1
; 148 groups
; 1098 images
;
; Options
#
; Palette
1
; Shared palette
2
; End of options
;
; Output file
clark03\clark03.sff
clark03\0900000000.pcx
9000
0
0
0

clark03\0000000000.pcx
0
0
35
106
clark03\0000000001.pcx
0
1
35
106
clark03\0000000002.pcx
0
2
35
106

You hacked the SFF file, you removed 2 groups and added that just to make fun of me  >:( >:( >:( it seems that the 0.91a doesn't have the very latest version of the sff file, that's why I was insisting on the fact that clark did not have his small portrait treated as an individual palette. Anyway those explanations on SFF compilation through this thread were useful to me.
Re:Making character SFFs universally compatible
#13  July 25, 2004, 08:11:58 pm
  • ****
  • Chicks dig me. (SDS Overfiend is the Gamertag)
    • wrestlingarena2.free.fr/star.html
Quote
me too
how did you have trouble with xiang fei kos?
was the portrait last or something?
i swear, Stupid muthafokkers exist all over this board!
Nonetheless Dickriders get all of the Attention!
Go Figure.
--------------
Yes online Gaming is important........ Who Else are you gonna practice on?
http://wrestlingarena2.free.fr/star.html

Beta Kagetsura can still be found here.
http://wrestlingarena2.free.fr/Kagetsura.rar
Re:Making character SFFs universally compatible
#14  July 26, 2004, 10:02:53 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
I'm afraid your questions aren't quite comprehensible, Homer. ???


Anyway, here's a quick write-up of what's basically the algorithm I use to fix DOS character SFFs to be optimized and universally compatible, using Sffextract 0.9:
(Yes, I know there are easier ways, but if you want it done properly, safely, reliably, and optimally, then this is currently the only way to go.)

-Run Sffextract with:
  sffextract -d -i -o charname.txt charname.sff

-If you encounter any invalid linking errors:
  *Start over, but this time add the -f switch.

-If you encounter either of these warnings:
    "Warning: Invalid number of groups specified in header."
    "Warning: Nonstandard subheader size specified in header."
  *Then just ignore them. =P  They won't cause any harm.

-If the console window doesn't report any other errors, warnings, or notices, then:

  *Open up charname.txt.

  *If the third uncommented line says "1" (preceded by a line that says "; Individual palette"), then:
    _Start over, but this time add the -1 switch.  (Note: This step assumes that the character's SFF was designed for use in DOS Mugen.  But if the SFF were designed to take advantage of post-DOS Mugen's ability to break the 255 color limit, then you probably wouldn't be fixing it anyway. =P )

  *Find image 9000,0 (search for "0900000000", if you haven't used -8 or -x).  Move it to the beginning of the SFF file.
  *Check whether image 0,0 exists (search for "0000000000", if you haven't used -8 or -x).
  *Find image 9000,1 (search for "0900000001", if you haven't used -8 or -x).
  *If image 0,0 exists, then:
    _Move image 9000,1 (including #/1/1, if they precede it) to come right after image 9000,0.
  *Else, if image 0,0 doesn't exist, then:
    _Check whether image 9000,1 is preceded by #/1/1.
      ~If so, then move image 9000,1 (including #/1/1) to the very end of the file.
      ~If not, then move image 9000,1 to come right after image 9000,0.
  *Do a search for the word "Individual".
  *For any images preceded by the comment "Individual palette" (and #/1/1):
    _Open up the PCX file.
    _If it looks like an alternate portrait or something else that might really ought to have its own palette, compare its palette to the palette of the first sprite in the SFF.  If the palettes are incompatible, then move the image (including #/1/1) to the very end of the file.
    _Otherwise, if it looks like a normal sprite that you'd see in-game, and you're sure the SFF wasn't designed for use in post-DOS Mugen, then delete the #/1/1 preceding it in the text file.
  *Run sprmaker -c -f -p < charname.txt

-If you encounter any "Image kept own palette despite subheader" notices, then:
  *Treat those images as I instructed for "Individual palette" images, but add #/1/1 if you determine that they should keep their palette.

-If you encounter any "Image is not in 256-color PCX format" notices, then:
  *Give up.  It's not worth fixing, unless you really, really like the crappily made character you're dealing with. =P :)
  *If you refuse to give up, then convert the problematic images to be 8-bit palettized, using nearest color matching when applying the character's default ACT file.  Or something like that.

-If you encounter any "Extra image saved as: " notices, then:
  *Ignore it if you want.  The recompiled SFF will appear in Mugen the same way it did before.
  *But if you want a properly made SFF file, then investigate those images:
    _If any duplicately numbered images are identical to the first image with that group+image number, and they all have the same axes, then simply delete the duplicates from the text file (but keep the first instance of the image, of course).
    _Else, if they're not identical, try to determine which one really belongs with that group+image number.  (This requires some basic understanding of how all this SFF, AIR, and whatnot stuff works.)  Make reference to Elecbyte's spr.txt and spr.gif if the images in question are required sprites.  Otherwise, take a look at the character's AIR file.  Then, either remove or renumber the images that don't belong, as appropriate, and make any necessary changes to the AIR file if applicable.

-If you encounter any other errors or warnings, then:
  *Deal with them as appropriate. =P

-If you encounter too many notices, warnings, and error messages to fit in the console window, then:
  *Either start over using the -w option.  For example:
      sffextract -d -i -o charname.txt -w stderr.txt charname.sff
  *Or simply always use the -w option, so you never have to start over.  Just be sure to always remember to check the contents of the diagnostic messages file.


So, like Faye/Chloe/Kos-Mos/Athena said, it's all very simple. ^_^

If anyone would be so kind as to put all that into a more readable and understandable form, I'd be most appreciative. ^^  And of course, please let me know if anything here needs amending.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Last Edit: December 11, 2004, 11:22:05 am by Spinoza
Re:Making character SFFs universally compatible
#15  July 26, 2004, 10:50:53 am
  • *****
    • cutemugen.free.fr
yes it's simple, isn't it ?
 
Re:Making character SFFs universally compatible
#16  July 28, 2004, 04:51:49 am
  • ****
  • Chicks dig me. (SDS Overfiend is the Gamertag)
    • wrestlingarena2.free.fr/star.html
Quote
I'm afraid your questions aren't quite comprehensible, Homer.
i meant to say that if 9000,0 is not first while 0,0 existedthen it will come out mess up right?
i swear, Stupid muthafokkers exist all over this board!
Nonetheless Dickriders get all of the Attention!
Go Figure.
--------------
Yes online Gaming is important........ Who Else are you gonna practice on?
http://wrestlingarena2.free.fr/star.html

Beta Kagetsura can still be found here.
http://wrestlingarena2.free.fr/Kagetsura.rar
Re:Making character SFFs universally compatible
#17  July 29, 2004, 05:54:43 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Umm, as explained on the first page of this thread, image 0,0 generally has no effect on image 9000,0 (well, unless the character has no ACT files and image 0,0 is the first in the SFF, in which case image 0,0 determines image 9000,0's palette in-game).  And image 9000,0 generally has no effect on image 0,0, either.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Re: Making character SFFs universally compatible
#18  August 28, 2004, 02:36:36 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Jeez, all this time and no one discovered how horribly wrong my explanation was?  ??? ^^
The stuff I wrote about how the portraits are dealt with on the select screen is true, but my theory of in-game palette treatment was not.

First of all, as I said, there's a byte in the subheader for each image in an SFF file that indicates whether the image should use a shared palette or its own individual palette.  According to Elecbyte, this byte is set to "True if palette is same as previous image," but that's not exactly correct.  I don't feel quite inclined to rewrite this all in layman's terms, but here's a brief explanation of how it all really works, copy/pasted from our revised formats.txt:

    This byte is ignored (assumed to be 0) in Mugen if the image is the first
    image in the SFF file.  Otherwise:

    If this byte is set to 0 and the SFF belongs to a stage or other
    non-character, or to a character while on the select screen, then
    the image will retain its own palette.

    If this byte is set to 1 and the SFF belongs to a character while on the
    select screen in DOS Mugen, then the image will use the palette data of the
    first sprite in the SFF file.

    If the image is part of a character SFF in-game (that is, during a match or
    win screen) in DOS Mugen, then it will receive the palette of the currently
    selected ACT file, or else the palette of the first image in the SFF if the
    character has no ACT files, regardless of what this byte is set to.

    If this byte is set to 1 and the SFF belongs to a stage or other
    non-character, then the image will use the palette data of the
    previous sprite in the SFF file.

    The interpretation of this byte in character SFFs in Linux Mugen is a little
    more complicated.  Generally, images in character SFFs in-game in Linux
    Mugen retain their own palette if this byte is set to 0, or receive the
    palette of the previous image if this byte is set to 1.  But if the image is
    numbered as 0,0 or as 9000,0 (given that it's the first image 0,0 or the
    first image 9000,0 in the file; any subsequent identically-numbered images
    are ignored), then the image will receive the palette of the currently
    selected ACT file, or else the palette of the first image in the SFF file if
    the character has no ACT files, regardless of what this byte is set to.  And
    then that palette is also applied to any other images that would have
    otherwise shared the same palette as one of those two images (that is, any
    subsequent images marked as using a shared palette, up to but not including
    the next image marked as having an individual palette; and, if the image 0,0
    or 9000,0 is marked as using a shared palette, then also any previous images
    up to and including the nearest prior image marked as having an individual
    palette.)

    Furthermore, the palette selection method for sprites 9000,0 and 9000,1 is
    completely different on the select screen in Linux Mugen.  The first of
    these two images will use its own palette regardless of what this byte is
    set to (meaning that it will use the next 768 bytes in the SFF file if its
    palette has been removed, which needless to say won't look very good).
    The second of these two images to occur in the SFF file will use its own
    palette if this byte is set to 0, but will use the palette of the other
    image if this byte is set to 1.


This doesn't really have much effect on the guidelines I wrote for fixing SFFs, however.  The directions remain the same, though I guess I should add this little addendum:

If the character has any ACT files, and image 9000-1 has its own separate palette, then it may actually be slightly more optimal to put it at the very beginning of the SFF.  In the case where image 0,0 doesn't exist, it should slightly improve select screen loading time.  And in the case where image 0,0 does exist, it may (or may not) reduce the number of palettes for Mugen to process in-game by one, depending on how exactly Elecbyte coded it.
But neither of those should matter very much at all, and it'll screw up the display of the character in-game if there are no ACT files.  Furthermore, if you're ever going to use Sffextract on the file at any point in the future, you'd need to use the -1 switch when extracting.  (Or to avoid that need, you could just remove the #/1/2 at the beginning of the text file before recompiling with -p, if you've made certain that all other images already have the same palette.)

Note, however, that neither portrait may be a linked sprite, and so putting both at the beginning eliminates the need to worry about that at all.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Last Edit: August 28, 2004, 03:21:31 am by Winane
Re: Making character SFFs universally compatible
#19  September 19, 2004, 10:50:09 pm
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
Ya know, it just occurred to me:

If the large portrait (9000,1) has its own unique palette, it may still be best to put it at the very end (or the very beginning, as explained in my last post) of the file, even if image 0,0 does exist.  That way, you'd be able to use it in-game in post-DOS Mugen without having its palette get screwed up.  That could be useful in your own character for use as a super portrait or whatever else you want, so long as the mismatch between the currently selected palette and the portrait's palette isn't too much of a problem (e.g. if the portrait has red hair and purple clothes, while the ACT file uses green hair and blue clothes, that'd look kinda weird; but if both have the same hair and skin color, and the clothes aren't visible in the portrait, then it'd look fine).  And perhaps possibly more importantly, someone else might eventually decide to make a character that features a move wherein it puts your character in a custom state, and then proceeds to desecrate your large portrait, or something like that.

Of course, if you still want the small portrait first (thus ensuring proper character display even when no ACT files are present), and still don't want to put the large portrait at the very end (to avoid longer select screen loading time), you could use CharSffDtoW's strategy of putting the small portrait first, the large portrait second, and 0,0 third, and giving all three individual palettes (rather than removing 0,0's palette, as I'd probably previously specified somewhere in this thread).  Only tradeoff there is that you'll have an extra 768-byte palette in the SFF file.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )
Re: Making character SFFs universally compatible
#20  April 23, 2005, 07:51:59 pm
  • ******
If anyone would be so kind as to put all that into a more readable and understandable form, I'd be most appreciative. ^^

  • Run Sffextract with:

 sffextract -d -i -o charname.txt charname.sff

  • If you encounter any invalid linking errors:
  • Start over, but this time add the -f switch.
  • If you encounter either of these warnings:

 "Warning: Invalid number of groups specified in header."
 "Warning: Nonstandard subheader size specified in header."
  • Then just ignore them. =P They won't cause any harm.
  • If the console window doesn't report any other errors, warnings, or notices, then:
  • Open up charname.txt.
  • If the third uncommented line says "1" (preceded by a line that says "; Individual palette"), then:
    • Start over, but this time add the -1 switch. (Note: This step assumes that the character's SFF was designed for use in DOS Mugen. But if the SFF were designed to take advantage of post-DOS Mugen's ability to break the 255 color limit, then you probably wouldn't be fixing it anyway. =P )
  • Find image 9000,0 (search for "0900000000", if you haven't used -8 or -x). Move it to the beginning of the SFF file.
  • Check whether image 0,0 exists (search for "0000000000", if you haven't used -8 or -x).
  • Find image 9000,1 (search for "0900000001", if you haven't used -8 or -x).
  • If image 0,0 exists, then:
    • Move image 9000,1 (including #/1/1, if they precede it) to come right after image 9000,0.
  • Else, if image 0,0 doesn't exist, then:
    • Check whether image 9000,1 is preceded by #/1/1.
      • If so, then move image 9000,1 (including #/1/1) to the very end of the file.
      • If not, then move image 9000,1 to come right after image 9000,0.
  • Do a search for the word "Individual".
  • For any images preceded by the comment "Individual palette" (and #/1/1):
    • Open up the PCX file.
    • If it looks like an alternate portrait or something else that might really ought to have its own palette, compare its palette to the palette of the first sprite in the SFF. If the palettes are incompatible, then move the image (including #/1/1) to the very end of the file.
    • Otherwise, if it looks like a normal sprite that you'd see in-game, and you're sure the SFF wasn't designed for use in post-DOS Mugen, then delete the #/1/1 preceding it in the text file.
  • Run sprmaker -c -f -p < charname.txt
  • If you encounter any "Image kept own palette despite subheader" notices, then:
  • Treat those images as I instructed for "Individual palette" images, but add #/1/1 if you determine that they should keep their palette.
  • If you encounter any "Image is not in 256-color PCX format" notices, then:
  • Give up. It's not worth fixing, unless you really, really like the crappily made character you're dealing with. =P
  • If you refuse to give up, then convert the problematic images to be 8-bit palettized, using nearest color matching when applying the character's default ACT file. Or something like that.
  • If you encounter any "Extra image saved as: " notices, then:
  • Ignore it if you want. The recompiled SFF will appear in Mugen the same way it did before.
  • But if you want a properly made SFF file, then investigate those images:
    • If any duplicately numbered images are identical to the first image with that group+image number, and they all have the same axes, then simply delete the duplicates from the text file (but keep the first instance of the image, of course).
    • Else, if they're not identical, try to determine which one really belongs with that group+image number. (This requires some basic understanding of how all this SFF, AIR, and whatnot stuff works.) Make reference to Elecbyte's spr.txt and spr.gif if the images in question are required sprites. Otherwise, take a look at the character's AIR file. Then, either remove or renumber the images that don't belong, as appropriate, and make any necessary changes to the AIR file if applicable.

  • If you encounter any other errors or warnings, then:
  • Deal with them as appropriate. =P
  • If you encounter too many notices, warnings, and error messages to fit in the console window, then:
  • Either start over using the -w option. For example:

 sffextract -d -i -o charname.txt -w stderr.txt charname.sff
  • Or simply always use the -w option, so you never have to start over. Just be sure to always remember to check the contents of the diagnostic messages file.
[/list]



Too bad there are only 3 symbols, I'd have liked one more.  :(