• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 12:32:03 pm

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


Editing Effects' Palette and Graphic

Started by Xifanie, May 06, 2016, 01:38:41 pm

Xifanie

May 06, 2016, 01:38:41 pm Last Edit: May 09, 2016, 08:33:39 am by Xifanie
Why this tutorial?
[indent=2]To show people how change the graphics and palettes of Effect files (ability graphic animations)[/indent]

Requirements

[indent=2]
For every user:

  • An image editing program such as GraphicsGale or Photoshop (or even MSPaint if you are that masochist)

  • CDMage or cdprog

  • HxD (or any Hex Editor of your choice)



For 32bit Windows users:


For 64bit Windows users:

[indent=1]

This tutorial assumes your main drive is C:\, feel free to adapt the information to your needs

  • Install DOSBox

  • Extract the contents of Win31.7z to C:\ (You should be able to browse to C:\Win31\WINDOWS\TIM Utility\)

  • Run DOSBox

  • Enter Mount C C:\Win31

  • Enter C:\WINDOWS\win (at this point Windows 3.1 should be booting)

  • TIM Utility should run on startup; use it as described later in the tutorial (Files can be imported from/exported to C:\Win31\WINDOWS\TIM Utility\.)



WARNING:
[indent=2]With this method, the file index is only refreshed once Windows 3.1 is rebooted. Because of how the program handles file names, try to keep your file names very short if you don't want to deal with the infamous "SomeFileName.bmp" becoming "SomeF~1.bmp". You will likely have to manually type the file names most of the time unless you reboot, because the file browser will not display them (but the files will still be loaded properly).[/indent]
[/indent]
[/indent]

Tutorial

[indent=2]

Getting started
[indent=2]Visit http://ffhacktics.com/wiki/Effects. This page contains very important information used through this tutorial. Also, make sure you grab the .BMP version of the Effect file you want to edit.[/indent]


Editing the file
[indent=2]Just change the colors and graphics as you want... unless you know what you're doing, do not change the dimensions, and if the wiki page states that the Effect file is "4bpp Multi-CLUT", do not use any color other than the first 16. Feel free to edit the colors; but don't use them in the graphical area.

For the sake of this tutorial, we will be using this "Bloody Sword" edit I made:

[/indent]


Reducing colors while maximizing quality (optional)
[indent=2]* This is a lot more for 8bpp effect files than 4bpp; since you only have 16 colors per palette, chances are, using this method won't change a damn thing, in fact, it could become a hindrance

What it comes down to, is the TIM files that will be generated for 8bpp effects are in fact 15bpp + 1 byte for the transparency channel, but indexed. 15bpp means 5 bits per color. So instead of the usual 0 to 255 Red, you'll have 0 to 31 Red. Or, if you prefer, 0-8-16-24-32-and so on... i.e. in increments of ~8. Unfortunately, the best way, by far, to achieve this, is using Photoshop. So, if you don't have Photoshop, sorry because I don't know how any other way to do this.

Assuming you were working with a .psd (and you should), save your file as a BMP, but select 16bit (which is really the 15bpp I mentioned earlier).


Next, open that BMP in Photoshop. Then, we want to reduce it to 8bpp, so head over to "Image"/"Mode"/"Indexed Color"


Make sure "Preserve Exact Colors" is checked! Otherwise, new colors will be generated, and there WILL be conflict, making similar colors becoming the same when creating a TIM out of it, and you WILL lose quality. Otherwise, just adjust the Dither and its % as you wish.


Just save as a 8 bit BMP and you're good to go!
[/indent]


Creating a 4bpp BMP (optional)
[indent=2]* This section is only necessary for Effect files that have a "4bpp Multi-CLUT" color depth, and only if the Graphic was altered.

First load up your 8bpp BMP in Photoshop, then just access its color table.


Next you will want to select all the colors from the start of the second row to the end of the last row.


A color selection dialog will appear; the color needs to be RGB 0,0,0 (pure black), then press OK. The color dialog will appear again, just press OK again.


Now you can save you file (under a new name ideally). When prompted, select "4 Bit" under "Depth", then press OK.



First load up your 8bpp BMP into GraphicsGale. Or if you were already working on it, save your file.


Next you will want to change its Color Depth.


Make sure 4bpp is selected, then press OK.


You will notice that the order of the palette is all wrong; this can cause some major problems, so we need to fix this. Click the arrow pointing downwards under the palette colors, and select "Load Palette..."


Choose "File"/"Import From File"...
When prompted, select the file you are currently using. This is why saving the file beforehand is important.


Make sure that "Match Pixels with Colors" is checked. To make things easier, instead of using drag & drop with the colors, just press the "All" button. Then press "OK".


Your palette should now look identical to the first row of the 8bpp file. Now you can save (under a new name ideally).


