algoring is a tool that can extract all the dialogs from PSG 1 or 2, and replaces them with (almost) whatever.
It is still in very alpha development and needs lots of debugging, but it should be worth a try.
It is command line based. I planned to make a complete editor but I realised that it was more comfortable to use my prefered editor (Notepad++ for me) which has always more features than I could code.
It is named after those rings you can find in these two games, that let you understand what people say. I thought about naming it Mogic Hat
How do I use it ?
algoring has two mode : extract mode and rebuild (the default, because you usually use extract once and rebuild some thousands times).
Here's a exemple :
1) I make a copy of the ISO, to work with.
2) Using my favourite ISO editor (personnally, I like UltraIso a lot ; moreover, the trial version is free and lets you use < 300 Mb Isos, which is largely sufficient for PSG1 & 2), I extract the file EVENT.DAT somewhere (let's say to d:/somewhere).
3) I launch algoring in extract mode (Note : I use / instread of \ for delimiting directories, though I work on Windows ; both should work) :
- Code: Select all
algoring extract d:/somewhere/EVENT.DAT
It will extract all the sub-files contained in EVENT.DAT (using the descompressador tool, from OrakioRob's team ; glory to them for this marvellous tool).
Those sub-files will be named xx-yyyyyyyy.DAT, where xx is the number of the subfile in the EVENT.DAT, and yyyyyyyy the adress the sub-file starts.
It will the parses all these subfiles and extract strings, convert them in UTF8 encoding and decode the special codes. The results will be saved in files xx.txt (for example, file 03-00003800.DAT will be decoded in 03.txt).
4) I can now edit txt files. For example, let's open 03.txt, go to line 109, where we can find :
僕はその頃,毎晩のように悪夢にうなされていた…。[wait][end]
---
ひとりの少女が
巨大で悪魔のような怪物と戦っている夢だ。[wait][end]
---
僕は,それを近くで見ているのだが
動くことも出来ず,声も出せず,ただ少女が
魔物に痛めつけられるのを見ていることしか出来ないのだ。[wait]
[clear]そして…
少女が力尽きようとしているところで
決まって僕は目が覚める。[wait][end]
These are the first lines of text in the introduction (no, I don't speak japanese, I'll show later how I found them easily). Note the --- that separates each dialog. YOU MUSTN'T DELETE THEM, else the tool won't be able to know which dialog must be replaced by which one, resulting in all dialogs shifted, or an error.
Let's replace them by the well known introducy :
I am haunted by nightmares every night.[wait][end]
---
A young girl is battling a giant demon.[wait][end]
---
I am close by but can not move or speak!
All I can do is watch while the demon keeps striking at the girl.
Just as she is fighting for her life, I awake![wait]
[clear]I awake in my room, dimly lit by the early dawn.[wait][end]
and save the result (as 03.txt)
5) Launch algoring, this time in rebuild mode :
- Code: Select all
algoring -t 03 d:/somewhere/EVENT.DAT
The -t 03 flag means : treat only file 03.txt, leave the others unchanged. It speeds up the process. If you don't use this flag, algoring will use the others txt files. Since they contains the dialogs of the game, the result would be (almost) the same, but slower.
You get a new EVENT.DAT file (in the same directory than the algoring program, unless you precised another location with -o flag)
6) With your ISO editor, remove EVENT.DAT from your PSG iso and replace it with this new EVENT.DAT.
7) Let's run PCSX2 and try :
Seems to work, but...
You can note that some letters are missing. DON'T PANIC! The conceptors of the games didn't include all latin letters in their font, but it's possible to change it (the procedure is described somewhere in PSG1 translation thread, but I think I'll make a tool to automatize the process).
Usage :
Complete (for now) list of options :
Current version is 0.1 (23/09/2012)
extract : actives extract mode (default is rebuild). Create a 'temp' directory whete it decompresses all subfiles from the EVENT.DAT (with holy descompressador tool) and a 'text' directory (if doesn't exist) where it writes all dialogs in separate txt files.
-cols n : format text so as to get at most n characters per row (default : 27, should be 32 for PSG1)
-h : shows help (and stops)
-i id1, ...,idn : ignore files with id given (in hexadecimal). DON'T USE SPACES!
-o path : precise working dir (default : current)
-rows n : format text so as to get at most n rows of characters (default : 3, should be 4 for PSG1)
-s : when extracting, adds to each string infos about the file they belong to and their adress. When rebuilding, add these info too. Be careful, if you both extract and ebuild with this flag, infos will show twice. It permits to localize dialogs (that's how I found the intro text in my example)
-t id1, ..., idn : treats only files with numeros given (in hexadecimal). DON'T USE SPACES ! It's the opposite of -i and overrides it.
Complete list of tags in strings :
[value] : replaces some meseta values in particular in shops' dialogs
[wait] : waits for the circle button to be pressed. Normally, you can ignore it since algoring should be able to automatically insert it (excepted at special occasions). Though, this part has not been heavily tested (so report bugs please).
[newline] : go to next line. Normally, automatically inserted (see above remark). More, simple carriage return has the same effect
[clear] : clear the window and go to top. Same remark as before : should be automatic, so don't use it.
[select] : pops up a Yes/No menu
[end] : end of string, should be automatic (but isn't, for now, I'll fix that)
[blue], [red], [purple], [green], [cyan], [yellow], [white] : change color of text (doh)
[cross], [triangle], [square], [circle] : print some characters that are to find on most keyboards
Oh, and while I'm at it, the character ~ can be used to denote an insecable space (not very useful in English I guess).
Known issues :
- the analysis of the options you give in the command line is very poor. You can enter misformed options and the program doesn't detect it. Thus you can get stupid errors or results searching a lot for what you did wrong.
- it seems that there's an upper limit to the size of a text subfile (I mean, the DAT subfile), around 56 Kb. Only one file is near this limit (file 03 from PSG2, the one I took in the example). Try not to be too verbose when translating it.
- For the moment, that's all, but I fear this list will grow fast.
What can I do ?
Please test it ! It's very alpha and likely full of bugs (most of them likely easy to fix, but I suspect the algorithm to make a mistake somewhere). Take a modified EVENT.DAT, for example the following, which contains original dialogs with extra infos added by the -s flag (except file 03 where I deleted some text to avoid too big a text file ; now introduction and Governor's talks are much faster), and play, speak to everyone, and report all problems.
Download testing EVENT.DAT
Especially, the game can crash. If it happens, please give all the details (which file, which line, when did it occur, if possible upload your memory card) and I'll see what I can do.
Future improvements
First, let's check the game doesn't crash (the worst problem for me), then fix all the bugs in text decoding and formatting.
Then it'll be time for improvements.
I plan (in no particular order, and without garanty I'll do it) :
- automatic Google Translation of dialogs when extracting
- a true recompression (although I don't think it'll be very effective on text, and I don't expect it to permit to overpass size limitation at 56 Kb)
If you have idea, they will be taken in consideration.
Download :
Executable : download me!
Python source :