News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Jiro Akagawa's "The Sleep of Witches" Situation Report  (Read 19263 times)

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #20 on: June 26, 2012, 09:17:40 pm »
Oh wow. XD

Just played the Forgotten Valley ending. I think I might have missed an event flag, because the "Chapter 2" choice given in the guide didn't work, but wow. Triggering the "Disappearance" and "Old Woman" flags flips the familiar resolution on its head - Tae's normal, despite the villagers' accusations that she's a demon, and they're vampires. Plus it's the girl - the one you name, the one who dies in the "Suicide" path - that tells you how to use the ofuda talisman to wipe them out, rather than Tsunoda (who in this path is, of course, A FREAKING VAMPIRE!).

Also, interesting touch: you can choose which memento the girl gave you, and it'll appear in the "Good End" sequences.

Conceptually, you’ll probably only need two components (depends on how the engine is and your system limitations):
1) your fast-forwarding / skip method (or both)
2) a data structure (refer to your Funnyuncle) for what’s been seen before

If #2 is properly designed and the engine is friendly about it, you can even potentially implement a complete or partial ability to review something you accidentally skipped over (a la the rollback feature in Ren'Py or the “script” feature of L.A. Noire), but that’s icing on the cake.

Because the SNES doesn’t have all that much memory, this may still prove to be more trouble than it’s worth, but then again, you could save a lot of memory for such a feature if you did it (for example) section by section instead of line by line.

I know what a data structure is. ;) I do a lot of programming - and yes, most of my output consists of various ad-hoc romhacking tools. XD

Anyway. A "conditional" skipping feature might be a pain in the ass to implement, but an "all-or-nothing" one like Devil Survivor uses should be well within practicality.
« Last Edit: June 26, 2012, 09:25:41 pm by Ryusui »
In the event of a firestorm, the salad bar will remain open.

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #21 on: June 26, 2012, 09:37:58 pm »
I know what a data structure is. ;)
well, the book is really only good for the fetch modus in the back anyway.
we are in a horrible and deadly danger

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #22 on: June 26, 2012, 09:50:25 pm »
Ugh. Can't believe I missed that. Ah, well.

We're doing it, man. We're making it happen. 8^y
In the event of a firestorm, the salad bar will remain open.

tashi

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #23 on: June 27, 2012, 03:27:45 am »
I'm amazed how much activity sprung up around this game in the past 3ish days. I wish I had put all my junk on that crystal wiki thing... or seen the thread sooner.

Several months ago I looked at this game and noticed the font and script were not compressed, so I made a table and dumped the script. It seems you've already gotten that far. The table is basically just SJIS, right?

Here's as far as I got with the game.
https://dl.dropbox.com/u/42693/majotachi%20table.tbl <- 2888 entries (most control codes still undiscovered..) (maybe not all the kanji??)
https://dl.dropbox.com/u/42693/majotachi.txt <- 2.33MB SJIS raw jp script , VERY messy, many unknown control codes.

table i used for dumping -> https://dl.dropbox.com/u/42693/carttable.tbl
cartographer commands i used for dumping -> https://dl.dropbox.com/u/42693/majocmd.txt

For those curious, the game actually uses 1455 kanji.

Specific breakdown by grade level:

kanji     grade
77    1
156   2
181   3
164   4
150   5
129   6
512   8
63    9
23

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #24 on: June 27, 2012, 03:55:44 am »
That helps so freaking much. I'll still need to make some tweaks, mind, but it means I can focus more on the control codes.

Basically, the Big Plan is to engineer a tool that will recognize the important control codes - the ones that specify script locations as memory pointers - and dump them in a format Atlas can use to reinsert them painlessly. Seriously, I've had experience with a script just like this one - the only difference is that the pointers were relative instead of absolute (which is worse, since there's no way of manually handling them short of calculating every last offset by hand). Either way, unless every pointer lines up precisely with the start of a script entry, Bad Things Happen.
In the event of a firestorm, the salad bar will remain open.

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #25 on: June 27, 2012, 05:08:11 am »
I've worked on two games recently that have the text pointers in their event code (i.e. all over the place), so I had to emulate the event engine and every event code (well, just skipping non-pointer and non-branch stuff, but you still need to know how long each code is) to extract all pointers. It's a pain in the ass, but very doable. This one doesn't even seem as bad because you only have to handle control codes within the text.

From what I gathered when disassembling the character fetch routine, there's a jump table that is indexed by the inverted control code. You could try and look at each jump target and see if it's one that changes the pointers, or not. Well, I guess you already thought of this because it's the only feasible approach to this.

