ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Thu Feb 25, 2021 1:08 pm

All times are UTC




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Tue Feb 09, 2021 12:03 pm 

Joined: Tue Feb 09, 2021 11:55 am
Posts: 6
hello, i am trying to translate the pc game lacrimosa of dana,
I have a couple of little problems,

I have a file called font.itf but I have no idea how to open it or edit to put the symbols ¿¡ that are used in spanish to open question-exclamation do not appear.

On the other hand, I have a lot of .itp files that I have no idea how to open them, because I guess a lot of text is in image format...and it is compressed there.?


thanks


Top
   
PostPosted: Sun Feb 14, 2021 9:26 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11982
Please upload that file (or files) to allow other users to analyze it.


Top
   
PostPosted: Sun Feb 14, 2021 11:23 am 

Joined: Tue Feb 09, 2021 11:55 am
Posts: 6
aluigi wrote:
Please upload that file (or files) to allow other users to analyze it.


one font are .itf and the other example for a .itp
http://www.mediafire.com/file/89qqx49wj ... t.itf/file
http://www.mediafire.com/file/ltserlvka ... 4.itp/file


Top
   
PostPosted: Thu Feb 18, 2021 8:24 am 

Joined: Wed Apr 17, 2019 4:03 pm
Posts: 12
Hi, buddy, Maybe I can help. I've made some fan translations of falcom games (zwei!! series) and do love this game very much .
and I have a version of fan translation of this game in my language (not made by me, though).
I'll try to figure out the data format and put results here~(maybe in 1 to 2 weeks)
However I know nothing about BMS script, so I cannot write BMS script for you, instead, I can show you python/c++ source code to extract them or create a simple executable to do this.


Top
   
PostPosted: Thu Feb 18, 2021 12:03 pm 

Joined: Tue Feb 09, 2021 11:55 am
Posts: 6
haibaer wrote:
Hi, buddy, Maybe I can help. I've made some fan translations of falcom games (zwei!! series) and do love this game very much .
and I have a version of fan translation of this game in my language (not made by me, though).
I'll try to figure out the data format and put results here~(maybe in 1 to 2 weeks)
However I know nothing about BMS script, so I cannot write BMS script for you, instead, I can show you python/c++ source code to extract them or create a simple executable to do this.


all help is welcome.

In the case of the game, there are only two problems, they are all the images in .itp format (you have to open them to have an editable image format) and the font file to add some of them.
The game text there is no problem.

I'll keep an eye out for your information

can you tell me in which language it has been translated, can you give me a link to the translation so I can have a look at it?

thanks ^^


Top
   
PostPosted: Sun Feb 21, 2021 12:37 pm 

Joined: Wed Apr 17, 2019 4:03 pm
Posts: 12
Those itp files are actually DDS files swizzled and compressed.
I still need some time to write a program to extract it.

itf files should be easier, most of glyphs are in 8-bit greyscale bitmaps.

The following code snippet shows how to decompress the data part of itp files.

I'll write a complete executable when possible and put it here.

Code:
def decompress(filedata):
  width, height = struct.unpack('<II', filedata[0x10:0x18])
  print(width, height)
  if filedata[0x50:0x54] != b'IDAT':
    raise Exception('error format')

  offset = 0x74
  bitmap = bytearray()
  next_chunk_offset = offset + 8 + struct.unpack('<I', filedata[offset:offset+4])[0]
  offset += 0xc

  while True:
    count += 1
    arg1 = filedata[offset]
    arg2 = filedata[offset+1]
    offset += 2
    if arg1 == 0:
      bitmap += filedata[offset:offset+arg2]
      offset += arg2
    else:
      start = -arg2 - 1 + len(bitmap)
      for i in range(arg1):
        bitmap += bitmap[start + i].to_bytes(1, byteorder='little')

      offset += 1
      bitmap += filedata[offset].to_bytes(1, byteorder='little')

    if offset >= next_chunk_offset:
      if filedata[offset:offset+4] == b'IEND':
        break
      offset = next_chunk_offset
      next_chunk_offset = offset + 8 + struct.unpack('<I', filedata[offset:offset+4])[0]
      print(format(next_chunk_offset, 'x'), format(struct.unpack('<I', filedata[offset:offset+4])[0], 'x'))
      offset += 0xc

  bitmap = unswizzle(bitmap)
 


Top
   
PostPosted: Sun Feb 21, 2021 3:15 pm 

Joined: Tue Feb 09, 2021 11:55 am
Posts: 6
wow haibaer its amazing!, if helps i found a extractor for the itp for lacrimosa of dana.
https://github.com/Coxxs/itpcnv-dana ..it's a simple javascript .. (sorry i dont know anything of programming)

the question of that is how to compress again the image file when it is edited


Top
   
PostPosted: Mon Feb 22, 2021 2:34 am 

Joined: Wed Apr 17, 2019 4:03 pm
Posts: 12
cloudyst wrote:
wow haibaer its amazing!, if helps i found a extractor for the itp for lacrimosa of dana.
https://github.com/Coxxs/itpcnv-dana ..it's a simple javascript .. (sorry i dont know anything of programming)

the question of that is how to compress again the image file when it is edited


I'm writing the encoder, it should be quiet easy.
Besides, you can try put your modified image with same name (in DX10 dds format) in the "texpack" folder.
If I didn't think it wrong,the game will try to load corresponding file in that folder first.


Top
   
PostPosted: Mon Feb 22, 2021 7:48 am 

Joined: Tue Feb 09, 2021 11:55 am
Posts: 6
haibaer wrote:
cloudyst wrote:
wow haibaer its amazing!, if helps i found a extractor for the itp for lacrimosa of dana.
https://github.com/Coxxs/itpcnv-dana ..it's a simple javascript .. (sorry i dont know anything of programming)

the question of that is how to compress again the image file when it is edited


I'm writing the encoder, it should be quiet easy.
Besides, you can try put your modified image with same name (in DX10 dds format) in the "texpack" folder.
If I didn't think it wrong,the game will try to load corresponding file in that folder first.


yes if put dds in the texpack works :o , but there are more than 400images (only in help and topics)...will consume more (or a lot) vram if I do this?


Top
   
PostPosted: Mon Feb 22, 2021 8:24 am 

Joined: Wed Apr 17, 2019 4:03 pm
Posts: 12
I can't guarantee the usage of vram, but it should be ok as the official updating did the same thing.
And my encoder won't do any compression, because it's not an easy work to recover it's original compression strategy(I can try some strategies, but there's no guarantee about it's compression ratio, sorry I'm not familiar with compression techniques), so the itp files will be larger than it's original size.


Top
   
PostPosted: Mon Feb 22, 2021 9:59 am 

Joined: Tue Feb 09, 2021 11:55 am
Posts: 6
well, in the end it's testing it. I think is not compresion but keep the original format is better?

I also don't know if the itp are loaded when starting the game or work in another way, besides I suppose that if someone want to port the translation to the console version... they don't have a "texpack" folder.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 11 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited