Jump to content

Running a Kirikiri Visual Novel without region-restriction


Recommended Posts

The other day, I was working with some visual novels to possibly start a FanTL and a question came to mind:
Is it possible to make a Visual Novel that will only run if you have your region in Japanese, run in any region?

I mean, yes, Locale Emulator exists, but that just makes the program you execute think the region is on Japan. So there must be a way to make it work without the use of those tools.
But I needed a game to test on, in first place, so

I started working with Karenai Sekai to Owaru Hana. This is what I found out until now:

First thing I did was open the game executable with Resource Hacker to find anything that could help me. I found the game reads "Shift_JIS" encoding, at first I thought it'd be helpful in the process to make the game run in any region, I've reached somewhere, but I soon hit a roadblock.

You see, kirikiriZ executables have two encoding options: Shift_JIS and utf8
Changing the encoding in the .exe to "utf8" made it executable, at least, in any other region. But you'd get this error:

Jv43N6B.png

Investigating a little bit into the error I saw that the engine working on utf8 reads the files as UTF16 LE BOM, and since most .ks and .tjs files were in Shift_JIS, I had to make myself a tool to change the encoding of all the files from cp932 (Shift_JIS) to UTF16 LE BOM to see if it worked.

And would you look at that, ANOTHER ERROR. However, this one was confusing. The error was this one:

Jv4Foox.png

"What?" "But the startup.tjs IS in the data.xp3 I created..."

The next thing I did was to find out what was happening, and when I saw the data.xp3 of the game, THIS is what I found out:

Spoiler

JvrsWhu.png
Two startup.tjs in the same folder and with different sizes.

What's more, one can be read by GARbro, the other one can't.

Readable startup.tjs file screenshot
UNreadable startup.tjs file screenshot