[/indent]


Creating a TIM file
[indent=2]WARNING: If your Effect file's color depth is "4bpp Multi-CLUT", and you want to import a new graphic, you will need to create a 4bpp TIM file. However, if you edited the colors beyond the first 16 (i.e. the other palettes) and want to import those changes, you will need to create a 8bpp TIM file. Obviously if you want both new palettes and new graphics, you will need to create the two; a 4bpp and a 8bpp TIM.

Simply use TIM Utility with the right settings as displayed below. You can preview your file using the "Preview..." button; if it doesn't display properly, something's wrong. If everything looks good, close the Preview window and click "Convert...".
[indent=2]
4bpp: For 4bpp files (Graphic)
8bpp: For 8bpp files and 4bpp files (Palette)[/indent]
[indent=2]
Translucent except black
Transparent for black
[/indent]
[indent=2]
Write Type: TIM
[/indent]

[/indent]


Importing the new Palette (optional)
[indent=2]
* If your Effect file's color depth is "4bpp Multi-CLUT", use the 8bpp TIM file that you created for these steps. If you only edited the first 16 colors, you can instead use the 4bpp TIM file with the range 0x 14 to 0x 33.

  • Open your TIM file and the E???.BIN file in HxD

  • In the TIM file, select 0x 14 to 0x 213 (Use "Select Block..." [ctrl+e] to help)

  • Copy (ctrl+c)

  • In the BIN file, Goto (ctrl+g) to the "Palette Offset" specific on the wiki page for that Effect

  • Paste Write (ctrl+b)



[/indent]


Importing the new Graphic (optional)
[indent=2]
* If your Effect file's color depth is "4bpp Multi-CLUT", use the 4bpp TIM file that you created for these steps

  • Open your TIM file and the E???.BIN file in HxD


    • 8bpp: In the TIM file, select from 0x 220 all the way to the end of the file (Use "Select Block..." [ctrl+e] to help)

    • 4bpp: In the TIM file, select from 0x 40 all the way to the end of the file (Use "Select Block..." [ctrl+e] to help)


  • Copy (ctrl+c)

  • In the BIN file, Goto (ctrl+g) to the "Graphic Offset" specific on the wiki page for that Effect

  • Paste Write (ctrl+b)



[/indent]


Finishing steps
[indent=2]

  • Save your edited BIN file

  • Import it using CDMage/cdprog

  • You is done!

[/indent]

[/indent]


Advanced hacking notes
[indent=2]
Let's say your file changed filesize... Normally you'd use the wiki, where I was nice enough to compile a list of all the offsets for you guys, but here is how it is actually calculated:

4bpp:

  • Graphic Start: File Size - ( Image Width × Image Height ÷ 2 )

  • Palette Start: Graphic Start - 0x204


8bpp:

  • Graphic Start: File Size - ( Image Width × Image Height )

  • Palette Start: Graphic Start - 0x404


[/indent]
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

3lric

Thank you VERY much for this. The new Wiki documentation as well as the tutorial to go along with it will save so much time!

Adding this to the Tutorial Link Index
  • Modding version: PSX

Jumza

Awesome! We sorely needed a new tutorial on recolouring effects :)
  • Modding version: PSX
Nyzer: Alma teleports out of her own possessed body.
Raijinili: Remember that you're telling a modding community that the game they love could use some fixing.

Xifanie

Alright, added the section on how to make 4bpp BMPs with Photoshop and GraphicsGale... and I just found out yesterday that Photoshop easily beats GraphicsGale at that. Well, the only way it could cause real issues in GraphicsGale AFAIK is when you have 2 colors with the same RBG values being used. Because GraphicsGale reconstructs the graphical/palette data in the process, it would set both colors as the first one... meaning this could cause trouble for alternate palettes. We're still talking about a very rare case scenario, but it's worth mentioning.

I can't believe I neglected to add that section... oops. >>;
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Lijj

Xifanie, this is a great tutorial. Also good to know I can still use TIM utility via dosbox.
  • Modding version: PSX

Xifanie

Added the section: Reducing colors while maximizing quality (optional) which I feel is very important for any artist dealing with TIM files to know.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Guru

Wow this is awesome! I had looked into changing the ability effects but this goes way beyond how far I got when researching. That's a pretty sweet looking effect you came up with for this. Thanks for your continued awesomeness xif!

Choto

May 20, 2016, 06:33:19 pm #7 Last Edit: May 20, 2016, 06:56:30 pm by Choto
For whoever wants it, I wrote a bootloader program that will enter all the text in DOSBox to start Windows 3.1. Just put it in the same directory as DOSBox!

Thanks Xif for making our dreams of using timutil again come true!


Edit: Elric had trouble with the program, anybody else try it? Let me know if it worked or not!