Author
|
Topic: Ogre Battle (PSX) Graphics Hacking; Tips on how to handle palettes? (Read 2 times)
|
FaustWolf
Guest
|
|
« on: December 01, 2007, 12:43:06 am » |
|
Hey all! I've just started exploring the graphics in Ogre Battle (PSX), and am having some measure of success with TileMolester: However, I'm having a difficult time finding info on how to apply palettes to the ripped graphics. I've got several palette files (in the .CHU format) for Ogre Battle and I can get TileMolester to access them by stuffing the palette data into the sprite sheet data. However, I'm unsure how to determine information such as the palette size and starting offset when I do an internal palette import in TileMolester. Anyone have any tips on this process? Alternatively, does anyone know how to rip CLUTs (color lookup tables) from PSX save states/VRAM dumps? That would probably be equally helpful in this case. In case anyone would like to take a look first-hand, I'm linking directly to a .zip file containing some spell effects I'm trying to view in a .PAC archive file (just a bunch of uncompressed sprites smushed together, really). The palette is available separately (the .CHU), but it is already appended to the beginning of the .PAC file as well. The spell effect sprites are viewable in 4bytes/pixel linear, reverse-order mode in TileMolester. http://www.mediamax.com/faustwolf/Hosted/OgreGfxPack.zip
|
|
|
|
creaothceann
Guest
|
|
« Reply #1 on: December 01, 2007, 05:01:42 am » |
|
However, I'm having a difficult time finding info on how to apply palettes to the ripped graphics. I've got several palette files (in the .CHU format) for Ogre Battle and I can get TileMolester to access them by stuffing the palette data into the sprite sheet data. However, I'm unsure how to determine information such as the palette size and starting offset when I do an internal palette import in TileMolester.
If you append the palette to the beginning of the file then it should be offset 0 and size 256. Alternatively you could load the palette file into vSNES (with PalViewer palette format set to 512 bytes) and save it as a ZSNES savestate, which could be imported into TileMolester. The spell effect sprites are viewable in 4bytes/pixel linear, reverse-order mode in TileMolester.
There doesn't seem to be a codec that shows what you've posted...
|
|
|
|
FaustWolf
Guest
|
|
« Reply #2 on: December 01, 2007, 11:20:29 am » |
|
Thanks for the tips! As far as the codec is concerned, I'm able to view the .PAC file in TileMolester v.16 (this version seems to be programmed in Java). The settings I use are:
Codec: 4bpp liinear, reverse order Mode: 2 dimensional ...and adjust the image width until I can see something recognizable.
Is it possible tht the .CHU palette file has a header pointing to various sub-CLUTs, and that would affect the starting offset I should use? And is there any way to tell from a palette whether it should be imported as 15bpp v. 24 or 32 bpp format? I think I read somewhere that PlayStation-compatible palette files don't go above 24 bpp.
But I'll definitely pick up vSNES and try that method.
|
|
|
|
creaothceann
Guest
|
|
« Reply #3 on: December 01, 2007, 01:54:32 pm » |
|
The CHU file seems to contain only the palette, no additional header.
If you know the number of color entries in a palette then you can calculate the color depth: 15 bpp = 2 bytes per color entry -> 256 colors = 512 bytes 16 bpp = 2 bytes per color entry -> 256 colors = 512 bytes 24 bpp = 3 bytes per color entry -> 256 colors = 768 bytes
On most systems there is no "32 color bits per pixel" mode, but a color can still use up 4 bytes for faster access, or alpha transparency (only in images, not in palettes). 256 colors would then be 1024 bytes.
Regarding vSNES, if you want to do that, here's how:
- start vSNES and load a ZSNES savestate (to activate some buttons) - set the palette format in the PalViewer options to "SNES: 512 bytes" - load the CHU file via the PalViewer window - save the current savestate (via the main window) to a new file - in TileMolester, import the palette from that savestate file
This removes the need to add the palette to the file you're editing. It's a pity that TileMolester doesn't give much control over palette files...
|
|
|
|
Gemini
Guest
|
|
« Reply #4 on: December 01, 2007, 02:16:04 pm » |
|
You don't need vSNES for finding palette data. Just open Tile Molester, set mode to 2 dimensional, codec to 15bpp BGR (555) and there you go.
|
|
|
|
FaustWolf
Guest
|
|
« Reply #5 on: December 01, 2007, 06:40:22 pm » |
|
Thanks for the confirmation on the .CHU palette creaothceann! I can get the spell effects colored correctly in agemo's VRAM viewer, since that seems to collect all the CLUTs in the game into one place, making things easy. Although the .CHU file that I included in my first post is in the same game directory as the spell effects, I strongly suspect it is the incorrect color scheme for what I'm trying to view at the moment. It appears that all the CHU files are 512 bytes in length, so I think I've been correct in specifying 256 as the number of color entries and 15bpp as the color depth.
Gemini, the 2-dimensional / 15bpp (BGR 555) mode only works for finding palettes that are included within the image file, correct? I'm trying to import palettes from external sources, since Ogre Battle stores images separately from their palettes.
I think I actually will go through with the vSNES method creaothceann described, just to get all the palettes into an import format that TileMolester supports so I can cycle through all of them without having to append the palette data.
EDIT: The vSNES method works, and it definitely suits my purposes. Thanks for making that program creaothceann! I had no idea it would come so in handy for PSX graphics hacking!
|
|
« Last Edit: December 01, 2007, 07:26:07 pm by FaustWolf »
|
|
|
|
Gemini
Guest
|
|
« Reply #6 on: December 02, 2007, 04:57:56 am » |
|
Gemini, the 2-dimensional / 15bpp (BGR 555) mode only works for finding palettes that are included within the image file, correct? I'm trying to import palettes from external sources, since Ogre Battle stores images separately from their palettes. Append all the palette data to your image file and the issue is gone.
|
|
|
|
FaustWolf
Guest
|
|
« Reply #7 on: December 02, 2007, 07:38:09 pm » |
|
YEAH!! I just wanted to let everyone know, I've figured out a fairly efficient way of transferring the CLUTs assembled in PSX VRAM to actual palettes that can be loaded in TileMolester. Here's what I did: 1.) Launch Agemo's VRAM Viewer on an uncompressed epsxe savestate. 2.) Take a screencap, then separate the CLUTs into 16x16 pixel series. Blow them up, then save them as .GIFs in your favorite image editor. 3.) Google PEdit, a palette-editing program. Open a blown-up CLUT as a GIF image and build a correct palette with its simple point-and-click interface. 4.) Save the palette as a Jasc PSP palette and import it into vSNES (creaothceann's program). Provided you have a ZSNES savestate handy, just save that savestate with the palette you've just imported. 5.) Open your raw image in TileMolester, then import the palette from the ZSNES savestate modified in vSNES! Voila! This works for 4bpp images in Ogre Battle, anyway. Interestingly, both PEdit and vSNES were both programmed by Germans -- do you people have a comparative advantage in working with graphics, or what? This is the most efficient method of transferring the CLUTs assembled in VRAM to something usable in TileMolester that I've seen so far. It might be useful to fellow PSX hacking noobs.
|
|
|
|
Gemini
Guest
|
|
« Reply #8 on: December 03, 2007, 02:59:07 am » |
|
It's not the most efficient, really. You need at least 5 programs to do that procedure, when you can just append the palette data (dos command "copy /b image+palette output") and use only Tile Molester for everything else.
|
|
|
|
creaothceann
Guest
|
|
« Reply #9 on: December 03, 2007, 04:54:10 pm » |
|
PVV_0.1.rarinput: uncompressed VRAM dumps output: ZST savestates
|
|
|
|
FaustWolf
Guest
|
|
« Reply #10 on: December 03, 2007, 07:19:18 pm » |
|
Ah, I was hoping you guys would point out better methods once you saw my noobish attempt. @Gemini: Normally I'd just append the palette data as you suggest, but Ogre Battle uses multiple palettes for some sprites, and for completion's sake I'd like to get all variations the game has. The number of times I'd have to append the palette data is thus prohibitive; I'd have to append for each sprite I was trying to rip. I think? @creaothceann: I can't wait to try that out; as long as it orders the CLUTs the same way they're ordered in VRAM, that's the solution to all my woes right now. However - when I try to launch PVV 0.1, it tells me "rtl100.bpl" wasn't found, and apparently it needs this file to run (?). Do I have to do anything special to set this up? :banghead:
|
|
|
|
creaothceann
Guest
|
|
« Reply #11 on: December 03, 2007, 07:54:17 pm » |
|
See the last few posts in this thread.
|
|
|
|
FaustWolf
Guest
|
|
« Reply #12 on: December 03, 2007, 08:13:16 pm » |
|
Thanks! I've got it working now, though when I open up the VRAM dump it appears as garbled data -- which is probably natural. Is the user supposed to press some keyboard keys to align the image so that it resolves into what agemo's VRAM viewer shows, or perhaps I'm looking at non-VRAM data within the savestate and need to shift down to see the VRAM contents?
If I've reached a dead-end with this program, that's okay too; the method I devised earlier is actually not too bothersome at all.
|
|
« Last Edit: December 03, 2007, 08:43:12 pm by FaustWolf »
|
|
|
|
Gemini
Guest
|
|
« Reply #13 on: December 04, 2007, 04:34:15 am » |
|
@Gemini: Normally I'd just append the palette data as you suggest, but Ogre Battle uses multiple palettes for some sprites, and for completion's sake I'd like to get all variations the game has. The number of times I'd have to append the palette data is thus prohibitive; I'd have to append for each sprite I was trying to rip. I think? Tile Molester can browse through all the palettes you tell it the file has by changing the size parameter with the total colours available in that chunk. You just need to append all the palettes there and then use the <-/-> buttons in order to browse them all.
|
|
« Last Edit: December 04, 2007, 09:20:39 am by Gemini »
|
|
|
|
creaothceann
Guest
|
|
« Reply #14 on: December 04, 2007, 09:18:44 am » |
|
Thanks! I've got it working now, though when I open up the VRAM dump it appears as garbled data -- which is probably natural. Is the user supposed to press some keyboard keys to align the image so that it resolves into what agemo's VRAM viewer shows, or perhaps I'm looking at non-VRAM data within the savestate and need to shift down to see the VRAM contents?
Well, it won't work with whole savestates, especialy if they're compressed. If you're comfortable enough with the previous solution / Gemini's method then that's ok, I guess.
|
|
|
|
|