Aokana - Four Rhythms Across the Blue

Aokana - Four Rhythms Across the Blue

View Stats:
[Patched] Explanation of V.Bookmarks Menu bug on launch
This information only applies to versions of the game before the latest update on 2021-01-21. The latest version will salvage your bookmarks without removing broken entries.




For those who haven't experienced it. When launching the game, unfortunate souls that encounter this issue are immediately met with a non-functional Voice Bookmarks menu, no splash screen, or... there is one, as you can hear it in the background. There is no easy way to exit this menu. Thus rendering the visual novel unplayable.

Image preview of the bug[i.imgur.com]

This bug is caused when bookmarking a voice with a forced line break (AKA, new line character) in the message text. When this happens, the game throws an error while trying to read bookmarked messages listed in the vbookmark.dat file, which ultimately results in the V.Bookmarks menu opening up at launch, in a non-functional state.

This is one such line in the game that causes your bookmarks file to break.
Originally posted by Misaki:
How many times do I have to tell you not to be embarrassed?!
Mwaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah!

The current 'solution' is to delete your Voice Bookmarks data, by removing the file: SaveData/vbookmark.dat. Naturally you will lose all of your Voice Bookmarks gathered up to now. However, this scenario is salvageable without deleting all of your gathered Voice Bookmarks, though there's a few ways of solving it, and none of which are easily available to everyone without technical knowledge.




1. Fix the file itself. Remove the entry with the newline in the message, or replace the newline characters with anything else - except the pipe character '|'.

The SaveData/vbookmark.dat file format (after the first 112 (0x70) bytes) is as follows, in UTF-8 encoding.
Slot# | VoiceID | Name_EN&JP | Text_EN&JP newline

Each bookmarked message entry is separated by a newline. And each entry is split into four parts using the pipe '|' character. The first part is the number of the slot the bookmark is saved in (starting at 0), the second is the ID of the voiced line, the third is the character name (in English then Japanese), and then the message (similarly in English then Japanese).

2. Patch the VN to accept broken bookmark files

Using a program, such as dnSpy, you can manually replace the erroneous code with something that'll happily accept the vbookmark.dat file as is. See below for technical details on patching and method replacement. I don't have clear instructions for how to do this dnSpy written yet, so I don't advise this method if you don't know what you're doing.

Handing out the patched Assembly-CSharp.dll isn't an option, unless the developers give the okay, I wish it could be that easy though...




3. For now I can take requests for fixing files by hand, I can't guarantee a fast response time though.




Technical Details on Patching
The exact cause of the failure is usually Convert.ToInt32(parts[0]); attempting to read text that isn't a number. Which happens when a rogue newline appears in a message, forcing the creation of a new bookmark entry where there shouldn't be one.


// <Assembly-CSharp.dll> class UIVBookmark::void Import(string)
public void Import(string data) {
this.bookmarks = new UIVBookmark.VBookmarkData[this.bookmarks.Length];
string[] entries = data.Split('\n');
for (int i = 0; i < entries.Length && i < this.bookmarks.Length) {
if (entries[i].Length < 1) {
continue;
}
string[] parts = entries[i].Split('|');
int slot = Convert.ToInt32(parts[0]);
this.bookmarks[slot].fn = parts[1];
this.bookmarks[slot].name = parts[2];
this.bookmarks[slot].text = parts[3];
}
}

Fixed Method
This change attempts to correct all bookmark entries with newlines in their message before the game reads the bookmark data. I've used dnSpy to replace this function in Aokana_Data/Managed/Assembly-CSharp.dll to confirm that voice bookmarks can be loaded again.


public void Import(string data) {
this.bookmarks = new UIVBookmark.VBookmarkData[this.bookmarks.Length];
string[] entries = data.Split('\n');

for (int i = 0, j = 0; i < entries.Length && j < this.bookmarks.Length; i++, j++) {
if (entries[i].Length < 1) {
continue;
}
string entry = entries[i];
// Stupid quickfix for unsanitized '\n' chars in messages.
// Check if 3 '|' chars exist in the following entry,
// if not, it's likely part of *this* entry.
// Assumes no dialogue is dumb enough to make use of the pipe '|' character.
while (i + 1 < entries.Length) {
// Ugly but optimized: count number of '|' characters
int numParts = (entries[i+1].Length - entries[i+1].Replace("|", "").Length);
if (numParts >= 3) {
break; // Next is a normal entry, this entry *should* be complete now.
}
entry += "\n"; // Add back-in the split newline character.
entry += entries[++i];
}
string[] parts = entry.TrimEnd('\n').Split('|');
int slot = Convert.ToInt32(parts[0]);
this.bookmarks[slot].fn = parts[1];
this.bookmarks[slot].name = parts[2];
this.bookmarks[slot].text = parts[3];
}
}

The offending message that broke my Voice Bookmarks file[i.imgur.com]
Last edited by trigger_segfault; Jan 21, 2021 @ 3:04pm
< >
Showing 1-1 of 1 comments
Intrepid Jan 30, 2021 @ 1:09am 
Great guide. I encountered this on Extra 1 two months ago, but rather than having to go into the game's files to delete the voice bookmark data, my screen still had a single voice bookmark on it, rather than being completely blank, and deleting it caused the issue to resolve itself. Glad to see it's officially patched in the main game now, hopefully in comes to Extra 1 soon.
< >
Showing 1-1 of 1 comments
Per page: 1530 50