Hacking the Grisaia

So recently the translator Koestl contacted me for some help with the hacking for ‘Grisaia no Kajitsu’ (or ‘Fruit of the Grisaia’), since the game uses the CatSystem2 game Engine.  CatSystem2 was used by Kamikaze Explorer, which I released tools for before.  The tools didn’t work very well with Grisaia however, so some work was needed to get things playing smoothly. In the end I volunteered to help out making the game run well in English.

I should keep in mind that Koestl is the one doing the bulk of the heavy lifting, since translating the game, and it’s a huge ass game, is all his work.  I’m just working on the technical parts.  His translation is great and he does a really good job making it work in English.  He must keep an editor in his pocket because his translation comes out quite polished.  Look forward to playing it in English way (waaaay) down the road.  At the moment, the translation is 10.5% complete.

So anyways, that out of the way, onto the hacking stuff!

Text Insertion

If a line starts with English text, it's a command. That makes it a bit tricky if you actually want to use English!

CatSystem2 is a really finicky game engine to run English on, because the scripting system generally relies on text being in Japanese.  Lots of things you’d take for granted, like word wrap, the ability to use quotes and apostrophe’s, or just right out displaying English text at all, don’t work out of the box.  The system differentiates what lines are script commands and what lines are text to display in game by what language it’s written in.  More annoyingly, quotes and apostrophe’s don’t work properly, and there is no word wrapping by default.

To make the text work well in game, I first extracted all of the game text out of the scripts into their own files, and then made a tool to insert text from those files back into the original script with some modifications to make them display properly in game. Koestl can then just translate those text files without worrying about the silly technical workarounds, and then run compile and have it work in game immediately.

A random scene in the intro chapter.

Solving some of the limitations was a bit of a challenge. For quotes, we’ve ended up relying on the original Japanese quotes for the script. After a while we realized that we could use unicode directional quotes to surround sentences, but we decided to stick with the Japanese style quotes. Apostrophe’s we’ve had to convert to backquotes.  It’s not pretty, but our font choice cloaks it well enough.  For word wrapping, originally we relied on automatic line breaks after a set number of characters, but we changed the system we were using part way.  CatSystem2 allows you to mark a word or sentence to be wrapped as a single unit by surrounding it in square brackets, like [this].  Getting word wrapping working was simply a matter of bracketing each word with square brackets so the game wraps them as one would expect in english.  And lastly, to make the engine pick up our English sentences, we prepend an unnoticeable script command to the start of each line.

The resulting script looks almost unreadable, and it would be almost impossible to write it all directly if it weren’t for the text insertion tool doing the heavy lift it.  It looks good in game though!

That same scene in the game script. It looks way better in game doesn't it?

Making it Look Good

Once the text is in game it actually looks pretty good.

Text Insertion is only part of making a game work in English.  There’s many other things that need to happen, such as updating the UI, the game engine interface, and making text that isn’t in the dialog box itself accessible.  I figured having access to Debug Mode would make fixing these a bit easier, but debug mode is locked behind a key file.  This is where hacking gets real.

I haven’t really done any serious reverse engineering of executable files before. Breaking CatSystem2’s script files was more of a matter of just prodding the data file until it caughs up the right info… actually changing the executable was on a completely different level.  It was a good learning experience, and it took a fair bit of time, but I managed to modify the exe to launch the game in Debug Mode!

Here's what the game engine looks with all the debug features visible.

Debug mode actually gives you access to a lot of cool features.  For one, you can instantly jump to any file, and even any line in any file.  It has an in interface button to recompile the game script, which I mapped to run a batch file that does all the text insertion too.  It gives you a debug message window that gives output from the commands the engine is given, and it even allows you to see all of the engine variables and open image and plane resources.  It’s fun stuff.

Armed with debug mode, I’ve been working on translating on screen text and spoken dialog that is in the background and not listed in the dialog box for normal display.  What I’ve done is made a small slide down panel that appears in the top right corner that shows the translation of the background dialog.  It’s non intrusive and it looks pretty good to see it in action.

An example of the subtitle panel. The text I don't think is final.

The rest of it is just UI modification.  It’s kind of tedious work, but in the end it’s important to having a good play experience.

