Editing assests/res/fonts/gamefont.tga

ArbitraryGuy

Rusty Shackleford?
Joined
Jul 11, 2003
Messages
1,076
Well... this is really stupid. In order to put in a new religion and have its icon show up on the city bar on the map, you must edit assets/res/fonts/gamefont.tga and gamefont_75.tga. However, whenever I save gamefont.tga (haven't messed around with gamefont_75.tga yet) with Photoshop the game crashes on start up. I tried 16 bit, 24 bit and 32 bit and compression, but they all didn't work. Anyone know how to edit this without screwing up? The problem is how to save gamefont.tga. Anyone know how to do this properly? Thanks. This will help modders everywhere.
 
ArbitraryGuy said:
Well... this is really stupid. In order to put in a new religion and have its icon show up on the city bar on the map, you must edit assets/res/fonts/gamefont.tga and gamefont_75.tga. However, whenever I save gamefont.tga (haven't messed around with gamefont_75.tga yet) with Photoshop the game crashes on start up. I tried 16 bit, 24 bit and 32 bit and compression, but they all didn't work. Anyone know how to edit this without screwing up? The problem is how to save gamefont.tga. Anyone know how to do this properly? Thanks. This will help modders everywhere.

I have been trying to do exactly the same thing - and have had exactly the same result. If I change just one pixel of one diagram, or if I alter in any way any picture, this causes a crash on start-up. I have tried copy-pasting parts of diagram, and using various picture editing and picture viewing programs (including programs which fully support the TGA format). Any change, no matter how small, will automatically cause a CTD (crash to desktop).

The Greek World mod successfully changes the GameFont (and GameFont_75) files. If I use these graphics files - and no other changes, it works fine. If I try to make any changes to these files, I get a CTD.

Later on I have made absolutely no changes at all! I have just opened the GameFont.tga file using IrfanView, save-as TrueVision Targa (TGA), and kept the name. I have noticed that the original file was 500kb, whereas the new file is only 300kb even though everything should be exactly the same, which means that 200kb is missing!!! ...and this is probably causing the crash.

Looking on google I found various mentions to an 'alpha layer'. I do not know what this is, but I suspect it is related.

Using adobe photoshop I saved the file as 32 bit compression, which meant that the new save is 512kb, whilst the old save was 529kb. I then loaded it (the new 32 bit file) and it worked! I'll do some more tests.
 
Ok, I can confirm it. I have successfully edited the .tga files.

The TGA files must be saved as 32-bit TGA.

Which means I am constrained to use photoshop as I have no other program capable of 32 bit saving...does anyone know of an easy to use program which I could use? :)
 
Well I try to explain it :crazyeye: .

I don't use Paintshop but maybe it supports the alpha too. Try to find a option for open/saving with alpha. Layers are the main feature of Photoshop,
so if you use it don´t read further (read the manual instead :D ).

First you have the main picture that you can see with every image viewer. Some important notice of the pink grid, it controls the size of the boxes. If you remove just one pixel of the grid the whole file will be messed up.

But there is also a alpha layer (or alpha channel), a second greyscale picture to inform the game what is visible (white) and invisible (black). For example the letters, they will not appear in the main picture because they are white.

Try to open the File with DXTbmp . It will show the main picture and on the upper right the alpha. If you change the prefs of the program it can export the main picture and the alpha layer as seperate bmp to your graphic program. There you can edit it and send it back to DXTbmp, it will merge the pictures together.
 
Back
Top Bottom