Archive for December, 2008

SNES Gfx Tools Part I

Tuesday, December 30th, 2008

It’s been awhile again since I haven’t posted anything. I have made nice improvement in my code and now the ennemies are running and grabing the main character, make him loose energy. The player can escape from the hands by shaking left to right. I still need to implement the collision checking process so I can kick them out of the screen. So until then non new rom or source code release.Today I had a question from a reader regarding  the fx tools available on SNES. To say everything it’s not like there that much choice. There is mainly 2 dedicated tools that I use : Pcx2Snes and MappyWin32 with custom lua script to export to snes format. The latter is mainly used for the design of the level. Pcx2Snes is a tool that exists now for a very long time and that is working pretty good. It will do the gfx transformations for basics need. Here are some usage samples taken out of my current project :

Convert full screen in 16 color mode :

tools\Pcx2Snes.exe ressource/kungfu -n -c16 -screen

The -screen flag is for specifying that we want to convert to whole screen, so it will ouput a .pic file with optimised tiles and a .map file with the mapping of the full screen.  The -c option allow to tell how many color you want to use, in our case we want to convert a 16 color image. This flag can be set to 8, 16, 128 or 256 to match the different graphical modes that the Snes is allowing. The -n is for removing border detection.

Convert Sprite in 16 color with block size of 16×16 :

tools\Pcx2Snes.exe ressource/sprite -n -c16 -s32 -o16

You can notice the introduction of two new parameters the -s and the -o. The -s is spefifying block size that you want to use. For a basic background you should forget that parameter so it will use the default of 8 (or you can specify -s8). In my case since I’m converting gfx data for sprite usage i can specify with sprite block size I will use (32×32 here). Then the -o16 parameters is to specify to only ouput the 16 colors i need in the .clr file. Without specifying this parameter it will ouput a file with 256 color entries. I think you have now have all in hands to do all your basics gfx needs. If you still have problems don’t hesitate to let me comment with your problem, and if possible send the source code used to display your gfx (80% of the time it’s the code that is faulty).In one of my next I will expose how i use mappy with customs lua script to extract data of my levels since Pcx2Snes is not good for very large data (more than a screen or two in width).

See ya,