I think it looks pretty decent?

I swear this game system has like 5 billion different options. Bad for me, good for you.


So yeah, the game is starting to look pretty amazing in English, and Koestl’s translation is all kinds of awesome.  Actually, the game itself so far has been great, and it’s really exciting to see it slowly take shape in English.

Right now the project is at 10.5%, with the common route being almost half translated. I’ve been impressed with Koestl’s work so far, and I’ll do what I can to help out as the project goes on.  I don’t think he plans on any intermediate release however, since the common route betrays the overall intent of the game (the ‘comedy’ common route versus the ‘heavy’ character stories), so we’ll have to work towards a final translation.  It’ll be a long term project, and certainly the release is a long ways off, but hopefully, you’ll be able to see this screen too:

Yes, screenshotting the patch installer makes me a huge dick.

21 Responses to Hacking the Grisaia

  1. Albarnevans says:

    Check VNDB today, and hey someone actually translating Grisaia.
    Thanks Man, you guys are my Hero..

  2. Maou says:

    Wow 1080p!
    Keep up guys and thanks for the hard work.

  3. Unfortunately... says:

    Nope, and it’s actually not even 720p (surprising as that’s “standard resolution” for modern games) – it’s just given in the config menu as a common window size you can use, as long as you don’t mind scaling.

    It’s 1024×576, though, which still is pretty nice.

    Excited to hear this is being done!

  4. Metaler says:

    Glad to see someone’s translating this game. Hopefully it’ll be a job well done. Grisaia isn’t an easy game to translate, so it’s nice to see someone’s putting some effort into bringing it for English speakers.

  5. anon says:

    Is a demo patch being considered, or will that add additional hacking issues? The demo is pretty lengthy so it’d whet the appetites of a lot of people excited and curious about the game (and may convince people to find a way to buy the game in the meantime).

    • doddler says:

      I’m actually considering putting together a translation patch if Koestl is willing to go that route. We’ll have to see.

  6. EPC says:

    AWESOME! SO happy this is getting worked on. Been dying to play this after all the praise it has received. You guys are awesome!

  7. Kanashimi27 says:

    hey, how do I download the patch of Grisaia?

  8. Engix says:

    The patch isn’t even out yet……

  9. icco says:

    sir, thank you sir. just knowing the translation from VNTS thread on /jp.
    I can’t say much but to thank you for translating this game!
    good luck in your project! 🙂

  10. asr163 says:

    thank you good sir for working this. im looking forward to it

  11. Minzero says:

    Thank you very much for working on this project!

  12. wALTER says:

    Thanks for taking the time to translate this, I’ve been looking forward to playing Grisaia for a while. I wish you the best of luck on this project and you have my support~

  13. D Wind says:

    I’ve Just known about this a moment ago . Feels like to be saved by a goddess . Can you please update and upload your patches? Even 5% would make me happy xD .
    Thanks man. Good luck on the project

  14. Shiki says:

    Are you going to be releasing the common route patch soon or aiming for the full game one?

  15. Yukari says:

    Can you upload the tools for other language translations of grisaia?

  16. omod says:

    Seeing this pretty late, but thought I’d mention this anyway:

    Apostrophe’s we’ve had to convert to backquotes. It’s not pretty, but our font choice cloaks it well enough.

    I haven’t played the demo yet, so I have no idea if this change has already been made, but you could use the RIGHT SINGLE QUOTATION MARK (U+2019) instead of the GRAVE ACCENT (U+0060).

  17. GoidoYuuji says:

    I’d like to know how can I access debug mode. I suppose, I must change something in Grisaia.exe file? I can work with executable files in IDA Pro but it’s tough experience… So I ask Yukari’s question: “Can you upload tools for other languages translations?” I want to translate this game to russian. I’d appreciate for any help with it.

  18. marcus says:

    I need this tool to translate to portoguese brazilian, you can upload or send for my email? ddtank.marcus@gmail.com

  19. MrNat says:

    Like to know how can I access debug mode? Any tips?
    You did a great job in this novel. 😀

Leave a Reply

Your email address will not be published. Required fields are marked *