Time for another couple of screenshots ...
It's nice to see some progress, but they don't look too impressive when compared to the previous screenshots, do they?
It's just from the first building that you go into when you start the game. Wasn't that already done?
The answer is "No" ... this is actually a
major step forward, and one that's taken a lot of invisible time-and-effort.
Let me explain ...
******************
As SamIAm has said in the main thread, in the past couple of weeks I've actually got all of his current translations inserted into the game (the first 5 levels).
My goal is to get to the point that I can just give him a set of insertion tools, and then he'll be able to make small edits and quickly see how they look in the game.
We're still quite a way away from that goal, but now we're one big step closer.
That's because the game has been built like an onion ... with many layers.
The 12 levels (which contain a total of 168 script files) that SamIAm has been translating are at the outer layer.
They're the most important part of the game ... but they often refer to little snippets of script data that are actually stored in the inside the middle layer, the Game Code overlay itself.
The Game Code overlay uses functions that are built into the Boot Code ... the inner layer.
This is a very structured way of putting a game together, but it can be a real PITA to hack.
In contrast, Zeroigar was constructed like a book ... totally separate pages that really didn't refer to each other. It was also a PITA to hack, but in a totally different way.
In Zeroigar, with its 35+ different programs, I'd often have to find/implement similar hacks in all 35+ different programs. But since each one was separate, each hack was independant of the others, and nothing relied on the previous hacks. That is time-consuming and terribly boring to do ... but it's not particularly difficult.
In the Xanadu games, changes can affect each other. That's a more efficient way of doing things, but it's a bit more complicated to manage.
In particular ... the method that I'm using for recompiling the translated scripts, and for handling the overflow that happens because there's not enough room to the English text, and then repackaging everything back into each level's META_BLOCK so that it gets loaded correctly ... well, that just doesn't work for those inner layers.
Modifying the whole process to be able to handle those inner layers is what has taken a lot of time over the last couple of weeks.
In Xanadu 1, nearly all of the item description script data is stored in the Game Code overlay. The name "Arios" is also in there, as are various common scripts such as the generic things that the "Sister" says when you're in a temple.
Interestingly enough ... each level's META_BLOCK also contains a special DATA_CHUNK with up to 8 level-specific custom items that overwrite the default item descriptions in the Game Code overlay when that level is loaded.
It was only a couple of days ago that I found out that those existed, and then tracked down how they were done. We weren't extracting those scripts before ... now we are.
The problems with having all those scripts in the Game Code overlay is that ...
[uldecimal][li] there isn't enough memory in the Game Code overlay for the English versions.[/li][li]the scripts in the levels directly refer to the locations of the scripts in the code.[/li][/ul]That's meant that I've had to figure out both how to load up the extra data for the translations, and also how to tell all the level scripts that the Game Code scripts have moved to a different location.
******************
Solving the 1st part has meant splitting the scripts that are in the Game Code into 3 different parts.
The script table that is used to locate each item's description has been moved into some of my extremely-precious free space in the CD Boot Code section. That means that it is always available for reference/modification, which is needed for when the Game Code loads the level-specific item descriptions and overwrites some of the table entries.
The item descriptions themselves have been moved into the bank of extra memory that I've freed by recompressing all of the game's data (the META_BLOCKs) with the more-efficient SWD5 compression.
I've written some new code that's been added to the Boot Code itself to actually load those item descriptions and then copy them into that bank.
All the "names" and "common" scripts are still in the Game Code overlay, and now that the item descriptions have been removed from it, there's plenty of room in the overlay for the larger translations.
FYI ... the current English translations that have been inserted are sometimes taking up to 50% more space than the original Japanese scripts.
******************
Solving the 2nd part has been easier, but needs to be improved.
When I first started to disassemble the scripts and found that Falcom were structuring the game like this, I knew that I'd have to deal with it at some point, and so added the information into the extraction process.
Each script file that SamIAm is translating has a section at the top that contains a list of the "external" scripts that that particular script can refer to that aren't actually located in that particular script file.
It looks like ...
@extscript( $997e, .table997E )
@extscript( $9ea8, .script9EA8 )
@extscript( $9ead, .script9EAD )
@extscript( $9ecd, .script9ECD )
@extscript( $9f1b, .script9F1B )
@extscript( $9f8b, .script9F8B )This tells the script compiler that when it sees a script referring to something with one of those labels (the 2nd value), then it should actually compile in a different address (the 1st value).
Now that I've actually got those scripts compiling, that table is changed to the following, which corresponds the the new locations of each of the scripts ...
@extscript( $3f7e, .table997E )
@extscript( $9614, .script9EA8 )
@extscript( $998a, .script9EAD )
@extscript( $99bb, .script9ECD )
@extscript( $9a2a, .script9F1B )
@extscript( $9ad1, .script9F8B )This is fine, and works great (you can see the results in the screenshots above), but it's a real PITA to manage.
It means that whenever SamIAm or I edits one of those scripts in the Game Code, then I've got to change that table in all 168 script files.
I need to implement a "better" solution for the script compiler (like "include" files) ... that's the next task on my list.
******************
So, the conclusion from all of this rambling, is that what you are seeing in those screenshots at the start of this message is actually the result of scripts that are located in a number of different places and that are loaded into memory at totally different times.
The 1st screenshot comes from a script that's located in the 1st script file for the 1st level (the Prologue).
Then, that same script calls some code that gives the player the "Clothes" item, and then calls another script in the Game Code overlay to display the "item-received" script (which has been re-compiled into a new location).
The "item-received" script then looks up the item number in the item table (which has been re-compiled into the Boot Code), and then prints out the item description for "Clothes" (which has been re-compiled into the extra script memory that I've freed-up), and finally prints out " received."
So, even though it just looks like a simple pair of messages on screen ... getting all those things working and properly-coordinated is actually a pretty major step forward in getting the translation done.