Hacking Final Fantasy Type-0 RomHacking

SkyBladeCloud

Well-Known Member
OP
Member
Joined
Oct 7, 2010
Messages
452
Trophies
0
Age
33
XP
1,420
Country
Well, well, what can I say about this game? Being a very good title released at the end on the life of its platform made it impossible for the development team to release it outside Japan.

So many "operations", "movements", and "projects"; and after more than a year, the situation is exactly the same. Even so, I still don't see the interest of a fan translation of this game, which surprises me a lot.

Having worked myself on a lot of Spanish fan translations for the PSP (and many other platforms) for many Square Enix games, I had a look at Final Fantasy Type-0. As I said, due to the lack of interest there is no translation available, and as I don't speak Japanese, there is no much more I can do.

Still, I opened this thread to show how the game works internally: as a programmer, I reverse-engineered most of the game engine, making a perfect fan translation *almost possible* (of course, it will never be possible without Japanese translators xD).

-About the game's file system:

Right after opening the ISO, we can clearly see that all the game's data is stored in 2 files:

*yellow.pkg -> The data package, which contains all the game files together
*yellow.fsd -> The file system descriptor, which contains information on how the files are stored in the pkg.

Thew file system descriptor is basically a data base, having:

[Number of stored files in the pkg]
-Then, for each stored file:
[Sector of the pkg where the file start (file offset = sector * 0x800)]
[Implied file sized]

That is en to unpack the data pack. After that, we will find all the game resources including images, audio, video, text, and system data.

-About audio:

We can find 2 types of audio files:
*AT3(+) sound files -> very well known audio format in PSP. Not much to say here.
*ADPCM-encoded stream -> Using the “SSCF” header, this audio format encodes each 16 bit, mono sample in 4 bit data, reducing the size by ¼. It’s pretty easy to decode them knowing how the compression works. Here is an example of a decoded SSCF stream pack:



You guessed right, this is enough to dub the game.

-About graphics


As usual in PSP, all images are encoded in ARGB8888 indexed to 8 bit: so we have 8 bit pixels and a 256 color CLUT (each one 32 bit). This is more than enough to extract, decode, edit and reinsert any image in the game, for example, here is the title menu:

menu1sk.png


Of course, this is needed as many in-game banners are actually graphic files.

-About video files:


Video files are PMF (MPEG2 stream video files with AT3 audio), very common in PSP. Just like with AY3 audio, not much to say here, as everything is known, and many tools exist.

-About system files:

These files are mostly text, event script and 3D model data. They are usually packed in a similar way as the main yellow package. Each package includes a table at the beginning specifiyin:
[Number of packed files]
[A sequential index]
[The package file name]
-Then, for each packed file:
[A file identifier]
[The position in the package]
[The file size]

Unpacking all system files we will find 3D models (they have been mapped and can be previewed like in the following example):

4eb1ea1c_Final-Fantasy-Type-0-Cater-Model.png


And, using the identifier “lang” we can find text files. These text files always use the “ATELY” header, and I’ve mapped the file structure in the following image:

capturepdp.png


*In black -> ATELY constant header
*In grey -> Absolute pointer to the text event script file
*In pink -> Text event script size
-Then, the text data always start at 0x20
*In green -> number of text interventions
*In blue -> Entire text block size
-Then, for each intervention:
*In red -> Intervention index
*In purple -> Intervention size
*In light blue -> intervention text using a custom 16 bit encoding
-Then the next intervention following the same scheme…

In order to decode the custom 16 bit encoding, both the font and Japanese knowledge are needed, as I’m able to extract images, I have full access to the font, shown here:

fnt0.png

fnt1v.png


For a Japanese Speaker, it should be straightforward to understand how the text is encoding
having all this data.

-Conclussions

*As you can see, the game is neither compressed, nor encrypted; it’s just amazing how nobody has actually worked deeply on this game to realize that a fan translation is actually possible.

*I'm posting everything after finding no interest in translating this game after a lot of researching work. It is not my intention to form a translation team, but if anyone find these useful, he/she can count with my help for any possile project.

UPDATE: Tool to extract images like the bitmaps shown in this post:

http://www.mediafire.com/download.php?gdxup2r4t7y4mgm

That is all.

Regards:

~Sky
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
An interesting collection of formats, it seems you and I share a skill set so there is not a lot I can help with here unless you want to throw ideas around for assembly hacks (not that my MIPS knowledge is anything to write home about).

By the way do you have a tile editor/image editor you suggest for the PSP?- 8 bit alpha throws a wrench into most things and though I can get TiledGGD more or less working another is nice to have.
 

SkyBladeCloud

Well-Known Member
OP
Member
Joined
Oct 7, 2010
Messages
452
Trophies
0
Age
33
XP
1,420
Country
I actually fount the scheme I describe for .lang file through asm. It's not important in most cases though (dissidia custom DLC slots is the only thing I recall I wouldn't have been able to do without asm).

As for a good tile viewer tiledGDD is the best one I know, well, in PSP many things are swizzled so a tile editor wouldn't help, but still, it's something.

~Sky
 

xhai

Well-Known Member
Member
Joined
Sep 19, 2012
Messages
173
Trophies
0
XP
109
Country
I actually fount the scheme I describe for .lang file through asm. It's not important in most cases though (dissidia custom DLC slots is the only thing I recall I wouldn't have been able to do without asm).

As for a good tile viewer tiledGDD is the best one I know, well, in PSP many things are swizzled so a tile editor wouldn't help, but still, it's something.

~Sky

Wow! another Great PSP Modder the creator of dissidia moding suite..
if your looking for some translator try to ask this people FrankCadena,CrashmanX,pokefloote,MrShyCity,Romsstar after they finish there own project..

Hmm.. another compression method PKG Files
 

Artistan

Jack of All Trades
Newcomer
Joined
Dec 30, 2012
Messages
53
Trophies
0
XP
125
Country
United States
I am very interested on translating this game - fairly fluent on Japanese myself. I've spent so far half a day today gather information about doing this and so far gotten the files extracted. Though the searching for the right file and trying to even find information about the text encoding is leading me to a dead end.

Any more pointers?
 

CrashmanX

Current project: SD Gundam G Generation Overworld
Member
Joined
Aug 1, 2008
Messages
1,217
Trophies
0
Age
31
Location
@CrashmanX
Website
boards.4chan.org
XP
556
Country
United States
Sky, I have a bit of a question for you, do you have any knowledge of CPK files? Just a bit curious if you could help me with another game using CPK files.
If not, s'all good or if you're busy s'all good too.
 

SkyBladeCloud

Well-Known Member
OP
Member
Joined
Oct 7, 2010
Messages
452
Trophies
0
Age
33
XP
1,420
Country
I am very interested on translating this game - fairly fluent on Japanese myself. I've spent so far half a day today gather information about doing this and so far gotten the files extracted. Though the searching for the right file and trying to even find information about the text encoding is leading me to a dead end.

Any more pointers?

I'm actually waiting for people (like you, able to translate from Japanese) to gather a team. If that happens, I would code a set of tools so the translators would only care about translating the text (for example, some, or should I say, MANY txt files) and images (png files like the one shown in the OP).

I fact, I already decoded a pair of text files (using my hex editor) and found quite a lot of many other text files (I hope they are all); for example:

Code:
皇国首都 ホテル・アルマダ
皇国首都 0720地区
皇国首都 0729地区
皇国首都 帝都鉄道 列車上
皇国首都 3348地区 停車所
皇国首都 A13ビル 1F
皇国首都 A13ビル 屋上
皇国首都 3360地区
旧ロリカ同盟領 廃屋
魔導院 ルブルム広場
魔導院 ルブルム広場
第二章 開始
不時着地点
朱雀軍 臨時指令部
ユウグモ 墜落現場
ユウグモ 墜落現場
青龍飛空艇 接岸地点
朱雀軍 臨時指令部
脱出艇停泊所
第六章 開始
第六章 開始
万象の間
生命の間
滅尽の門
万魔殿 降神殿
ストーリークリア
トゴレス要塞 中枢部 第二研究所
トゴレス要塞 中枢部 動力室
トゴレス要塞 通路
第三章 開始
国境平原
ビッグブリッジ 西岸
皇国軍 砲兵隊機関区
ビッグブリッジ 西岸
第七章 開始
朱雀軍 出撃拠点
研究棟 第16管理室
研究棟 外周
開発棟 第21管理室
開発棟 警備用魔導アーマー格納庫
第四章 開始
イスカ地下水路 第一三九区画
魔導院 サロン
魔導院 サロン
魔導院 廊下
魔導院 闘技場
魔導院 正面ゲート
魔導院 飛空艇発着所
魔導院 廊下
魔導院 闘技場
魔導院 正面ゲート
魔導院 飛空艇発着所
皇国首都 ホテル・アルマダ前
旧ロリカ同盟領 廃屋
魔導院 廊下
魔導院 闘技場
魔導院 正面ゲート
魔導院 飛空艇発着所
魔導院 廊下
魔導院 闘技場
魔導院 正面ゲート
魔導院 飛空艇発着所
魔導院 廊下
魔導院 飛空艇発着所
朱雀軍 最終防衛線
国境平原
魔導院 サロン
3348地区線路上
A13ビル 1F
魔導院 サロン
アクヴィの町
魔導院 サロン
魔導院 サロン
ルブルム地方
イスカ地方
イスカ地方
北トゴレス地方
メロエ地方
第三章 開始
旧ロリカ同盟領 廃屋
第四章 開始
エイボン地方
第六章 開始
ローシャナ州
龍神の聖域
セトメ地区
東ネシェル地区
アズール地区
第七章 開始
第八章 開始
旧ロリカ地域
龍神の聖域
セトメ地区
未使用
未使用
トゴレス地方
未使用
未使用
西ネシェル地区
西ネシェル地区
マクタイの町
コルシの町
アクヴィの町
キザイアの町
ミィコウの町
ロコルの町
トグアの町
メロエの町
セトメの町
ローシャナの町
ラーマの町
バズの町
シャカラの町
ライローキの町
アミターの町
アズールの町
イスカの町
イスカの町
イスカの町
イスカの町
イスカの町
イスカの町
フロスティ基地 中央集積地
第二章 開始
ルブルム地方
イスカ地方
メロエ地方
エイボン地方
アズール地区
ローシャナ州
魔導院 正面ゲート
開発棟 警備用魔導アーマー格納庫
第五章 開始
アギトの塔 虚空の回廊 弐
アギトの塔 虚空の回廊 参
アギトの塔 虚空の回廊 四
アギトの塔 虚空の回廊 五
アギトの塔 虚空の回廊 六
飛空艇 セッツァー
旧ロリカ同盟領 廃屋
飛空艇 セッツァー
飛空艇 セッツァー
ビッグブリッジ 東岸
イスカ地方
北トゴレス地方
ローシャナ州
アズールの町
セトメの町
第八章 開始
サイレントヤード 入口
アギトの塔 入口

Sky, I have a bit of a question for you, do you have any knowledge of CPK files? Just a bit curious if you could help me with another game using CPK files.
If not, s'all good or if you're busy s'all good too.

That depends on the game, PM me the details ;)

~Sky
 

Frank Cadena

Well-Known Member
Member
Joined
Sep 13, 2009
Messages
317
Trophies
0
XP
123
Country
Wow, I'm impressed. I'm looking forward to seeing who else, other than Artistan, is going to help with the project and possibly help Artistan out. Pair this with the english translation wiki... I'm excited :) Also, I'm hoping that Sky could help CrashmanX with the G Gen CPK problem. Now that's a game that I'm dying to translate with CrashmanX.
 

MrShyCity

Member Class Zero - No.00 SHY
Member
Joined
Sep 13, 2012
Messages
218
Trophies
0
Location
Flip
Website
shypsp.blogspot.com
XP
125
Country
those script you gather is that from 14181.data file?
i tried those before editing but it causes the game to freeze and some text wont show (well at less the one i tried)
i believe you have to extract the .data files

