+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  Why do graphics have strange colors in tile viewer?
Pages: [1] 2
Author Topic: Why do graphics have strange colors in tile viewer?  (Read 1174 times)
harleking
Guest
« on: June 15, 2006, 07:10:47 pm »

I'm not that experienced with graphics hacking and I tried to open Super Mario RPG in TLP just to see how games stored graphics and potentially make a very minor mod (like change mario's suit from red to green), but I'm having a lot of trouble finding the sprites. I'm pretty sure it's not compressed since I'm sure I found Princess Toadstool's body somewhere in there, but even then I couldn't figure out how to put her together (its like a puzzle!) I was wondering why the colors seemed so screwed up (I'm using SNES format) since that makes browsing through the file much harder and I was wondering if there is a way I can look at the graphics in true color.
Shadowsithe
Guest
« Reply #1 on: June 15, 2006, 07:22:26 pm »

The stored sprite data simply says "this is a different colour from that." The palette determines the actual colours used.
« Last Edit: June 15, 2006, 07:39:17 pm by Shadowsithe »
harleking
Guest
« Reply #2 on: June 15, 2006, 07:27:31 pm »

Does the entire game use the same palette? How can I find out the palette used?
Shadowsithe
Guest
« Reply #3 on: June 15, 2006, 07:37:03 pm »

Okay, you know when you're playing an RPG and you see an enemy that looks the same but is coloured differently? That's because they swapped to a different palette. It's space saving and the like.

There's a whole category in the Documents section devoted to palette hacking. Check there.
« Last Edit: June 15, 2006, 07:38:58 pm by Shadowsithe »
harleking
Guest
« Reply #4 on: June 15, 2006, 09:48:18 pm »

I checked it out and unfortunately, most documents there deal with NES games (and I think all use NESticle as one of their main tools). There are only two SNES documents, one which seems too advanced and specific for my purposes and the other has a broken link  Sad . Do you know of a  specific document that talks about this subject? Thanks.
DaMarsMan
Guest
« Reply #5 on: June 15, 2006, 10:19:33 pm »

Basically heres how it works. If the picture is 2bpp (2 bits for per pixel) it means that there is a total of 4 different colors possible. Look at the bit combinations.

00
01
10
11

The game assigns a color for each one of those combinations by using a palette. The palette usually tells the game what Red Green Blue color value to display. So in this example there could be 4 possible colors. If it was the first combination of bits it would display the color in the first entry of the palette. On a 256bpp image, there is a total of 256 colors that can be diplayed per pixel. That means one byte for every pixel. That byte tells which palette entry to use for the color of that pixel. Snes can use multiple 16 color palettes or one 256 if I'm correct. I know thats how the GBA works. It can have 16 of 16 color palettes or one 256 color palette.

Either way, some of this stuff is explained in documents but a lot of times its confusing. Heck, I probably just got you even more confused. It really all makes sense when you look how efficient it is for a low level processor like video game systems.
Ryusui
Guest
« Reply #6 on: June 15, 2006, 10:48:54 pm »

Three words: Paint-By-Numbers.

You've done one of those before, right? Every pixel is a number, and the palette tells the hardware which number represents what color.

The colors are screwed-up in the tile viewer because the tile viewer doesn't have the right palette. If you have the wrong palette for a paint-by-numbers, the picture will be messed up when you're done.
DaMarsMan
Guest
« Reply #7 on: June 15, 2006, 10:56:07 pm »

By the way, heres a way to do it. Take a screenshot of the game in ZSNES and export the palette using vSnes and then load it into a tile editor that supports palettes. That simple.
Tonuchi
Guest
« Reply #8 on: June 15, 2006, 11:16:33 pm »

What I do is take a screenshot open it up in paint and find out what the color values are ( Dropper tool then on the top bars look for color editor click the custom colors and it will show you.) then back in tlp apply it to your pallete. And save the pallete with the sprite name. Hope that helps.
Ryusui
Guest
« Reply #9 on: June 15, 2006, 11:32:20 pm »

That's painful. I used to put up with that myself.

Nowadays I usually just find some sneaky way to dump the palette and import. I usually leave a little bit of extra space in my graphics files for just that...in Tile Molester, I can import a palette in the file itself, so I just take the palette and wedge it in somewhere.
Tonuchi
Guest
« Reply #10 on: June 15, 2006, 11:35:17 pm »

Yeah but it is simple ... Infact I'm really confused of what you said (No offense). I'm sure as I get more experience I'll get new strategies.
creaothceann
Guest
« Reply #11 on: June 16, 2006, 12:57:06 am »

1. Make a savestate of a scene that shows the graphics and the colors you want to use. (In ZSNES, SNES9x, Super Sleuth or SNESGT.)
2. Get vSNES (utilities section of this site), extract it, start it, load the savestate you made.
3. Open the MemViewer and the PalViewer.
4. Select colors in the PalViewer and see what happens. Browse in the VRAM / WRAM / ROM memory to find more graphics.
5. Select the 2-bit mode if necessary. See what changes when you select colors in the "right half" of the palette.
harleking
Guest
« Reply #12 on: June 16, 2006, 09:22:37 am »

Thanks for the help, you have all been very helpful! I still have one concern though. When I open Yoshi's Island in vSnes and I browse to an offset of around 1400, I can very clearly see the sprites used in the game. The color is messed up, but the sprites are very well defined (in fact, I think there's a screenshot of it in the manual). On the other hand, when I open Mario RPG or Earthbound, the sprites are a complete mess. I can tell parts of sprites if I look hard enough, but everythign is jumbled and in pieces, which makes modifying it very difficult. Is this just the way the memory is organized in the cartridges or am I looking at the other ROMS through the wrong settings?
Nightcrawler
Guest
« Reply #13 on: June 16, 2006, 09:32:07 am »

It's the luck of the draw.

Sprites are made up of many tiles. There's no correct order for the tiles to be in. They are put together via a tilemap in the game. But they don't have to be stored in order at all! It IS like a puzzle. You'll have to figure out how they go yourself. It's the game's tilemap that is loaded when it runs that 'puts the puzzle together' on screen. And even then, that map references tiles in VRAM, so that wouldn't help you much looking at the ROM.

Long story short, that's just the way it is. That's how they are stored. It can be different for each game.

The game companies used utilities most likely to store the tiles and sprites and create the maps automatically. It's not like they had to deal with the graphics like this. This is just one of the hardships of hacking. Get used to it, there will be many more! Wink
creaothceann
Guest
« Reply #14 on: June 16, 2006, 10:31:29 am »

*coughcompressioncough* Smiley

EDIT: Btw. sometimes you can display the graphics correctly when they're stored one after another. For example the font tiles (8x12 pixels, 1 bpp) is at offset $04BD2F; you can see them when you change the window size to x=1. (Normal larger graphics are arranged in a x=16 pattern.)

http://board.acmlm.org/thread.php?id=348
« Last Edit: June 16, 2006, 10:42:02 am by creaothceann »
Pages: [1] 2  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC