As we are talking about the technical side of these patches, I was wondering whether you could describe your development setup (and workflow if possible).
Sure!
I'm a bit old-fashioned, so development is being done on a Windows 7 x64 PC.
1) What IDE/language are you using ? Eclipse ? Microsoft's IDE ? JAVA ? C ?
The custom toolset is comprised of a PCE-VDC-data-to-PNG converter, and PNG-to-PCE-VDC-data converter, and the script-extractor-compiler-inserter. These are all command-line programs so that they can easily be used in batch files.
They're written in C/C++, because I'm so familiar with it, and it's easy to knock up quick programs.
They could be written in C#, Python, or anything else that can memory-map and modify existing binary files.
I'm using Visual Studio 2010 Professional, because the debugger is excellent, and it's the last version before Microsoft screwed-up the IDE.
Although I actually prefer to edit the source code in a separate and more-powerful text editor. That's just personal preference.
But most of my time is either spent at a command-line in TCC/LE, or
MSYS2 if I need some Unix tool like hexdump/grep/diff.
I tend to prefer using batch files for building and testing things (unless I'm debugging the extraction/insertion tools).
I'm using
grafx2 to make all of the graphics changes, because it's quick and simple, and I don't need all of the extra features that something like ProMotion brings to the table.
2) What emulator are you using ? Is it one where you execute the TOC, or do you use a CD emulator like Daemon Tools ?
I use my customized version of Mednafen that I posted here ages ago.
Since I posted that version, Mednafen has finally added some better font choices, but the overall debugger layout still hasn't incorporated the UI layout changes that I made in order to make it prettier to look at and usable.
Because I spend so many hours looking at things in Mednafen's debugger, those changes that I made are really important to my overall comfort in using it.
And without Mednafen's excellent debugger, I wouldn't have done any of this translation work, it would just have been too painful.
When you're at the command line all of the time anyway, it's trivial to launch Mednafen from a batch file or build script, with no need to mess around with a slow GUI.
3) For the SJIS, are you displaying in a different codepage ? Or are you converting to Unicode and back ?
Well, Windows is just in the standard US-English mode.
The scripts are extracted as SJIS, and not Unicode, because it's easier to compile them in SJIS format in order to verify that they produce identical data to the original script chunks.
That's the only way that I can be sure that I understand the complete structure of the script language, and will be able to change the scripts without breaking the game.
It's easy to edit the script files in any text editor that supports SJIS ... like Notepad++
Here's an example of one of the AFS script files ...
.script003:
_call( .chunk01, .script005 )
_call( .chunk00, .script111 )
{買い物なら}*
{カウンターごしに}*
{話しかけてね}
_end()
.script004:
_call( .chunk01, .script005 )
_call( .chunk00, .script111 )
{お買いものですか}*
{何になさいます?}
_wait_for_keypress_then_clr()
_code253A( $00, $00 )
.script122:
_call( .chunk00, .script016 )
_choose( .chunk00, .script006, $00, $10, 0, 2,
22, 10, 6, 2, 22, 12, 6, 2, 22, 14, 6, 2 )
_chosen( .chunk00, .script121, .chunk00, .script124, .chunk00, .script050, $FF )
.script059:
.script124:
_code250E()
_call( .chunk01, .script005 )
_call( .chunk00, .script111 )
{持ち物を買い取れって?これだから田舎者は}*
{困るのよね}
_wait_for_keypress_then_clr()
_jump( .chunk00, .script127 )You can notice a couple of things from that example ...
[ul][li]For a complex script language, it's important to write custom extraction/compilation tools, or else you won't be able to follow the flow of the langauge.[/li][li]You don't need to understand exactly what all of the script commands do in order to work with the scripts.[/li][li]This particular language is a bit of a mess, with scripts calling scripts in different script chunks all over the place.[/li][/ul]
It's the last aspect that probably killed EsperKnight's ability to make any real headway with the script extraction, because until you understand that, you're just looking at fragments of Japanese text that make little sense.
Pretty much the same with the LoX games.
Unless you know that you're looking at a full embedded programming-language inside the game, you really can't understand what's going on, and you'll never be able to successfully modify things (i.e. translate the text) without breaking everything.
Not every game is this complicated, but embedded interpreted application-specific scripting languages were really popular in some genres as an alternative to simple text control-codes within strings.
But ... I'd be surprised if you'd encounter them much on the PCE outside of RPG games, so I hope that people reading this won't be put off trying to do a translation of any of the many other games on our favorite machine!