(One thing to note is that the readable startup.tjs file is being read as Shift_JIS, Unicode doesn't work. However, other games have them in UTF16 LE BOM or are completely unreadable)

If one startup.tjs isn't there, the game will not work.
I searched if someone talked about this before, and I found a fairly recent post on this topic with someone mentioning this when trying to extract the data.xp3 of the VN they've been working on. No one responded, sadly, so I had to keep investigating.

I remember that in the official Kirikiri tools, there was a startup.tjs in a folder called "Encrypt", but I don't really think it has something to do with it since it's probably for another purpose, like encrypting the .xp3 files.

But now, what can I do? I got stuck now since I can't find a way to get two files with the same name in a .xp3 file. And making two patch.xp3 files with one startup.tjs inside each is contraproducent, as patch.xp3 is made exactly to be able to replace files and those two need to "live in harmony" in order to make the game work.

After analyzing executables from other visual novels, I realized I may have been wrong this whole time since they all had Shift_JIS as its encoding property. And yet, they ran in any region. The first two I analyzed were Sousaku Kanojo no Ren'ai Koushiki and 9-Nine- Episode 2. The only difference I could find was that the .ks and .tjs files inside the .xp3 were all in UTF16 LE BOM.

I appreciate if you read this hell of a text wall I made.
Do you happen to know something I don't and want to add info to this thread? You're free to reply to this thread with your findings!

This whole investigation was purely made because I wanted to know more about the engine, but it might be of help FanTL if I/we figure a solid way to make the region restriction go away, imo. Update: check at the end of this post.

Might update this if I find something else

 

Looks like I'm gonna have to give up on this investigation, at least for now, sadly.
I'm lost asf, to be honest. This past week I've been endlessly searching for clues, a form to work with it, anything at all, but to no avail. I haven't found a way to make those two startup.tjs files just... be there, in the same compressed file or just make the game work without emulating region.

Just that kind of blocked all of the investigation alone. And there's still things that I haven't covered here that I just couldn't find an explanation for. It was a total letdown for me.

If anyone just happens to follow this or saw this obscene amount of text and knows something, you can just post it here. Or not, you do you.

There must still be a reason as to why some visual novels run and some don't. A reason I could think of is engine version.

For example, Kareseka's executable shows the version is 1.2.0.3 and Sousaku Kanojo's one shows it's 1.4.0.8. It may have something to do with that, but even I think that's kind of... stupid.

But for FanTL, you can just kinda do what @Sisulizer suggested.

Use the version.dll VNTextProxy by ArcusMaximus provides for Kirikiri, it has a built-in locale emulator and other useful stuff like rendering non-SJIS characters (you know, letters with acute like á, é or í and other characters that don't form part of the cp932 character table).

You will have problems if you want to use another version.dll from another tool like Xp3Pack from KirikiriTools (that's also made by ArcusMaximus lol), though.

Good luck, programming adventurer! Until next time.

Edited by jair4x
Added a bit of info before concluding the investigation for now until something new comes to mind or something important appears.
Link to comment
Share on other sites

Part of the docs have been translated here and there is also this reference here. There is also some more random info here, here, and an interesting fork here. I doubt any of that will be useful though.

So anyway, Somewhere in the kirikiri game engine there is a parser that only reads either shift-jis or UTF-16 BOM LE and the core engine game code was written in shift-jis or utf-16 bom le. For kirikiri games to be made region free, the encoding for the files for a game probably needs to be updated to utf-16 bom le and that game engine code updated to the same or ascii. Updating everything to utf-8 would be ideal, especially for translation purposes, but that might be more complicated/impossible.

 

Link to comment
Share on other sites

15 hours ago, Entai2965 said:

Part of the docs have been translated here and there is also this reference here. There is also some more random info here, here, and an interesting fork here.

The only thing I hadn't seen was pantsudev's guide, but I don't even think that even counted as a guide since it's kind of general knowledge about the engine, lol.

15 hours ago, Entai2965 said:

Somewhere in the kirikiri game engine there is a parser that only reads either shift-jis or UTF-16 BOM LE and the core engine game code was written in shift-jis or utf-16 bom le.

I've yet to analyze every .tjs and possibly .ks file (although I doubt about the latter since it wouldn't make much sense, they are usually for ingame settings and not so much about engine config) in search for something that makes the game process things on either Shift_JIS or UTF16 LE BOM. From what I read in a discussion about this somewhere, Kirikiri has UTF8 as its default encoding and japanese companies set them up as Shift_JIS, could be false, since it was just speculation, but it makes sense from a certain point of view.

15 hours ago, Entai2965 said:

For kirikiri games to be made region free, the encoding for the files for a game probably needs to be updated to utf-16 bom le and that game engine code updated to the same or ascii

One thing I remembered is KrkrExtract's "Universal Patch". That function created a new executable which somehow let the game be region-free. There's something that that executable must have to make it work. Although it's kinda obvious that it doesn't rebuild the original executable to be region-free, it has like a third of the data the game executable has, so...

If I knew enough about C++ and instructions, I'd check the source code for that part. But I don't so... there's that.

15 hours ago, Entai2965 said:

Updating everything to utf-8 would be ideal, especially for translation purposes, but that might be more complicated/impossible.

I don't really think it is reaaally impossible, but what I DO think is that once the whole thing is figured out and a solid method or just a method to make it work shows up, it'd be a lot easier than investigating this whole thing.

Link to comment
Share on other sites

11 hours ago, Sisulizer said:

Actually, it's simple. Use a hook which calls Locale Emulator function like this, and include LoaderDll.dll and LocaleEmulator.dll, you can run the game from any region.

Didn't know VNTranslationTools had a hook like that, interesting...

I still very much appreciate your comment on this matter, it's still a real solution which should help in this matter, but as I said in the beginning of the thread:

On 4/14/2024 at 6:47 PM, jair4x said:

I mean, yes, Locale Emulator exists, but that just makes the program you execute think the region is on Japan. So there must be a way to make it work without the use of those tools.

It kinda defeats the point because all it does is what the name implies: Emulates the game in another region.

I don't have anything against it, though. But I want to find out what is the way to make a region-blocked game run in another regions without having to emulate the region.
Because if other visual novels using the same engine, even some using the same exact version, can run in whatever region and others can't, there must be a list of steps to make a region-blocked game, a region-free game.

Link to comment
Share on other sites

 

On 4/16/2024 at 8:34 AM, jair4x said:

It kinda defeats the point because all it does is what the name implies: Emulates the game in another region.

I don't have anything against it, though. But I want to find out what is the way to make a region-blocked game run in another regions without having to emulate the region.
Because if other visual novels using the same engine, even some using the same exact version, can run in whatever region and others can't, there must be a list of steps to make a region-blocked game, a region-free game.

But it's not that they are region blocked, but rather, in a way too simplistic way: the computer cannot process the games because it doesn't have the tools to read the program.

Emulating a locale is not that you are letting the game know you are in japan, but enabling the computer to read "japanese way of programing".

Link to comment
Share on other sites

  • 3 weeks later...

I was lurking around the forums if i can find help with my translation, when i saw this thread. Forgive me that what i'm posting is only marginally related to the original question, but i think i have to get this out there in case someone would be in the same shoes as i was. Let me preface that i have little to none technical knowledge about coding and stuff.

 

So, I wanted to translate 9-nine from english to hungarian. In the process of trying to get the text out of the game, i've encountered a very similar problem to yours with the identically named "startup.tjs" files (until now, i haven't thought this was even possible, and i'm still baffled). When extracting the data.xp3 (which also contains the script files) to a folder, it couldn't have the two "startup.tjs" files in the output folder, so i was unable to repack the data.xp3 in the same way it was. Because of this, i had to make do without touching the data.xp3. Making a patch.xp3 with the translated scripts didn't work either. It was then I've found KirikiriTools and the above mentioned "version.dll", with this feature:

If a file exists in the "unencrypted" folder, the game will use that one instead of the original in the encrypted .xp3 archives.

Thanks to this, i was finally able to make my text show up in game by dropping my script file into the folder "unencrypted". I'm sure there is a much simpler and practical way, but with my limited knowledge, this is what i could come up with.

All i hope is to help someone not having to go through the same ordeal as i did.

Link to comment
Share on other sites

  • 2 months later...
On 4/25/2024 at 5:59 PM, Makekko said:

 

But it's not that they are region blocked, but rather, in a way too simplistic way: the computer cannot process the games because it doesn't have the tools to read the program.

Emulating a locale is not that you are letting the game know you are in japan, but enabling the computer to read "japanese way of programing".

Haven't entered the forum for a while. But fair, it makes sense that a visual novel is region-blocked because computers can't read certain "programming styles".

As you can imagine, I dropped the investigation after getting to that dead-end, but I learned some interesting things along the way that I didn't get to share here (not that I remember).

Link to comment
Share on other sites

On 5/13/2024 at 6:02 AM, The Chazz said:

I was lurking around the forums if i can find help with my translation, when i saw this thread. Forgive me that what i'm posting is only marginally related to the original question, but i think i have to get this out there in case someone would be in the same shoes as i was. Let me preface that i have little to none technical knowledge about coding and stuff.

 

So, I wanted to translate 9-nine from english to hungarian. In the process of trying to get the text out of the game, i've encountered a very similar problem to yours with the identically named "startup.tjs" files (until now, i haven't thought this was even possible, and i'm still baffled). When extracting the data.xp3 (which also contains the script files) to a folder, it couldn't have the two "startup.tjs" files in the output folder, so i was unable to repack the data.xp3 in the same way it was. Because of this, i had to make do without touching the data.xp3. Making a patch.xp3 with the translated scripts didn't work either. It was then I've found KirikiriTools and the above mentioned "version.dll", with this feature:

If a file exists in the "unencrypted" folder, the game will use that one instead of the original in the encrypted .xp3 archives.

Thanks to this, i was finally able to make my text show up in game by dropping my script file into the folder "unencrypted". I'm sure there is a much simpler and practical way, but with my limited knowledge, this is what i could come up with.

All i hope is to help someone not having to go through the same ordeal as i did.

Yeah, KirikiriTools exists. I didn't have any sort of problem, however. I just wanted to know how possible it was for a "normal person" to make a region-blocked game become playable in any region. But as @Makekko said, it's just that computers can't read japanese code normally, so you either make it work with some external tool or emulate region locally.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...