talk to TruthKey he might help you just out
 

SkyBladeCloud

Well-Known Member
OP
Member
Joined
Oct 7, 2010
Messages
452
Trophies
0
Age
33
XP
1,420
Country
No, so far I'm developing everything for the translation from scratch so those text aren't from the 14181.data file, in fact, I name my files in a different way.
Still, I just started coding, but I might have something usable by the time a group of about 4 translators are gathered.

You see, IDK if you guys are aware, but Type-0 has been already translated in just 3 months to Chinese by a team of 14 translators an 2 programmers.

About Truthkey, he stopped working on his project claiming that it was impossible... and that a official localization would happen (I thought the same, but I'm no longer that sure).

~Sky
 

Frank Cadena

Well-Known Member
Member
Joined
Sep 13, 2009
Messages
317
Trophies
0
XP
123
Country
Wow, 14 translators? I wonder how the quality of the translation turned out. Usually having that many translators would make translating stuff take longer because of the need to make sure everything is named correctly and to meld different writing styles into one coherent one. 3 translators is usually a good number, with one head translator to make sure everything is one the same page.

So 4 is a good number though I'm not sure how many people would be willing to help out with translating the text.I'd help but I'm busy with Danball and RL.
 

MrShyCity

Member Class Zero - No.00 SHY
Member
Joined
Sep 13, 2012
Messages
218
Trophies
0
Location
Flip
Website
shypsp.blogspot.com
XP
125
Country
ohh true cause i just look at the 14181.data the script you posted is pretty much the same
and changing the encoding to shift-jis would get me result of something like this
Code:
ョニラムニ

man 14 translators thats a lot must be planing to translate the whole thing

your looking for a team count me in once im done with my project
though im not an Japanese speaker
 

BrightNeko

Popcorn ball
Member
Joined
Dec 11, 2010
Messages
915
Trophies
0
Age
31
Location
Texas
Website
Visit site
XP
389
Country
United States
This is something I've been waiting for since square don't seem like they will do it. What with it being said to be a PSvita game if coming to the states, then being said to be in limbo forever. I know this isn't a project in itself but just someone coming around to push the idea forward is awesome. So even if nothing comes of it thank you mister sky.
 

Artistan

Jack of All Trades
Newcomer
Joined
Dec 30, 2012
Messages
53
Trophies
0
XP
125
Country
United States
Though as extensive the list is, there is still plenty of things to be translated other than the story.
But that is part of the fun.
 

NSRSM

Well-Known Member
Member
Joined
Sep 20, 2007
Messages
262
Trophies
0
XP
275
Country
United States
Crimson Codex is also a large part that needs translation besides the main story as it details a lot of background information for character's the Orience's history along with background info for things during the main scenario. Along with the fact of the various dialogue during ingame known as COMM messages. I'll help in anyway I can but I am no translator, nor do I know anything about game code.

Game is text heavy.

First, the Crimson Codex (732 Files ~ about 50% of the Game's data, maybe less.)
197 Videos that have to be translated and dubbed.
009 Benefit Videos that have to translated and dubbed.
046 Military Files that have to be translated.
040 Strategy Files that have to be translated.
200 Character Files that have to be translated.
023 Eidolon Files that have to be translated.
081 Enemy Files that have to be translated.
020 System Knowledge Files that have to be translated.
016 Mission Knowledge Files that have to be translated.
021 World Map Knowledge Files that have to be translated.

As well as the rest of the game's data (about 50% of the Game's data, maybe more.)
All the Characters Abilities
All the Items
All the World Map
All the Character's Dialogue
All the Enemies and their Stats
All the Moogle Lessons
All the COMM Messages
 

Dystopiq

Member
Newcomer
Joined
Jan 1, 2013
Messages
20
Trophies
0
Age
35
XP
170
Country
United States
Oh, my mistake. I was under the impression that had been done already. Apologies. It has been over a year and no info has come out. It's safe to say that a translating endeavor can be done since SE wants to take their sweet time with this but keep milking XIII.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @K3Nv2, i have a physical copy of mgs4