As for the conditional skipping thingy, I'd say that's certainly possible. I can't imagine that the game uses much of the 128kB RAM, does it? One limiting factor would probably be SRAM. Does it even have a save feature?

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #26 on: June 27, 2012, 05:32:08 am »
Oh, definitely. Three slots, in fact. You get to name both your protagonist and the girl whose death/disappearance he's investigating.

EDIT: And at this point, my extractor Rokkenjima (sorry, I couldn't resist) dumps 871KB worth of raw text to a file. Right now, it doesn't touch control codes at all; that will change, of course, in the very near future.
In the event of a firestorm, the salad bar will remain open.

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #27 on: June 27, 2012, 10:34:30 am »
ahaha.wav
we are in a horrible and deadly danger

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #28 on: June 27, 2012, 10:07:15 pm »


Spoiler:
It's a line from episode 43 of Yu-Gi-Oh! ZEXAL. Watch from 20:04 onward - or from 18:00 to get the full awesomeness of the scene.

So yeah. Rokkenjima is up and running to the point where its output reinserts into the ROM perfectly, though I'd like to make some more tweaks. Editing a script this size in one chunk is a pain, for one, and I'm thinking of trying to figure out some intelligent way of splitting/rejoining the script for editing and insertion, respectively. Plus adding some kind of helpful signposting to the script file to indicate where each line begins. Technically, there already is some (the FFF8 control code), but I should see if I can't make that human-readable. :3

And again, there's still the hacking that needs to be done to the game itself to allow for VWF and whatnot. But this is a big step forward. We are now capable of producing a machine-formatted script that keeps all of the pointers intact.

EDIT: Oh-kay, that was more annoying than it had any right to be. I had to refactor my code for parsing control codes, but now it can give them special treatment - like identifying the start and finish of each individual page of text. This has been most enlightening for my understanding of the control codes: FFE8 and FFE9 are apparently used for the dialogue choices, for instance. I'm not sure how worthwhile it will be to identify all of them apart from the ones used directly in formatting, but making the script more human-readable overall should prove valuable in the long run.
« Last Edit: June 28, 2012, 04:38:13 am by Ryusui »
In the event of a firestorm, the salad bar will remain open.

tashi

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #29 on: June 28, 2012, 08:01:06 am »
It's impressive how much you've been able to progress on this in such a short span of time. I wonder how transferable the tools you made would be for other SNES novels like "gakkou de atta kowai hanashi" or others.

DSwizzy145

  • Sr. Member
  • ****
  • Posts: 427
  • Super Famicom Fanatic
    • View Profile
    • Super Famicom Game List A-C + SNES Game List
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #30 on: June 28, 2012, 10:48:15 am »
nice work! hows progress coming along in this game so far? if you don't mind me asking :D thank you!

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #31 on: June 28, 2012, 11:33:56 am »
Haven't done any actual translation work yet; just making sure the script is as easy to work with as possible.

The next step, once I'm happy with Rokkenjima's output, is to start hacking the game itself. Fortunately, there's already some VWF-like chicanery going on behind the scenes here, so hopefully all I'll need to do is hijack it. I also want to set things up so that, if possible, the English and Japanese text can coexist in the ROM without the latter coming out as cavespeak. I'm going to see if I can't implement a brand-new control code that will switch the game to using ASCII encoding (and a corresponding font) for English text - I don't have my semicolons, and this will not stand. XD
In the event of a firestorm, the salad bar will remain open.

DSwizzy145

  • Sr. Member
  • ****
  • Posts: 427
  • Super Famicom Fanatic
    • View Profile
    • Super Famicom Game List A-C + SNES Game List
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #32 on: June 28, 2012, 04:34:29 pm »
Thats great man! :) so the hacking part needs a title hack and font insertion right? besides having the text hacked horizontal, nice man hope your work goes according to plan and successful ;)

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #33 on: June 28, 2012, 04:41:41 pm »
The text is already horizontal. >_> Unless you're talking about the title screen, which, yeah, I can probably edit with little trouble. Turns out I'm actually not half bad with graphics. About 90% of the English-language graphics in The Nameless Game are my doing - I even coined the English translation's name for the challenge mode, "Blind Terror," in the process. (The original is roughly "Invisible Mode.")

Anyway, it'll take a bit more than just inserting graphics. I need to hack the game to add in a proper proportional font (or VWF, in our parlance), preferably while still leaving it capable of displaying the original Japanese text. There's also the name entry screens, and I have no idea how any of this is going to affect the save slot selector. Basically, we're at a point where translating the game is possible without sifting through reams of control codes - it's just that the end product will likely be ugly as hell if we move forward at this point.

