Skip to content

Instantly share code, notes, and snippets.

@nmlgc
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmlgc/6534809d003b1f980063 to your computer and use it in GitHub Desktop.
Save nmlgc/6534809d003b1f980063 to your computer and use it in GitHub Desktop.
... or rather, the June 2014 State of Touhou Patching address.

This was written in response to [Alcoraiden's complaints about the current state of thcrap and Touhou translations] (http://www.shrinemaiden.org/forum/index.php/topic,16308.msg1101312.html#msg1101312) and quickly escalated into a full-on "state of patching address". Nazeo will probably censor this in order to better cater to the Shrinemaiden audience, but this is what I would say.


Well, how to start. Isn't this the page he is looking for? The rest should be obvious from looking at the files. Wobuffet3 figured it out, Gamer251 figured it out, and Nazeo did too.

As I said, fighters will be done after Seihou, which will be done after PC-98. And by "fighters", I mean "porting mauve's existing code for th075, th105 and th123". Maybe support for th135 will look more viable after this, maybe not. If it doesn't, then well, you're out of luck. thcrap is designed in a certain way to facilitate patching of applications that are reasonably well coded. However, from what I have learned about their games, Tasofro is gradually making their games harder and harder to patch and translate, perhaps deliberately. If this trend continues, then thcrap just is the wrong tool for the job, plain and simple. I'd rather spend my time on patching games that are viable to be patched with thcrap's design.

As for th143.

"Hell, even Touhouwiki has the translations."

Yeah, the fact that we have to patch them into the game is not worth being considered? It was clear even before the release that Touhou Wiki would outspeed us as far as plain-text translation is concerned. [Which is why we told everyone to focus on images instead] (http://thpatch.net/wiki/File:Plaintext_vs_Images.png) - quite successfully, I'd say. Also, it might be worth noting that I'm on vacations now, and the real disappointment should only start if I still haven't completely patched 14.3 by next week.

That said: We don't have automatic patching for ZUN's stupid plain-text formats down pat. Alcoraiden is right; if we had, this would be embarrassing. If you have looked at the game data, you might have seen that these would actually be fairly trivial to change. Heck, if there was some third-party patch server who supplied a translated version of that original file, you would now have a fully translated game. In fact, in the weeks before the game's release, we've focused on advertising exactly this aspect of decentralization and building new patch servers because we expected something similar like this to happen, and any effort that would statically patch these few offending files will most likely finish faster than Touhou Patch Center ever will! And whom did we get? Ghildrean's Spanish translation server, Nazeo's gangsta translation server, and the sprite/scenario modders. That's it.

Patching these translations automatically needs thcrap to have a dedicated module. This module should ideally work with any plain-text format ZUN uses and has ever used - and guess what, all three formats (day descriptions, hints, and achievements) are vastly different from each other internally. Not to mention that the original formats are still susceptible to buffer overflows - if we didn't have a dedicated module, a malicious editor would just have to provide a "translation" longer than 256 characters at the right place, and everyone's game would crash. We also need this module to provide translation stacking - the ability to override parts of a translation - at a sufficiently low granularity. Duplication of content is always bad, and we don't want to force derivative patches to copy the translations of an entire file if they only want to change a few lines. Sure, the British English translation is currently the only real use case of this system, but what about the future? And this brings us to the first argument. Why shouldn't there be separate patches to e.g. translate 小人 as "Kobito" or "Inchling", respectively? What about 浄瑠璃 and "Joururi" vs. "Shamisen Recital", or [Sanskrit vs. Japanese terms] (http://en.touhouwiki.net/wiki/Talk:Undefined_Fantastic_Object/Music#Bishamonten_vs._Vaisravana)?

Well, Prime32 just has an opinion. If someone challenges it, then these two translations should co-exist in separate patches. See, this is the direction we would like to go into. No more fighting about changing a translation in "the one patch". We no longer see "the wiki" providing "the translation" as the way things should be done, and this applies to both Touhou Wiki and Touhou Patch Center. Especially Touhou Patch Center, where a lot of people only seem to drop their translations, call it a day and leave. They often don't care whether their translations even fit on the screen, or even just copy-paste translations from somewhere else without actually knowing the rationale and history behind them. Then, things get changed in one place, and the inconsistencies start spreading. Sometimes, these changes are labeled as "updates". Which is most aggravating, as it implies that any change automatically is better. Only the Indonesian group actually seems to use Touhou Patch Center as we intended it to be used.

We need leaders. People who could gather and maintain both the interest and the people to do a translation into a certain language, and who could supervise the whole process and control its quality. We also continue to need people from outside to dispute these translation decisions. However, instead of this resulting in edit wars and lynch mobs (remember "ability to the extent of?"), it should result in forks being created instead. These people then simply copy the other group's work, remove everything they are not interested in changing (remember patch stacking? This is why a low granularity is important!), and have their patch server included in the network. (Note that we are strictly talking about translation "decisions" here, not "clear errors".) Touhou Patch Center has, well, sort of been built to facilitate these two points, and [we have always preferred this approach] (http://thpatch.net/wiki/Touhou_Patch_Center:FAQ#How_are_translation_disputes_handled.3F), but the implementation seems to be rather lacking (...as everything on that godawful site). In particular, exclusive control of a group over a language is just impossible to do on a MediaWiki with a bolted-on translation extension. Which even needed to be modified in order to work in the first place. And this was horrible enough that I haven't bothered to update that piece of shit in 1 1/2 years. But from what I've last seen, they're going more in the direction of making stuff "user-friendly" and "AJAX-y" instead of doing proper implementations of the features we need. But well, they're still building their work on top of goddamn fucking MediaWiki, so... Look, even I myself moved my own patches (base_tsa, script_latin, western_name_order and aero) to GitHub in preparation for 14.3 because Touhou Patch Center was just so much of a goddamn obstacle to my work.

That's why we need third-party servers, and that's why we rather do everything to support these than work on formats that are just ridiculously stupid to patch, or quickly rush out some kind of patch support just to call it a day ASAP. These could just offer a hard-translated version of that file until that module for thcrap is completed. If they don't adhere to the 256 byte line limit or don't test their stuff before publishing it, it's their fault (and the fault of everyone trusting that server) if everyone's game crashes, not ours. This accountability is why a contact email address is mandatory for a patch repository.

So I've been spending time on the issues that people were actually complaining about. Like Gamer251's hanging bug. Or Touhou-Online, which I've been neglecting for the past months. Or image translation for previous ZUN games, which I've been promising since at least October, and whose lack the Brazilian Portuguese translators repeatedly complained about. And these are the most dedicated bunch of people we have right now, being the first to provide image translations for 14.3 out of every language. Or other things I've been getting detailed and helpful bug reports for and that have revealed long-standing issues in thcrap, like the layout issues Kill-o-matic reported. And guess what, [them bug reports keep comin'] (https://bitbucket.org/nmlgc/thpatch-bugs/issue/57/patching-the-game-both-with-the-english). These people are actually using thcrap in the way I've intended it to be used. And this is why their bugs are getting fixed and 14.3 is put on the backburner as a result. So, in the weeks since 14.3's release, I have:

  1. added a better way for thcrap to access the fonts of a game, which became necessary for the "Nickname get" window, and which still needs to be backported to everything since th07 for consistency
  2. revised the file breakpoint system to fix Gamer251's bug
  3. revised the layout system to fix Kill-o-matic's bug
  4. fixed minor bugs here and there

Oh, and by the way, we also need a new font replacement module due to the new default font ZUN has started to use with this game, which is currently breaking things when running under Japanese locale. That's five modules in need to be written or changed, already. The issue only occurs if your system has the Meiryo font, which is the default font for Japanese starting from Windows Vista. AppLocale is not enough since it 1) doesn't seem to cover the function ZUN is calling here and 2) ZUN has an additional layer of (probably unintended) region locking there. Look. If you pass your desired font face name to EnumFontFamiliesEx() and your callback function ends up being called, that font is available on your user's system, period. There's no need to compare the face name in the LOGFONT structure passed to your callback function to what you expect. In fact, the passed face name will always match the current system locale! Therefore, restricting the use of the enumerated font to a successful face name string comparison amounts to nothing but region locking.

That font module, on the other hand, revealed a design weakness in the Windows API detouring module, which makes six modules in need to be written or changed. (This has recently been completed, but well, just so you know why it's been taking so long.)

Nazeo: You did tell me you felt less motivated because people were content with waiting.

Exactly, and this is why I feel that Alcoraiden's complaints are valid. In a way, I've even been waiting for someone to say this. Alcoraiden definitely has the right attitude to all this. After all, thcrap has always aimed to fulfill the demands of highly devoted Touhou fans. Being grateful for my work is definitely nice, but it is just as important to exert pressure if we fall short of our goals.

Nazeo: I've been out for awhile, is it really just one person translating into English?

We~ll. The thing with English is that it's the only language that is still mainly translated on Touhou Wiki. But yeah, vgperson is our only "in-house English translator" on Touhou Patch Center, so to speak, as far as I remember. While TonyUK, is, again, the only person to regularly take care of the copy-pasting from Touhou Wiki to Touhou Patch Center.

Nazeo: Do you think we are understaffed? I think we could have more people in other areas, but after that? I feel as long as steady progress is made towards something, we're not exactly "understaffed".

I think he is referring more to the programming areas, just as Karisa once did. And sure, I could certainly use a bit more help in that regard. However, I see two problems with this:

  1. This is still my engine, and I have certain standards about how I want things to be done. In view of the fact that many, programmers and non-programmers alike, still see thcrap as this "weird auto-translator" they don't understand, they might be pretty insecure about contributing, or just flat-out unwilling to do so.
  2. This is still 11,000 lines of C code they would first have to understand.

Nazeo: The choice is always there for them to make.

Yeah, but note that the choice is "is this worth my time or do I rather contribute to a different project - perhaps one that is more relevant to my interests". thcrap is a "purity over practicality" project in many ways, doing things in what I consider to be the right way instead of doing things the user-friendly way, and constantly evolving, the more I realize what the right way for doing certain things actually is. It's not a translation patch, it's a modkit. Some people may call it a virus because it hacks into things. I call these things viruses that hack into my thing and keep it from working. Fuck you, Norton. And fuck you, Bkav (a Vietnamese AV I recently dealt with, and which was easily deactivated by simply renaming a DLL in Explorer. LOL, enjoy your snake oil). And a lot of people don't like this. They're all about instant gratification, translating one single game into English because that's all they need and that's how their familiar fansubbing tradition works and has always worked. They may just see Touhou as yet another indie game (did I mention that I am not fond of ZUN's moving into exactly this direction?) instead of this grassroots-driven pinnacle of free culture I have always seen it as. This project is about higher ideals, and bringing things to the next level - just like the prideful fandom (which Touhou undoubtedly is) deserves it. But hell, even for those people, thcrap provides all the code they need. They only need to remove the features they don't need (automatic updates, configuration, hot-repatching, etc.) and add comparatively little more code to make it appear just like gensokyo.org's static English patch for th13. Did I mention that this one actually works internally like an early, early pre-alpha of thcrap? We don't have that WTFPL license on the code for nothing. And thcrap is not even the final step. That will be [PyTouhou] (http://pytouhou.linkmauve.fr) - a project with even higher ideals and even less pandering to popular interest.

Be sure to mention the Linux analogy. We don't see ourselves as language-specific distributors. We only deliver the kernel, and it's up to other groups to form around it and build distributions to fit their requirements. Why are Touhou-Online the only one who understand this? :/

Nazeo: Well they have a team of people and a leader. Note - leader. It really helps when one person dictates what needs to be accomplished. It makes projects very effective.

Nazeo: So what I am seeing is that these two groups, Gamer251 who I directly spoken to, and the rest "gets it". So I need to have everyone else see how they see. Hmm... yes. Direction is what the others need. Concrete tasks for them to follow so they know how to contribute.

See, I would say that I am making a conscious effort to make this code usable and expandable for others. I only use one third-party library, Jansson, and the rest is pure, native Windows code. Or rather, "pure, native Windows hell", because this decision certainly has made things very difficult in places (see: automatic updates). Anyway, it's easy to compile and build. Compare that to Music Room Interface, which used 7 (!) third-party libraries in the end. Including FOX, a fairly uncommon GUI framework. No wonder nobody wanted to touch that one. In contrast to mauve, I also spend a considerable amount of time on streamlining and cleaning up my code base, making it prettier and easier to understand. I also spend a lot of time on writing comments. However, no one seems to care about any of this.

As for help. Remember that nurupo has offered to build a GUI for us once he has time. But still, he is asking me to supply a design first - which, again, requires me to do work before he can start. And among all the things still left to be done for this project, you can tell which part I'm the least interested in. Same for artwork. All this implies that "I am the maintainer and I must know what I want", when in reality, I often don't. And even if I did, why does it matter? Look, I don't need a GUI. Neither do I need artwork, personally. I can perfectly accomplish what I want the project to do without those things. This is merely extra functionality that other people ask for. So, when asking me for guidance in their design, they're basically asking me what I think that other people will need. And I mostly only can shrug. And then maybe spend a few minutes thinking hard and then saying (something). Really, it sucks.

[This is a quick concept sketch for a GUI someone of our Skype group posted.] (http://imgur.com/Aap0oLG) I would have never come up with something like this, because this dumbs down thcrap a lot. Yet, this is what people want. They don't want to deal with repositories (= where do my patches come from) nor patch stacks (= which parts does the patch consist of). This is not what I want the project to be, so why should I be building this GUI?

People should be coming with their own ideas first. They should be designing the GUI they want to use. They should not be working for me. It's not about "staff"; it is - and has always been - about individuals contributing what they want to see. Again, it's just like translation. Do a fork first, change the translation, and let others adopt it out of their own free will. If it's good, it will spread. If it's not popular, well, at least it remains a choice.

And as for the GUI, sure, I may not like the GUI someone builds. But others might, and then it might catch on in the community, and then I may adopt it into my version of the project after all. Or heck, they might just improve certain small parts of thcrap, and get me facepalming about why I didn't think about doing this in the first place. That's how open-source software development works, and that's how I want patching to work, too.

Nazeo: If the explanation for the thread has people come along, we can always sort of veer them into how the decorum of forks and contributions work, like you were doing with Gamer251. For the wiki pages themselves, we can create a video on how to translate. In fact, we can do a video on building third-party patch servers as well! Those who have trouble with getting stuff to work can contact me via Skype or PM, and if this is a big thing, I can create a thread dedicated to the subject. For these two things, no programming necessary!

Apparently, the JSON syntax is still a pretty big obstacle. Then again, HTML and CSS are not categorized as "programming" either, so yeah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment