Author Topic: CTC Translation  (Read 21108 times)

MrBigz

  • Rael
CTC Translation
« on: January 09, 2011, 12:16:34 AM »
I've been thinking about doing an english patch for Concealed the Conclusion. I've already skimmed through this thread: http://www.shrinemaiden.org/forum/index.php?topic=239.0  (If there's any other info on peoples progress with this It'd be nice to know)

The character dialogue is easy, I might be able to circumvent the character limit, we'll see. I already semi-found out how to edit in the spellcard names, as well as menus and stage names. Is there anyone else who wants to help?

Edit: Also responded and had a look at this talk page on the wiki: http://en.touhouwiki.net/wiki/Talk:Concealed_the_Conclusion:_Translation
« Last Edit: January 09, 2011, 12:43:51 AM by MrBigz »

Paper Conan

  • Productivity, all day 'erry day
  • NOPE, just kidding~
Re: CTC Translation
« Reply #1 on: January 09, 2011, 01:05:48 AM »
Please do it   :o
If you do then I'll be more than glad to give you my babies.

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #2 on: January 09, 2011, 01:58:17 AM »
YES. DO IT

How can I help? I would love to help out with this  :D

MrBigz

  • Rael
Re: CTC Translation
« Reply #3 on: January 09, 2011, 02:09:04 AM »
Do you know anything about coding at all? :O

One thing I need right now is for people to skim through the coding in the files to find certain things. WE CAN DO ETT!

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #4 on: January 09, 2011, 02:21:22 AM »
Do you know anything about coding at all? :O

One thing I need right now is for people to skim through the coding in the files to find certain things. WE CAN DO ETT!

What coding are we talking about? I know Danmakufu language and Danmakufu language only :V

MrBigz

  • Rael
Re: CTC Translation
« Reply #5 on: January 09, 2011, 02:30:12 AM »
That might help. I'm talking C, that's what the .dnh files are coded with, or something similar.

For anyone reading, and I posted this on the talk page in the link, I found out how a lot of the text is displayed. Similar to how projectiles are displayed in the official touhou games, there's some font images in one of the directories, which contains all japanese characters. So the game calls the image, and displays a small section of that image for each letter. I'm 99.9% sure this is how it works, since I tested it by erasing the characters, which took out most of the text other than dialogue. SO, what we need to find is the calls for that image for each spellcard, level description, menus, etc. Then we just have to replace the old font with a new english font and change the calls to open the right letters.

So if anyone can look through some dnh files they think might contain those calls, that'd be great! =)

Some hints: I'm pretty sure the dnh file will have a #include for the font files. It should have #include_function lib\THCCL\IMAGE\index.dnh near the top. One set of files which could have something are the files under script/thc/INCLUDE/BOSS which has some of the coding for the bosses. One of the functions is DrawSpellBG, which could have something to do with it. These are the kinda things you have to look at and try to figure out if they use those font images. Tell me if you guys find anything!


Edit: Also, AND THIS WOULD REALLY HELP, if there's anyone who knows Japanese, the coding has A LOT of comments on the side which could REALLY help because it probably explains what everything does. So if anyone can do that, that would be awsumm.
« Last Edit: January 09, 2011, 02:42:38 AM by MrBigz »

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #6 on: January 09, 2011, 03:02:28 AM »
Yeah, Danmakufu language is heavily based off of C/C++ from what I understand.

Anyways, I'm pretty sure you're only half right. It does grab text based on text images, but Danmakufu makes Events (the part where the two characters talk) based on what you tell it to write. Example:
DrawText(stuff, stuff, BLAH!);
And then once you call the event script in the game, the character will say "BLAH!"

Once again, I'm not 100% sure about this, feel free to correct me/slap me upside the head for questioning you  :V

MrBigz

  • Rael
Re: CTC Translation
« Reply #7 on: January 09, 2011, 03:24:02 AM »
Yeah, I mentioned before that the dialogue was the easy part.


And it looks like I already found one of the files that calls the text. It's called TT.dnh, in the DATA folder under FONTS. I just changed some values and got this:

http://img84.imageshack.us/img84/9852/ctc.png

Edit: That file is DEFINITELY what controls the rest of the text. I was able to change the names of spellcards too. It references to the dat files though. Either I work around it somehow, or decode the dat files. If they can't be decoded, one very good idea I have is to make brand new dat files and change the calls to call those dat files.
« Last Edit: January 09, 2011, 03:55:44 AM by MrBigz »

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: CTC Translation
« Reply #8 on: January 09, 2011, 04:03:06 AM »
Okay, wow, I don't think anyone's gotten that far.