Speaking of the translation, while the link DarknessSavior gave me has been a big help, I'd like some further input. The Japanese Wikipedia page lists every named character, though I'll admit I'm not sure how some should be rendered.

津田俊夫 - Toshio Tsuda (the protagonist)
中込依子 - Yoriko Nakagome (the woman)
河村巡査 - Junsa Kawamura (or Koumura)
角田平蔵 - Heizou Kakuda (who I identified as Tsunoda earlier; might also be Kakuta or Sumida)
金山医師 - Dr. Kanayama (the town doctor)
水谷先生 - Mr. Mizutani (a schoolteacher)
お種 - ??? (the creepy old woman)
栗原多江 - Tae Kurihara (the mystery girl, and possibly A FREAKING VAMPIRE! depending on your story path)
角田栄子 - Eiko Kakuda (Heizou's daughter)
大沢和子 - ??? Oosawa (kanji.reader.bz suggests four possibilities for her given name - "Wako," "Masako," "Kazuko," and "Nagiko")

Any opinions on this list?
« Last Edit: June 28, 2012, 05:24:11 pm by Ryusui »
In the event of a firestorm, the salad bar will remain open.

DSwizzy145

  • Sr. Member
  • ****
  • Posts: 427
  • Super Famicom Fanatic
    • View Profile
    • Super Famicom Game List A-C + SNES Game List
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #34 on: June 28, 2012, 05:36:21 pm »
sorry about that, i was thinking of the other Super Famicom visual novel simlar to this game xD but yeah the title screen hack can be less of a hassle right? but i am curious of how the name could all fit in that one image when it comes on unless the font has to be reduced a bit to fit the screen

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #35 on: June 28, 2012, 05:41:46 pm »
sorry about that, i was thinking of the other Super Famicom visual novel simlar to this game xD but yeah the title screen hack can be less of a hassle right? but i am curious of how the name could all fit in that one image when it comes on unless the font has to be reduced a bit to fit the screen

There's no "font" on the title screen - it's a single solid image. Changing it is a matter of creating a new image to replace it; the font can be any size I want.
In the event of a firestorm, the salad bar will remain open.

DSwizzy145

  • Sr. Member
  • ****
  • Posts: 427
  • Super Famicom Fanatic
    • View Profile
    • Super Famicom Game List A-C + SNES Game List
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #36 on: June 28, 2012, 06:00:58 pm »
oh i see, well that can be no problem with the power of gimp software :) since its only a text and no text involvement

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #37 on: June 28, 2012, 06:22:34 pm »
Well. It's not inserted into the game yet, but I think I've made a respectable attempt at a logo already.

Here's a mock-up title screen. The font is Garamond with a Splatter filter, and yes, the blood drips are actually copied directly from the original Japanese logo. ^_^; I think it turned out pretty good, to be quite honest.

In the event of a firestorm, the salad bar will remain open.

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #38 on: June 28, 2012, 06:27:33 pm »
津田俊夫 - Toshio Tsuda (the protagonist)
中込依子 - Yoriko Nakagome (the woman)
河村巡査 - Junsa Kawamura (or Koumura)
角田平蔵 - Heizou Kakuda (who I identified as Tsunoda earlier; might also be Kakuta or Sumida)
金山医師 - Dr. Kanayama (the town doctor)
水谷先生 - Mr. Mizutani (a schoolteacher)
お種 - ??? (the creepy old woman)
栗原多江 - Tae Kurihara (the mystery girl, and possibly A FREAKING VAMPIRE! depending on your story path)
角田栄子 - Eiko Kakuda (Heizou's daughter)
大沢和子 - ??? Oosawa (kanji.reader.bz suggests four possibilities for her given name - "Wako," "Masako," "Kazuko," and "Nagiko")
Any opinions on this list?

Kazuko should be the most common reading based on my experience. I'd also say it's Kawamura.

DSwizzy145

  • Sr. Member
  • ****
  • Posts: 427
  • Super Famicom Fanatic
    • View Profile
    • Super Famicom Game List A-C + SNES Game List
Re: Jiro Akagawa's "The Sleep of Witches" Situation Report
« Reply #39 on: June 28, 2012, 07:19:33 pm »
thats a very nice image for a title hack! :D this'll be perfect for the localization of the game so far ;) btw the jiro akagawa gets taken off the title too?