Setting up a Project

A GraceNote project requires:

Optionally, you can also add:

Creating the Databases

GraceNote's databases are standard SQLite databases. Their command line utility is good for basic creation of them, but you'll probably want to use a SQLite library for a programming language to actually rip and insert the text. Sample C# code is provided below.

Anyway, to start off, create a database named ChangeLog with the following table:

	CREATE TABLE Log(id INT PRIMARY KEY, file TEXT, name TEXT, timestamp INT);

This is used to store which user made changes to what files when, or in other words which files were changed since the last check and should be updated from the server.

Then, create a SQLite file named GracesJapanese with the following tables:

	CREATE TABLE Japanese(id INT PRIMARY KEY, string TEXT, debug INT);
	CREATE TABLE descriptions(filename TEXT PRIMARY KEY, shortdesc TEXT, desc TEXT);

This stores the original, unmodified text from the game, and provides a way to change the displayed name of a database within GraceNote without changing the actual database filename.

With these, you can get to the actual text ripping. If you're comfortable with C#, I recommend using my HyoutaTools' GraceNoteDatabaseEntry class, filling an array of those with the extracted game text, and using the static InsertSQL method to insert them into database files based on this database template. For example:

	RandomGameFile GameFile = new RandomGameFile( System.IO.File.ReadAllBytes( "gamefile.arc" ) );
	System.IO.File.WriteAllBytes( "gamefile.db", Properties.Resources.gndb_template );
	List Entries = new List( GameFile.Strings.Count );
	foreach ( var x in GameFile.Strings ) {
		Entries.Add( new GraceNoteDatabaseEntry( x.Text ) );
	}
	GraceNoteDatabaseEntry.InsertSQL( Entries.ToArray(), "Data Source=gamefile.db", "Data Source=GracesJapanese" );

If you cannot use the provided template database, create one using the following SQL commands:

	CREATE TABLE History(id INT, english TEXT, comment TEXT, status TINYINT, UpdatedBy TEXT, UpdatedTimestamp INT);
	CREATE TABLE Text(id INT PRIMARY KEY, StringID INT, english TEXT, comment TEXT, updated TINYINT, status TINYINT, PointerRef integer, IdentifyString TEXT, IdentifyPointerRef INT, UpdatedBy TEXT, UpdatedTimestamp INT);
	CREATE INDEX History_ID_Index ON History(id);

Some additional info, such as the location of a pointer to the string in the original file, may be needed to reinsert the translated text later. If so, provide them to the GraceNoteDatabaseEntry constructor as PointerRef, IdentifyString or IdentifyPointerRef -- the names are kind of arbitrary, but you can use them as you like. Do note that IdentifyString is displayed within GraceNote next to the entry itself, so it can be used to provide additional info to the translator if possible, such as the name of the person speaking the line.

If the game uses special characters for things like variables or formatting, you should replace them with something more user friendly in this process, then revert that when it comes to reinserting the translated text. For example, if a game uses a 0x06 byte for printing the name of an in-game renamable hero character, replace that with something nicer like '<Hero>'. Pointy brackets are recommended.

As a rule, one game file database should be created for each actual game file. If the game you're working with has lots of entries (several thousand or more) in one file or no logical separation of game text, it might make sense to split it into several game file databases.

If you would rather create those databases using your own code, keep these things in mind:

Creating the Project Configuration File

Compared to the databases, this is pretty simple. All you need here is some settings and a list of all your databases, and optionally some other game-specific data. Take a look at the template config file and base yours off that. All the nodes and properties are explained in more detail below.

The root GraceNoteConfig node

The root node stores some basic information as properties.

All other nodes described below are sub-nodes of this GraceNoteConfig node.

The Categories node

This node contains references to all the game text databases and categorizes them for finding them more easily while editing in GraceNote.

There is no limit on the number of Category nodes, but each game file database may only be listed once.

The Dictionary node

This node contains words that should be added to the internal dictionary, so that they won't get recognized as misspelled. Use to add game-specific terms, names, and so on.

The Terms node

This allows you to specify substrings in the Japanese text so that GraceNote notifies you whenever a specific term appears in it, as well as an English translation to go along with it. Useful for making sure a specific term is always translated in the same way.

The Fonts node

This allows you to create a font from images, so that you can replicate or at least approximate the in-game look of text. This is very helpful when you have to make sure that text doesn't go offscreen or outside of textboxes, and so on.

The Images node

This allows you to add images to be displayed for specific commands in the text. This can be used, for example, to display character poses in Visual Novel-style conversations and similar.