How did you manage to access the .dnh files? I don't think anyone's been able to do that before, unless I'm thinking of the .DAT files.

If you've managed to change spellcard texts in-game you're more or less set. Dialogue is easy to replace, all that would be left is endings/menus.

MrBigz

  • Rael
Re: CTC Translation
« Reply #9 on: January 09, 2011, 04:09:23 AM »
No, the dnh files are the easy ones. The dats are encoded. All I did was change how the informations in the dat files was displayed (which takes the text from the font images). I'm gonna try to decode the dats first, and then if that fails, try to alter the code and make a new dat to call a new english image font (which the program hopefully won't reject D:)


Also, for those who might look, it seems all functions with "CUTIN" in the name are what "cut" out the character from the font image. cutin.dnh looks like the main function for doing this. Font.dnh is also very important for this; it's the bitmap font library for all the text displayed ingame.
« Last Edit: January 09, 2011, 04:19:38 AM by MrBigz »

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #10 on: January 09, 2011, 04:24:28 AM »
Ok, I'm starting to remember from a while back when I was tinkering with CtC's dnh scripts. I saw that the script file that is the menu does some things called Effect Objects. Effect Objects, if I can recall correctly, are pretty much images appearing in the game, but not interfering with it. So pretty much what we need to do is find that script, and change/add where it grabs it's images from.

I'm not experienced enough with Danmakufu, so you should look for a better scripter to help you with the last part.

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: CTC Translation
« Reply #11 on: January 09, 2011, 04:35:50 AM »
Speaking of cutins, if you ever find the sfx in the .dats for the CtC spellcard cutins/declarations I will love you forever.

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #12 on: January 09, 2011, 04:43:15 AM »
Speaking of cutins, if you ever find the sfx in the .dats for the CtC spellcard cutins/declarations I will love you forever.

Aren't the Cutin declaration sound effects the same as regular danmakufu's?
If anything, the sound effect made when the boss is defeated is different. It's "enep01.wav" which is inside "lib/THCCL/SE"

MrBigz

  • Rael
Re: CTC Translation
« Reply #13 on: January 09, 2011, 04:57:49 AM »
Yeah, the spell declaration was like the only sound I couldn't find, weird..  :/


Kurai, I have a question. If you were to go about making a spellcard, how would you implement showing the name when the spellcard comes up?

Also, I'm disassembling the .exe, hopefully I can find some info on the dat file compression algorithms, or otherwise, in there.

Edit: Actually, I just realized, since CtC is technically not a "part" of danmakufu, then one of the dnh files should have an alghorithm for those dat files. Hell, isn't dnh just a script file for it? So it's just another game that was created with it, just that it's by the author him/herself?
« Last Edit: January 09, 2011, 05:05:30 AM by MrBigz »

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #14 on: January 09, 2011, 05:05:44 AM »
You would call the cutin function.

CutIn( KOUMA/YOUMU, Name of Spell Card, CutIn Image, left boundary, top boundary, right boundary, bottom boundary);
You would select the way the CutIn image is displayed using KOUMA to make it EoSD-styled or YOUMU to make it PCB-styled.

 The second variable is the name of the spellcard, but exactly how the CutIn fuction processes it is weird. For example, many english-speaking Danmakufu users use "A"\""B"\" where A would be something like Example Sign, and B would be Example. That would end up making
Example Sign "Example".

Then you select the image which will be used for the CutIn, and select the boundaries of the image (in case that the image you want to be used for the CutIn is sharing a .png file with another image).

MrBigz

  • Rael
Re: CTC Translation
« Reply #15 on: January 09, 2011, 05:16:27 AM »
So basically you would cut out A and B from an image, right? Would you create that image yourself? Or how would you know that you picked the right boundaries to get the right letters?

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #16 on: January 09, 2011, 05:26:41 AM »
Well I was just using A and B as an example. So if I said "Time Sign"\""Za Warudo"\" , the title of the spellcard would come out as Time Sign "Za Warudo"

For selecting the boundaries, simply go to paint, open the image you want to use, and move your cursor around. You'll see that it gives coordinates.

|------|
|------|
|---A-|
|------|

If you were looking to get the coordinates for the A, you would first find the point that is the farthest to whatever side you need, use the X coordinate for it, and put that in for the boundary you need. However, I'm not sure if you use the X or Y coordinates for what sides, Check on the Danmakufu wiki for that.

If you were talking about implementing letters as an image (like menu options), you'd have to use effect objects which I myself can't comprehend. If that is what you meant, talk to a more experienced scripter  :V

MrBigz

  • Rael
