Author Topic: FF10 Attack Name Decompression - need help please  (Read 3428 times)

Lord_Skylark

  • *
  • Posts: 115
    • View Profile
There are 3 or 4 attack sections in the FF10 data all using the same type of compression, which I don't know what it is. If someone could help me that would be great.

One of the attack raw data I uploaded to "www.ffcompendium.com/~Skylark/ff10attack1.bin"

Here's part of the table file for the text (that works with other areas in the game as well - but most text in the game isn't compressed like this is)
30=0
31=1
32=2
33=3
34=4
35=5
36=6
37=7
38=8
39=9
3A=
3B=!
3C="
41='
46=,
47=-
48=.
49=/
4F=?
50=A
51=B
52=C
53=D
54=E
55=F
56=G
57=H
58=I
59=J
5A=K
5B=L
5C=M
5D=N
5E=O
5F=P
60=Q
61=R
62=S
63=T
64=U
65=V
66=W
67=X
68=Y
69=Z
70=a
71=b
72=c
73=d
74=e
75=f
76=g
77=h
78=i
79=j
7A=k
7B=l
7C=m
7D=n
7E=o
7F=p
80=q
81=r
82=s
83=t
84=u
85=v
86=w
87=x
88=y
89=z


The compressed text ends up something like this
<FE><77><7E>
<1B><00><12>Attack
<00><47><00>Command 2
<C0><0B><01>3
<80><0B><0B>Seed Cannon
<A8><0D><05>Burst
<88><0C><06>wallow
<80><09><0B>Regurgitate
<90><0D><0B>adying Quak
<88><10><06>Earthq
<A0><0C><0C>Self-Destruc
<88><45><03>Gaz
<88><16><0B>Ultrasonics
<88><24><88>
<08><05><3A>Boom
<80><0C><03>Poi

In the game, the text will read as:
Attack
Command 2
Command 3
Seed Cannon
Seed Burst
Swallow
Regurgitate
Readying Quake
Earthquake
Self-Destruct
Gaze

etc...

Thanks for any help you can provide.

~Sky

snailrush

  • Guest
FF10 Attack Name Decompression - need help please
« Reply #1 on: 2005-03-19 22:51:58 »
LZS compressed.
(don't ask me more please)

Lord_Skylark

  • *
  • Posts: 115
    • View Profile
FF10 Attack Name Decompression - need help please
« Reply #2 on: 2005-03-23 05:44:38 »
It doesn't work with the LZS uncompressor.

~Sky

Cyberman

  • *
  • Posts: 1572
    • View Profile
FF10 Attack Name Decompression - need help please
« Reply #3 on: 2005-03-25 18:08:41 »
Quote from: Lord_Skylark
It doesn't work with the LZS uncompressor.

~Sky
Did you perform the decompression on the specific range of data associated with it?  Being off from the start byte by one will cause problems.  The other problem of course is knowing the length of the data.  LZS data is potentially recognizable because it will always start with the first bit set in the sequence. If this is not the case with your data it's not likely LZS compressed.

Cyb

Terence Fergusson

  • *
  • Posts: 262
    • View Profile
FF10 Attack Name Decompression - need help please
« Reply #4 on: 2005-03-26 15:49:05 »
It's an LZS variant.

Code basically has two parts: Replace and Raw.

Raw code must be preceded by a length, which can be no greater than 127 bytes.

Replace code has two bytes each, the first being the length, and the second being how far back you have to seek.  The length byte starts at 80 (to differentiate it from a Raw code command) and increments by 8 for every 1 byte.  A code of 80 means that that 3 bytes must be read, and every 8 on top of that means an extra 1 byte.  The seek byte counts back starting from just before the last byte written.

As a result, [80 00] would start from the last byte written and read off the next three (so theoretically, that would repeat the last byte three more times).

Replace codes can be put together without requiring Raw code inbetween: the [88 24 88 08] later in the file demonstrates this by taking the "[00 47 00]S" from one place in the file, and then immediately placing "onic" directly after it from another place in the file.

It's pretty straightforward.  I also assume that a code of [00] means no Replace data, so that the first six bytes would be a 4-byte unknown, a [00] code, and a [12] meaning that the first set of raw bytes is 18 bytes long.  But you'd have to play around with that to be sure.

Didn't look too difficult to me, so I'm surprised you had problems with it.

Lord_Skylark

  • *
  • Posts: 115
    • View Profile
FF10 Attack Name Decompression - need help please
« Reply #5 on: 2005-04-02 04:34:37 »
Thanks for that information. I know some basic c++ coding, but I've never worked with reading raw hex data from a file. How easy would it be to create a program to instantly do that?

Thanks,
~Sky