help with unknown texture format [eastward]

Textures, recreate headers, conversions, algorithms and parsing of image files
cyborg77
Posts: 2
Joined: Tue Oct 05, 2021 7:07 pm

Re: help with unknown texture format [eastward]

Post by cyborg77 »

cyborg77 wrote:
HydeFromT70s wrote:Guys, do you know exactly which file in font.g or ttf.g is responsible for in-game font and how can I edit it to add some additional characters?

Image


Is there any way to replace this texture?

Image
canboy
Posts: 42
Joined: Fri Jun 26, 2020 3:24 pm

Re: help with unknown texture format [eastward]

Post by canboy »

cyborg77 wrote:
cyborg77 wrote:
HydeFromT70s wrote:Guys, do you know exactly which file in font.g or ttf.g is responsible for in-game font and how can I edit it to add some additional characters?

Image


Is there any way to replace this texture?

Image

use Crystaltile2 to view and edit
Image
swat
Posts: 15
Joined: Sat May 15, 2021 8:58 am

Re: help with unknown texture format [eastward]

Post by swat »

which file in font.g is responsible for in-game font
and
how to add additional characters? (şŞıİğĞ)
canboy
Posts: 42
Joined: Fri Jun 26, 2020 3:24 pm

Re: help with unknown texture format [eastward]

Post by canboy »

swat wrote:which file in font.g is responsible for in-game font
and
how to add additional characters? (şŞıİğĞ)

usebmfont to create image and fnt file
dialog font is pixel operator
swat
Posts: 15
Joined: Sat May 15, 2021 8:58 am

Re: help with unknown texture format [eastward]

Post by swat »

canboy wrote:
swat wrote:which file in font.g is responsible for in-game font
and
how to add additional characters? (şŞıİğĞ)

usebmfont to create image and fnt file
dialog font is pixel operator


I have used bmfont to create fnt and tga files.
what is the next?
In which file do I import these two files?
and how?
canboy
Posts: 42
Joined: Fri Jun 26, 2020 3:24 pm

Re: help with unknown texture format [eastward]

Post by canboy »

swat wrote:
canboy wrote:
swat wrote:which file in font.g is responsible for in-game font
and
how to add additional characters? (şŞıİğĞ)

usebmfont to create image and fnt file
dialog font is pixel operator


I have used bmfont to create fnt and tga files.
what is the next?
In which file do I import these two files?
and how?

Export it with bmfont to exact canvas size of original image then replace it in crystaltile2
And replace source fnt file with new fnt file
JokerDKha
Posts: 14
Joined: Tue Oct 29, 2019 1:12 am

Re: help with unknown texture format [eastward]

Post by JokerDKha »

Are anyone know where this 8bit fonts is location???
Image
canboy
Posts: 42
Joined: Fri Jun 26, 2020 3:24 pm

Re: help with unknown texture format [eastward]

Post by canboy »

JokerDKha wrote:Are anyone know where this 8bit fonts is location???
Image

it's pixel operator font
you can edit it to use an ttf font in the index, but the ttf render have some weird problem so still prefer the bitmap one
Image
canboy
Posts: 42
Joined: Fri Jun 26, 2020 3:24 pm

Re: help with unknown texture format [eastward]

Post by canboy »

Allen wrote:The data is compressed, and I scanned it with quickbms to show that it uses the "LZ77EA_970" compression algorithm.

Format:

Code: Select all

char    magic[3];//PGF
byte    unkLen;
DWORD   fileSize;
byte    unkData[unkLen];
DWORD   dataSize;
DWORD   width;
DWORD   height;
byte    bpp;
byte    unk2;
byte    unkLen2;
byte    unk3;
byte    unkData2[unkLen2];
byte    datas[dataSize];

Image


If change comtype to LZ4, it Also Worked.
It should be used LZ4 compression algorithm, but they have the same algorithm for decompressing data.

when i view the file, it show up an transparent bg like this
Image
but when i'm just export it then reimport, it became black bg like this
Image
is that a color format error?
Allen
Posts: 156
Joined: Tue Sep 01, 2015 9:44 am

Re: help with unknown texture format [eastward]

Post by Allen »

canboy wrote:when i view the file, it show up an transparent bg like this
Image
but when i'm just export it then reimport, it became black bg like this
Image
is that a color format error?


It looks like the alpha channel is broken. No transparency value is set.

I have provided a simple recompression script here. The target is RAW RGBA32 format data extracted from my first script.
eastward pgf.zip

1. Extract RAW RGBA32 data from the PGF file, and modify or add characters to the image
2. Recompress to lz4 data
3. Use the 010 editor template to modify and replace related data.

char magic[3];//PGF Pixpil Graphic Format
byte unkLen;
DWORD fileSize; // You need change this value.
byte unkData[unkLen];
DWORD dataSize;//compress data size. You need change this value.
DWORD width;
DWORD height;
byte bpp;
byte unk2;
byte unkLen2;
byte unk3;
byte unkData2[unkLen2];
byte datas[dataSize];//comtype LZ4. You need change this datas.


I tested that if you do not make any changes, it will not look like your picture after recompressing it.
The result is normal, so if you change the ALPHA channel correctly, there will be no errors when you compress it back.
recompress sample.zip



I also provided a Noesis viewing script, you need to change the file name to a .pgf suffix.
fmt_eastward_tex.zip

I wrote a function to export RAW RGBA32, which can replace the first step of the BMS script.
When you use Noesis to view the image, export the editable image format (such as PNG), and then modify it. When you are done modify, use Noesis again to open the modified image, export to .pgf format (The pgf here is only the original RGBA32 data, which cannot be viewed directly by Noesis), and then start from the second step (bms recompression). Can avoid the alpha channel setting error.
jonastraducoes
Posts: 88
Joined: Sun Aug 18, 2019 1:33 am