Re: CTC Translation
« Reply #17 on: January 09, 2011, 05:30:38 AM »
Oh you mean by coordinates, where the spellcard will be displayed on the screen? So if you wanted to display the spellcard the way you were saying it, you would just type in the name normally, and then put coordinates for where it will show up on the screen?

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #18 on: January 09, 2011, 05:42:52 AM »
Eh...no
If you look at a typical spellcard in EoSD or PCB, you see that an image of the boss passes by the screen. The coordinates are on the actual .png file to find the image. Whatever is inside those coordinates will be what passes on the screen when the spellcard is activated.

MrBigz

  • Rael
Re: CTC Translation
« Reply #19 on: January 09, 2011, 05:53:15 AM »
I see, but my question was, what about the spellcard name? Does that work the same way? Or do you simply type in the name and it'll show up?

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #20 on: January 09, 2011, 05:58:28 AM »
Sorry, I misunderstood  :derp:

Anyways, you simply type the name in the second parameter using the method I told you "___"\""____"\" and it will show up properly.

MrBigz

  • Rael
Re: CTC Translation
« Reply #21 on: January 09, 2011, 06:04:05 AM »
Ah. So I'm guessing CtC uses effect objects for that text. Well, maybe? Hmm...

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #22 on: January 09, 2011, 06:13:48 AM »
Actually, if I'm not mistaken, effect objects are only used in the menu, which is already in english.
Dialouge used regular text.
Spellcard names use regular text.

You might not need to comprehend Effect Objects for translating the game :D!!!!!!

MrBigz

  • Rael
Re: CTC Translation
« Reply #23 on: January 09, 2011, 06:34:55 AM »
We shall see D:  Now I need sleep TO REGENERATE MY BRAIN CELLS!

Re: CTC Translation
« Reply #24 on: January 09, 2011, 06:10:44 PM »
It seems you've kicked up more fervor for a CtC English in the day this topic has been up than in the months that I was working on dialogue transcriptions and asking for missing translations. :parsee:

I certainly won't hold something stupid like that against you though, I'm on board with this all the way, especially now that we can do up more than just dialogue.
The SoEW patch has had its second release, come and get it!

MrBigz

  • Rael
Re: CTC Translation
« Reply #25 on: January 09, 2011, 08:16:29 PM »
I'm sorry D::

Of course a lot of the credit goes to the wiki and to you for the inital dialogue and such. <33

Right now, the easier thing to do seems to be to alter the code itself. I've tried a few decoding algorithms (such as LZW) but to no avail. What we can do is, identify the cutins that display the text based off of the dat files, and alter them to display our own text, maybe through a new set of dat files that we create ourselves. We'll leave the originals there for whatever other purposes they have.

I still think opening that dat file should be much easier than it seems. I can easily produce errors that actually DISPLAY code from inside the dat file, so I know that it is in fact encrypted and not full of images or anything.

http://img717.imageshack.us/img717/5928/ctcmenu.png

So far I've been able to alter the code effectively, done things such as changing the version number of the game and such.

http://img560.imageshack.us/img560/9018/ctcc.png
« Last Edit: January 09, 2011, 09:02:29 PM by MrBigz »

Re: CTC Translation
« Reply #26 on: January 09, 2011, 10:08:47 PM »
Oh wait, hold up; you're working with version 1? You need to get your install updated to 2.01 before you get invested into anything; we don't know how much will be made incompatible, and version 2 fixes way too much for us to just disregard it.
The SoEW patch has had its second release, come and get it!

MrBigz

  • Rael
Re: CTC Translation
« Reply #27 on: January 09, 2011, 10:26:15 PM »
Thanks for the heads up, I just installed the patch. Silly me D:

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: CTC Translation
« Reply #28 on: January 09, 2011, 11:33:40 PM »
First of all, how do you know what version you have?
Second, I think I might have a lower version, where can I get the patch and how can I install it  :derp:

MrBigz

  • Rael
Re: CTC Translation
« Reply #29 on: January 09, 2011, 11:54:11 PM »
When you pick it at the main menu it says R2.01 or whatever version. The patch is on the main site: http://danmaq.com/products/apps/dnh/thc/

Edit: Hey Furienify, were you looking for this?

http://img694.imageshack.us/img694/9318/ctca.png

It's inside th_dnh.dat, or at least that specific reference is in there, and that file is probably encoded the same way as the other dats. Kill 2 yukkuri's with 1 stone? hmmhmmhmm

Editedit: Anyone have any knowledge of zlib? If so can you try the inflate function (decompression) on the dat files?
« Last Edit: January 10, 2011, 02:11:42 PM by MrBigz »