three-houses-research-team / Throne-of-Knowledge

A good place to start from if you're in need of explanations or documentation
23 stars 8 forks source link

Game Fails to Load Edited Battles #1

Open MasterDriverRex opened 4 years ago

MasterDriverRex commented 4 years ago

I followed the steps on both how to extract the contents of DATA0.bin and DATA1.bin from my game + 1.2.0 update romFS dump (getting me the .bai files I was looking for) and how to use pack_info.py to turn edited .bai files into the INFO0.bin and INFO2.bin files. I had also previously edited fixed_classdata.bin, fixed_data.bin, fixed_persondata.bin and fixed_shopdata.bin and, following the instructions, put them in /romfs/mods/nx/data/.

However, upon running the pack_info.py file using cmd.exe (double-clicking it does nothing, so I have to use this method), it successfully put the .bai files into the two INFO .bin files, but not the .bin files - output: Ignored: no index detected in name or info0.

Since I had already edited the .bin files several days ago, and put them on my microSD card (/./atmosphere/contents/010055D009F78000/romfs/patch4/nx/data/), I thought that "Ignored" error didn't matter since those .bin files already worked; I then copied the INFO0.bin and INFO2.bin files to my microSD card (/./atmosphere/contents/010055D009F78000/romfs/patch4/) and loaded my game.

However, upon trying to load one of my edited battles (I tried two: 89 - The_Magdred_Ambush and 91 - Assault_at_the_Rite_of_Rebirth) the bar at the bottom of the loading screen filled up incredibly slowly and even after reaching the end it never progressed to the actual battle.

Am I screwing up somewhere, somehow? Why's it ignoring my edited .bin files?

Raytwo commented 4 years ago

The bin files were ignored because their name did not contain the index of the file they are replacing or use the original name from INFO0. Meaning your repacked INFO files do not complain those files that are supposed to have been patched since release, so the game tries to load the 1.0.0 file which are not valid anymore and fails to do so.

Make sure to fix that and it should work.

MasterDriverRex commented 4 years ago

Oh, the numbers that are in front of the .bai files; right. If I'm not mistaken, judging from the DATA extraction, the right indexes would be 6, 11, 12, and 30? I first used NXDumpTool to get my files, which didn't put index numbers in place; oops.

Put the numbers in front and...yep, the cmd.exe window now says "Replace" instead of "Ignored". Might have to try this out tomorrow; it's getting quite late here.

MasterDriverRex commented 4 years ago

Hmm...now it's stuck on the Nintendo Switch loading screen - immediately after I open the game. It doesn't even show the Crest of Flames loading screen. Odd.

Raytwo commented 4 years ago

If you run Atmosphere, you could eventually take a look at Aldebaran, this would help with faster trial and error and you won't need to repack INFO anymore.

MasterDriverRex commented 4 years ago

I think I see the issue; the .bin files I got from the DATA extraction aren't "fixed", so they have a different data structure or something. At least, fixed_persondata.bin and 12 - persondata.bin don't look at all the same in a hex editor; 30 - shopdata.bin is missing Vajra-Mushti; 11 - classdata.bin has incorrect data for the Ashen Wolves classes; and even 6 - fixed_data is missing Vajra-Mushti, Chalice of Beginnings and the Fetters of Dromi.

Meanwhile, the fixed_ .bin files I got from the NXDumpTool romFS dump DO have the 1.2.0 data, despite the DATA .bins also coming from that same dump...but not in the patch4 folder?

Could trying to load the 1.2.0 files instead of the base game files be causing issues? Severely out of my depth here; trying my best.

Raytwo commented 4 years ago

Well, I did mention that because of you removing the indexes, the game was loading 1.0.0 files and crashing. So you have to use the latest fixed_ files from the /patch4 folder and work with those.

If you're too confused with all that mess, consider joining the FETH hacking server as it is not easy to help you here.

MasterDriverRex commented 4 years ago

I've just noticed that the edited INFO0.bin is larger than the original - 344 KB instead of 341 KB. Could that be the problem?

Or could it be how running pack_info.py through cmd.exe results in the .bai files being "added", but the .bin files being "replaced"? Instead of them all being "replaced" or "added"?

DeathChaos25 commented 4 years ago

Oh, the numbers that are in front of the .bai files; right. If I'm not mistaken, judging from the DATA extraction, the right indexes would be 6, 11, 12, and 30?

These are NOT correct indexes for bai files.

Bai files start from index 83 (prologue, named "A Skirmish at Dawn").