Differences
This shows you the differences between two versions of the page.
ff3:ff3us:tutorial:sprites [2017/09/02 00:15] lockirby2 Edited the parts related to 4bpp after previous changes |
ff3:ff3us:tutorial:sprites [2019/02/12 11:12] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Character Sprites and Portraits Editing ===== | ||
- | |||
- | **Author:** madsiur\\ | ||
- | **Last modified:** 09/ | ||
- | **Credits: | ||
- | |||
- | ==== 1. Introduction ==== | ||
- | |||
- | The character sprites in FF6 can be modified in various ways depending on exactly what you want to do. Edits like "//I want to change Terra' | ||
- | |||
- | Spriting with FF6's limitations is harder than simply editing a sprite image, but not so far from it when you know and get used to the limitations and specifications. There are three utilities that are made for FF6 sprite work and at least one general GFX utility that can be used to edit sprites and portraits. They will not be covered in-depth here, as they are relatively straightforward when you know the basics (with the possible exception of YY-CHR, which will be covered in depth in a future tutorial). | ||
- | |||
- | You'll notice I mainly refer to the generic //FF6// name. In this context, //FF6// refers to SNES FF3us 1.0 or 1.1, but most of this tutorial can be applied to the GBA versions as well. However, not all differences will be covered or even mentioned. | ||
- | ==== 2. Understanding Sprites ==== | ||
- | |||
- | **Skip this section if you don't want to read about the technical side of sprites. | ||
- | |||
- | SNES sprites are the combination of two elements: graphic data (GFX) and a palette. The GFX can have a different maximum number of colors, which is called the graphic format. Most SNES graphics are 4bpp (4 bits per pixel), meaning they can have a maximum of 16 colors (transparency color + 15 colors). There are only 16 possible numbers that can be represented with 4 bits (0 to 15). Listed out in binary, these numbers are 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111. However, there are game GFX that can be 3bpp (8 colors maximum), like some monsters, or 2bpp (4 colors maximum), like the fonts. In the case of 3bpp format, it is always converted by the code to 4bpp because the hardware cannot display it. The 3bpp is a form of compression. | ||
- | |||
- | {{ ff3: | ||
- | |||
- | To picture a GFX, imagine (in the case of a 8x8 4bpp graphic) an 8x8 array or table where each pixel is represented by a number from 0 to 15. In a " | ||
- | |||
- | {{ff3: | ||
- | {{ff3: | ||
- | |||
- | The corresponding array of color IDs is the same size and represents the same image, except that each color is replaced by its palette ID (0x00 to 0x0F): | ||
- | |||
- | {{ff3: | ||
- | |||
- | You would logically expect that if we represented these values as bits instead of integer or hexadecimal values, we would obtain the following set of bytes. | ||
- | |||
- | {{ff3: | ||
- | |||
- | However, **bad news!** The SNES 4bpp format does not work this way. If we take our 64 pixel large (8x8) happy face tile, we get the following 32 bytes as seen in a Hex editor. | ||
- | |||
- | {{ff3: | ||
- | |||
- | Each row of pixels is represented by 4 bytes as with any other 4bpp format, except that we have to read the byte in bitplane to get the color IDs. To read the bytes in bitplane, we first divide the two rows of data into blocks of four bytes as shown. | ||
- | |||
- | {{ff3: | ||
- | |||
- | Bitplanes are read in the order of b1, b2, b3, b4. That is, top-left, top-right, bottom-left, | ||
- | |||
- | {{ff3: | ||
- | |||
- | First, you must look at each byte in its binary representation. When the four bytes are aligned on top of each other in the following manner, each column represents a pixel. | ||
- | |||
- | {{ff3: | ||
- | |||
- | Since there are 8 bits in 1 byte (and therefore eight columns), and there are eight pixels in each row, the 8x8 tile format begins to make sense now. Here are the color values of row 2. As you can see, it corresponds to what is in our previous color array of the tile. | ||
- | |||
- | {{ff3: | ||
- | |||
- | The SNES 4bpp format is not made to be human-readable, | ||
- | |||
- | Palettes are a sequence of color data that is " | ||
- | |||
- | A SNES Color is in 15 bits RGB format. In short, this mean each color can be represented by 2 bytes (16 bits). Each channel value (R, G or B) is 5 bits long, and the first bit is always 0. Specifically, | ||
- | |||
- | {{ ff3: | ||
- | |||
- | So we know a SNES color fits into 2 bytes; therefore, a 16 color palette takes up 32 bytes of space in the ROM. This is valid for all SNES games. As quickly mentioned previously, transparency is a color because there is no alpha channel in the 15 bits RGB format. The game determines which color is transparent. In the case of FF6, it is always color 0. So this color in the palette will have a RGB value, but it will be //masked// by the game to show transparency instead. | ||
- | |||
- | Here is a five step example to show how to convert a color to B,G,R format. We will take our palette from the preceding 4bpp example: | ||
- | |||
- | {{ff3: | ||
- | {{ff3: | ||
- | |||
- | Let's look at the first color, the medium-dark grey. The steps are: | ||
- | |||
- | 1) Convert 2 byte value to binary\\ | ||
- | 2) Separate the binary values into three sets of five bits. The first bit is not used.\\ | ||
- | 3) Convert each of the three color values to a decimal value between 0 and 31:\\ | ||
- | |||
- | {{ff3: | ||
- | {{ff3: | ||
- | {{ff3: | ||
- | {{ff3: | ||
- | |||
- | Here are the results for the first 8 colors of our palette in B,G,R format: | ||
- | |||
- | {{ff3: | ||
- | |||
- | This basically covers the technical side of colors, palettes and GFX. Little of what was explained is mandatory to accomplish everyday spriting tasks like editing a sprite in FF3usME, but I think it is good to understand how these elements work on the byte level. If you are using an utility that lets you import images (.png, .bmp, .gif, .jpg, etc.), you should work in an image editor such as Gimp in the " | ||
- | |||
- | ==== 3. Editing Tiles (YY-CHR) ==== | ||
- | |||
- | If you wish to do simple tile edits, YY-CHR can be a solution. There is a {{ff3: | ||
- | |||
- | Character sprite are located at $D50000 ($D50200 with header). You can either {{ff3: | ||
- | |||
- | If you want the right colors (i.e., the right palette), you can import the {{ff3: | ||
- | |||
- | There are several different tile arrangements available. Since we are dealing with 16x24 sprites for characters, a more convenient way to view the tiles would be {{ff3: | ||
- | |||
- | {{ ff3: | ||
- | |||
- | To summarize this section, YY-CHR can help with basic tasks, but for complex sprite editing, FF3usME, FF3SpriteEd, | ||
- | |||
- | ==== 4. Editing Sprites ==== | ||
- | |||
- | This section will cover the FF6 spriting utilities' | ||
- | |||
- | === A. FF3SE (no longer developed) === | ||
- | |||
- | First up is [[ff3: | ||
- | |||
- | {{ ff3: | ||
- | |||
- | === B. FF3SpriteEd (merged with FF3usME) === | ||
- | |||
- | Second comes [[ff3: | ||
- | |||
- | {{ ff3: | ||
- | |||
- | === C. FF3usME (still being developed) === | ||
- | |||
- | Finally, there is [[ff3: | ||
- | |||
- | {{ ff3: | ||
- | |||
- | To conclude this section, I'll talk about the spritesheet formats. FF3SE exports the sprite sheet in the //old// format, meaning they have no " | ||
- | |||
- | {{ff3: | ||
- | |||
- | ==== 5. Sprite Animations and Poses ==== | ||
- | |||
- | Each character sprite in [[ff3: | ||
- | |||
- | {{ff3: | ||
- | |||
- | [[ff3: | ||
- | |||
- | [[ff3: | ||
- | [[ff3: | ||
- | |||
- | |||
- | For a short description of each pose ID, refer to the [[ff3: | ||
- | |||
- | The possible animations and pose patterns are used mainly in the event code (as well as battle module and world map module). For events, you can call a pose in an action queue of a character or NPC (event commands $00-$35). Walking combinations have their own [[ff3: | ||
- | |||
- | There is an " | ||
- | |||
- | If we come back to spriting, is it important to make sure all the edited poses work correctly with the sprites animations shown in FF3usME. Editing a tile can sometime have an effect on a pose we did not suspected at first glance. Get used to the tile sharing of the sprite poses, that is the same if we look at all sprite sheets of the same size. | ||
- | |||
- | ==== 6. Editing Palettes ==== | ||
- | |||
- | One of the biggest puzzle for those who have sprite with different palette is making sure everything fit together. Why? Because sprite share palettes! As an example, if you change Celes hair color to blue, Sabin, Edgar and Leo's hair will be blue. | ||
- | |||
- | {{ ff3: | ||
- | |||
- | |||
- | Also there are two 16 colors palettes assigned for each character, one palette for battle and one for maps and overworld. Most of the time they match but they are exceptions. There are 8 battle palettes (located at $ED6300) and 32 overworld palettes (located at $E68000). Here are the first 7 of each type: | ||
- | |||
- | {{ff3: | ||
- | |||
- | They are both assigned in a different way. The battle palette | ||
- | |||
- | This {{ff3: | ||
- | |||
- | While there are many overworld palettes all regular characters and //character NPCs// use a palette ID between 0 and 5, with exception of Esper Terra that use overworld palette 8 and battle palette 6. The reason for you being unable to use 6 and 7 is due to those palettes not being able compatible with save/ | ||
- | |||
- | **Overworld palette** | ||
- | | Palette ID |Sprites using the palette| | ||
- | | 00 |Edgar, Sabin, Celes, Imp, Leo, Ghost, generic elder, generic man, Maria, Rachel| | ||
- | | 01 |Locke, Imperial, Merchant, Scholar, Returner, Clyde, generic woman, generic boy, generic girl, Narshe guard, sailor| | ||
- | | 02 |Terra, waitress, Figaro Sergent, Figaro Guard, Katarin, Darryl| | ||
- | | 03 |Strago, Relm, Gau, Gogo, Banon, Kefka, Gestahl, Gau (suit), Cid, generic thief| | ||
- | | 04 |Cyan, Shadow, Setzer, Interceptor, | ||
- | | 05 |Mog, Umaro, Ultros, Chupon| | ||
- | | 08 |Esper Terra| | ||
- | |||
- | |||
- | |||
- | **Battle Palette** | ||
- | | Palette ID |Sprites using the palette| | ||
- | | 00 |Edgar, Sabin, Celes, Imp, Leo, Ghost, generic elder, generic man, Interceptor| | ||
- | | 01 |Locke, Imperial, Merchant| | ||
- | | 02 |Terra| | ||
- | | 03 |Strago, Relm, Gau, Gogo, Banon, Kefka, Gestahl| | ||
- | | 04 |Cyan, Shadow, Setzer| | ||
- | | 05 |Mog, Umaro| | ||
- | | 06 |Esper Terra| | ||
- | |||
- | Finally when you edit your sprite and colors, there is an order to respect. One of the reason is explained in next section and also why you can only use the first 12 colors for a battle sprite: | ||
- | | Color ID |Description | ||
- | | 00 |transparent | ||
- | | 01 |outline (black) | ||
- | | 02 |eyes | | ||
- | | 03 |pupils | ||
- | | 04 |hair (lighter shade) | ||
- | | 05 |hair (darker shade) | ||
- | | 06 |skin (lighter tone) | | ||
- | | 07 |skin (darker tone) | | ||
- | | 08 |outfit 1 (lighter shade) | ||
- | | 09 |outfit 1 (darker shade) | ||
- | | 10 |outfit 2 (lighter shade) | ||
- | | 11 |outfit 2 (darker shade) | ||
- | |||
- | ==== 7. Other Specifications ==== | ||
- | |||
- | === A) You can set different sprite for battle and overworld === | ||
- | While the vanilla game has same sprite for battle and NPC or overworld PC, you could set a different sprite for battle. The game get a sprite GFX index for each battle sprite in a pointer table at $C2CE43. Each entry is 3 bytes and there are 24 entries. As for NPCs, this is also in the NPC data which can be edited with FF6LE. Finally playable characters get their GFX set with an event command in the same way the palette is assigned, except it is with event command $37. | ||
- | |||
- | === B) Color changes in battle === | ||
- | One thing you must keep in mind and be made aware of is battle sprites have color changes during battle. To be more specific, the outer line of characters glows from effects such as Haste, Protect, etc, and their skin tone changes due to Poison, Zombie, etc. These change the colors of the specified number on the palette: | ||
- | |||
- | {{ff3: | ||
- | |||
- | #1 is what's used for the outline of magical effects around the character, and #2 and #3 are what's used for skin color changes like Poison, Zombie, etc. Please note if you use the skin color for clothing or draw black outlines around your eyes, this will make them change color with the above. Personally, I don't think it's super noticeable, so please don't worry too much. | ||
- | |||
- | === C) Color changes in battle === | ||
- | The total number of colors usable for battle sprites isn't 16 actually, but 12. Out of the 16 colors, 4 are masked via the system colors used (finger cursor, damage font color, etc). Since they do not appear in battle, those last 4 colors can be used for NPCs without worring. There is however a [[https:// | ||
- | |||
- | However using this hack will make characters on palette 4 and 5 display the last 4 colors save/ | ||
- | |||
- | ==== 8. Portraits ==== | ||
- | |||
- | Portraits are 40x40 with a palette of 16 colors. Each portrait has its own palette. The easiest way to edit portraits and import custom ones is with FF3SE. Note that the {{ff3: | ||
- | |||
- | {{ff3: | ||
- | |||
- | If you ever edit directly in the ROM with as an example YY-CHR, the tile order is as follow: | ||
- | |||
- | {{ff3: | ||
- | |||
- | ==== 9. Conclusion ==== | ||
- | |||
- | Becoming a good FF6 spriter require to take a lot in consideration. However many started from nothing and became good with time. It's more a matter of practice and knowing the basics, specifications and exceptions before starting for real. This is what I tried to do with this tutorial. I might revise it a bit but I covered most of the content I wanted to cover. | ||
- | |||
- | If you want to read more on the artistic part of Pixel Art, there is a bunch of external tutorial links available on this [[ff3: | ||
- | |||
- | === Tools used === | ||
- | [[ff3: | ||
- | [[ff3: | ||
- | [[ff3: | ||
- | {{ff3: | ||
- | |||
- | |||
- | |||
- | |||