News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Help! I'm having trouble recoloring sprites.  (Read 862 times)

SneakDuckens

  • Newbie
  • *
  • Posts: 1
    • View Profile
Help! I'm having trouble recoloring sprites.
« on: April 01, 2020, 05:50:17 pm »
I've gone through all of the beginner tutorials on the site, and I feel like I have a good handle on NES ROMS, but I'm struggling on how to recolor sprites on the SNES. Can anyone guide me to some step by step tutorials?

Thanks

FAST6191

  • Hero Member
  • *****
  • Posts: 2759
    • View Profile
Re: Help! I'm having trouble recoloring sprites.
« Reply #1 on: April 01, 2020, 10:20:19 pm »
Two approaches

1) Alter the sprite itself. Sprites are mostly a lookup table (I usually like to use the paint by numbers analogy) so change the lookup and you change the colours, assuming the colour you want it otherwise there or can be made so. Main downside other than limited choice is palette swaps -- many games will reuse the art but change the colours for extra enemies or whatever and altering the base art can have knock on effects.
One typically changes sprites with a tile editor. There are dozens to pick from. Personally I like tiled2002 and crystaltile2 but there are plenty of others to pick from and many others around here use others.
http://www.romhacking.net/utilities/ (might want to refine to graphics editor)

Compression did exist for the SNES, and is not unknown. It is not as common as the GBA, DS and other newer or more powerful devices but it is known. Most times it will be custom for the game itself but as the SNES was not that powerful it will still tend to be the simpler examples of the concept like RLE (run length encoding) or basic dictionary rather than some of the more modern hardcore implementations of LZW or something. We will skip that one for now.

Finding sprites. If you simply want them for a sprite sheet you will typically be pointed at the graphics viewer of a game and asked if that has what you want (many times it will), and you can use cheats to get rare items, enemies and whatever else to appear if you so desire.
Other times you get to open the ROM in a tile editor and press down/page down/whatever button skips a page of screen at a time and see if you spot it.

2) Alter the palette. Most later systems will have a software defined palette of colours (as opposed to a fixed hardware one). The SNES is an example of this in action. Sometimes these palettes can be limited or otherwise change behaviour based upon the graphics mode the system is in at that given point in time.
https://wiki.superfamicom.org/palettes if you want more technical explanations of the breakdown of how the colours work.
Shorter version is they are stored in memory at runtime. You can dump them from memory (some emulators might even have the option) or savestates (some tile editors might even work with given emulator savestates to pull them for you) if you want. Dumping them can be nice for basic editing (use existing colours but change a few pixels around sort of thing, usually to undo censorship or match different entries in a series) but as the memory contents change and vanish when you power it off that is about all that is good for there.
However most times the palette is not compressed so if you can snatch it from a savestate you can copy-paste said palette to find where it hides in the ROM and edit the palette there instead.

Palettes can be used for animations (change the palette and change the colour on screen) but I am not sure to what extent the SNES makes uses of this (the GBA, which is rather similar to the SNES, indeed can be seen to use the same palettes after a fashion -- see many restoration hacks for the GBA). If it is an animated or dynamic palette and you are doing the search thing from above try instead searching for a fragment of the palette that does not change, do also note what is dynamic so you don't accidentally colour something that or overwrite the dynamic part. I don't know if you will have fully dynamic palettes (think brightness increases/options) on the SNES but I can't rule it out, they certainly exist on the GBA.

---

There are more advanced methods of finding both sprites and palettes, culminating in tracing where you find it in memory and use a special debugging emulator to work your way back to the start (trace the steps if you will). I will also throw in corruption (you literally change parts of the ROM and see what happened, when you hit upon the thing you want you know what you did to do it) for while it is crude it can do things.