Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MDT (Gotcha Force): Difference between revisions

Line 23: Line 23:
* 4 bytes - paragraph_offsets_blocks_list
* 4 bytes - paragraph_offsets_blocks_list
* 4 bytes - symbols_count # number of symbols contained in the tpl
* 4 bytes - symbols_count # number of symbols contained in the tpl
* 2 bytes - offsets in the file relative to after the header (array)? same count than symbols
* 2 bytes - universal symbols ID shared between all .mdt and positionnal from tpl file
'''paragraph_offsets_blocks_list''':
'''paragraph_offsets_blocks_list''':
* 4 bytes - uint32 absolute offsets - array of paragraph_offsets_block terminated by -1 (FF FF FF FF)
* 4 bytes - uint32 absolute offsets - array of paragraph_offsets_block terminated by -1 (FF FF FF FF)
Line 34: Line 34:


data_block contains int16 indexes relative to the tpl symbol list. First symbol in the tpl has number 0 then horizontaly symbol 1, 2 ... So data block(s) contains texts.
data_block contains int16 indexes relative to the tpl symbol list. First symbol in the tpl has number 0 then horizontaly symbol 1, 2 ... So data block(s) contains texts.
* FFFE: space
* FFFE: space <- each negative value describe something not present in the tpl
* 1000: new line
* 1000: new line
* 1001: end of the phrase
* 1001: end of the phrase
Line 40: Line 40:
* 80FF: stop appliying a color
* 80FF: stop appliying a color
* 8002: use the player name
* 8002: use the player name
== Text engine ==
The text engine use a hash table corresponding to symbols and allow to color the textures or use vars like player name. Here is the hashtable:


Virtual World RE has developed the python script [https://github.com/Virtual-World-RE/NeoGF/tree/main/pzztool pzztool.py] to manipulate MDT files and their internal files allowing to unpack / pack mdt files.
Virtual World RE has developed the python script [https://github.com/Virtual-World-RE/NeoGF/tree/main/pzztool pzztool.py] to manipulate MDT files and their internal files allowing to unpack / pack mdt files.

Revision as of 15:27, 12 September 2022

← Gotcha Force

This article is about Gotcha Force MDT file format and ongoing researchs on it.

This section is currently being written.
More research is needed and some paragraphs may be wrong.

mdt files:

MDT files are same than pzz but packing only uncompressed files.

MDT header (0x800 bytes):

  • 4 bytes - uint32 file count (big endian)
  • 4 bytes - uint32 array: file size divided by 0x800 and upper rounded for each file

All .mdt contains 2 files:

  • 000 dat file with texts used in the game
  • 001 TPL including an alphanumeric alphabet used by the dat file

dat file:

header:

  • 4 bytes - paragraph_offsets_blocks_list
  • 4 bytes - symbols_count # number of symbols contained in the tpl
  • 2 bytes - universal symbols ID shared between all .mdt and positionnal from tpl file

paragraph_offsets_blocks_list:

  • 4 bytes - uint32 absolute offsets - array of paragraph_offsets_block terminated by -1 (FF FF FF FF)

paragraph_offsets_block 0: # first paragraph_offsets_block describing all paragraph offsets in the data block 0

  • 4 bytes - int32 array of absolute offsets which point to pragraphs in the data block terminated by -1 (FF FF FF FF). The first offset is the data block offset.

data_block 0:

  • 2 bytes - signed int16 list <- paragraph_offsets_block 0 describe where each paragraph begin.

paragraph_offsets_block 1: ... data_block 1: ...

data_block contains int16 indexes relative to the tpl symbol list. First symbol in the tpl has number 0 then horizontaly symbol 1, 2 ... So data block(s) contains texts.

  • FFFE: space <- each negative value describe something not present in the tpl
  • 1000: new line
  • 1001: end of the phrase
  • 80yy: start appliying a color to following letters
  • 80FF: stop appliying a color
  • 8002: use the player name

Text engine

The text engine use a hash table corresponding to symbols and allow to color the textures or use vars like player name. Here is the hashtable:


Virtual World RE has developed the python script pzztool.py to manipulate MDT files and their internal files allowing to unpack / pack mdt files.