Re: help with unknown texture format [eastward]

Post by jonastraducoes »

Allen wrote:
canboy wrote:when i view the file, it show up an transparent bg like this
Image
but when i'm just export it then reimport, it became black bg like this
Image
is that a color format error?


It looks like the alpha channel is broken. No transparency value is set.

I have provided a simple recompression script here. The target is RAW RGBA32 format data extracted from my first script.
eastward pgf.zip
1. Extract RAW RGBA32 data from the PGF file, and modify or add characters to the image
2. Recompress to lz4 data
3. Use the 010 editor template to modify and replace related data.

char magic[3];//PGF Pixpil Graphic Format
byte unkLen;
DWORD fileSize; // You need change this value.
byte unkData[unkLen];
DWORD dataSize;//compress data size. You need change this value.
DWORD width;
DWORD height;
byte bpp;
byte unk2;
byte unkLen2;
byte unk3;
byte unkData2[unkLen2];
byte datas[dataSize];//comtype LZ4. You need change this datas.


I tested that if you do not make any changes, it will not look like your picture after recompressing it.
The result is normal, so if you change the ALPHA channel correctly, there will be no errors when you compress it back.
recompress sample.zip


I also provided a Noesis viewing script, you need to change the file name to a .pgf suffix.
fmt_eastward_tex.zip
I wrote a function to export RAW RGBA32, which can replace the first step of the BMS script.
When you use Noesis to view the image, export the editable image format (such as PNG), and then modify it. When you are done modify, use Noesis again to open the modified image, export to .pgf format (The pgf here is only the original RGBA32 data, which cannot be viewed directly by Noesis), and then start from the second step (bms recompression). Can avoid the alpha channel setting error.


Thanks for the scripts!
But I follow all the steps I can insert the edited images, but it is black and white and in color where it is written tribogamer and PKG!
Can you tell me where I'm wrong!

file edit
https://cdn.discordapp.com/attachments/ ... 6032400d97

Image color white
Image

Image all color
Image
cic
Posts: 45
Joined: Fri Jan 07, 2022 7:44 pm

Re: help with unknown texture format [eastward]

Post by cic »

Thanks
Allen
Posts: 156
Joined: Tue Sep 01, 2015 9:44 am

Re: help with unknown texture format [eastward]

Post by Allen »

jonastraducoes wrote:Thanks for the scripts!
But I follow all the steps I can insert the edited images, but it is black and white and in color where it is written tribogamer and PKG!
Can you tell me where I'm wrong!

file edit
https://cdn.discordapp.com/attachments/ ... 6032400d97

Image color white
Image

Image all color
Image


I decompressed the data and the colors are colored.
Have you tried modifying other images? Are they black and white?
I guess that the LOGO image only reads the ALPHA channel, and the RGB channel does not work. This should be a special setting of the game.
canboy
Posts: 42
Joined: Fri Jun 26, 2020 3:24 pm

Re: help with unknown texture format [eastward]

Post by canboy »

Allen wrote:
canboy wrote:when i view the file, it show up an transparent bg like this
Image
but when i'm just export it then reimport, it became black bg like this
Image
is that a color format error?


It looks like the alpha channel is broken. No transparency value is set.

I have provided a simple recompression script here. The target is RAW RGBA32 format data extracted from my first script.
eastward pgf.zip
1. Extract RAW RGBA32 data from the PGF file, and modify or add characters to the image
2. Recompress to lz4 data
3. Use the 010 editor template to modify and replace related data.

char magic[3];//PGF Pixpil Graphic Format
byte unkLen;
DWORD fileSize; // You need change this value.
byte unkData[unkLen];
DWORD dataSize;//compress data size. You need change this value.
DWORD width;
DWORD height;
byte bpp;
byte unk2;
byte unkLen2;
byte unk3;
byte unkData2[unkLen2];
byte datas[dataSize];//comtype LZ4. You need change this datas.


I tested that if you do not make any changes, it will not look like your picture after recompressing it.
The result is normal, so if you change the ALPHA channel correctly, there will be no errors when you compress it back.
recompress sample.zip


I also provided a Noesis viewing script, you need to change the file name to a .pgf suffix.
fmt_eastward_tex.zip
I wrote a function to export RAW RGBA32, which can replace the first step of the BMS script.
When you use Noesis to view the image, export the editable image format (such as PNG), and then modify it. When you are done modify, use Noesis again to open the modified image, export to .pgf format (The pgf here is only the original RGBA32 data, which cannot be viewed directly by Noesis), and then start from the second step (bms recompression). Can avoid the alpha channel setting error.

Could you explain a little bit about the step?
I'm currently export the first step with noesis, recompress to lz4 by the second bms, but the last one make me confuse
I'm trying to load the original file with the template, then replace the datas section with the whole compressed file, and seem that still not correct.
Hope you could explain a little bit more 'bout the third step, thx for help
Allen
Posts: 156
Joined: Tue Sep 01, 2015 9:44 am

Re: help with unknown texture format [eastward]

Post by Allen »

The third step decomposition:
1) Load the original file with 010editor and load the .bt template.
Select "datas" (compressed data), then delete. Record the current file size, we denote it as A.
2) Open the recompressed file with 010editor, and then record the recompressed file size, which we record as B, copy all data to the end of the source file, and then modify "dataSize" to the recorded recompressed file size B.
3) Record the current modified file size and modify the entire file size (A+B), which is "fileSize".