smstools icon indicating copy to clipboard operation
smstools copied to clipboard

BMG: Support STR1 chunk, extra INF1 entry bytes

Open TROguz opened this issue 1 year ago • 4 comments

Will there be support for repacking bmg files?

TROguz avatar Apr 15 '24 17:04 TROguz

It was already able to convert cutscene BMG's to and from SRT. I changed it so now non-cutscene files export to CSV, and those can be brought back to BMG.

impiaaa avatar May 12 '24 01:05 impiaaa

It was already able to convert cutscene BMG's to and from SRT. I changed it so now non-cutscene files export to CSV, and those can be brought back to BMG.

I've tried and doesn't work repack csv to bmg. Here. Some example file: message_en.zip

TROguz avatar May 12 '24 09:05 TROguz

Ok, this file has 2 things: first, a STR1 section, which I don't parse yet, and second, extra data in the INF1 entry pad bytes. The issue with fixing the first issue is just trying to find a good file format to convert this to. I could just do JSON but that's not very friendly for translations. The second issue is more fundamental: INF1 entries can be in a number of formats, entirely depending on which part of the game code reads it. Right now the script makes a guess depending on the size of the entries, and then the number of entries when converting back. Supporting the extra 3 pad bytes would make that format ambiguous with another. So I guess I could go with JSON and explicitly specify the entry size, or maybe a sort of "header row" in the CSV. I'll reopen this and think about it.

impiaaa avatar May 12 '24 20:05 impiaaa

Ok, this file has 2 things: first, a STR1 section, which I don't parse yet, and second, extra data in the INF1 entry pad bytes. The issue with fixing the first issue is just trying to find a good file format to convert this to. I could just do JSON but that's not very friendly for translations. The second issue is more fundamental: INF1 entries can be in a number of formats, entirely depending on which part of the game code reads it. Right now the script makes a guess depending on the size of the entries, and then the number of entries when converting back. Supporting the extra 3 pad bytes would make that format ambiguous with another. So I guess I could go with JSON and explicitly specify the entry size, or maybe a sort of "header row" in the CSV. I'll reopen this and think about it.

There are 186 bmg files in total. I can send them all privately if you want. This was just an example. We can talk on Discord.

TROguz avatar May 12 '24 21:05 TROguz