RetingencyPlan / le_quickbms_script_compendium

just in case you thought my "thread" at ZenHAX was way too bloated for what it actually is
16 stars 3 forks source link

(Rabbids Go Home) Extracted shortcuts are actually filenames #7

Open icup321 opened 2 years ago

icup321 commented 2 years ago

I recently tried to extract the assets for Rabbids Go Home, and I noticed that when I extracted them, the script separates the filenames from the actual assets as "shortcuts" instead of renaming them accordingly, is there any way to extract all of the assets with proper filenames, or is there something I'm doing wrong with how I am extracting them?

RetingencyPlan commented 2 years ago

no, you're doing nothing wrong with them. this is intended behavior because i needed the script to tell the difference between files that reference other files and actual files with screwed-up names. to give the user a heads-up on the actual, messy file this "shortcut" file apparently references. but also to focus on the bf file itself instead of jumping between two or three bf files.

just to give you an example, there is a file with a cohesive name. let's call it BinkFile.bik for brevity sake. inside that bik file, you don't get an actual bik file per se but rather reference data regarding the whereabouts of the file itself. so you get stuff like "$hd$/ab/ab/abab0000.bik" inside that data, and because of the existence of such files i decided to call them "shortcuts".

so, now we know where abab0000.bik is. the question is where are you going to find it. if it's not in the "main" bf (example - RGH.bf) then it's in another bf with a rather interesting name (example - RGH.$hd$.bik.bf). within that bf you see abab0000.bik stored in there. then you realize that abab0000.bik is actually BinkFile.bik and the script didn't really catch that.

the script doesn't have a feature for "renaming them accordingly" because i didn't think of a satisfactory way of renaming files with weird names to something more sane, like abab0000.bik to BinkFile.bik. and when i tried to think of that, i realized that the frankly-limited programming language that this script was written on would necessitate as many hacks as necessary to support bf files that store "shortcuts" to other assets residing in other bf files.

and because some Ubisoft games from around the PS3-X360-WII-WIIU era used this "ABE" format, i would need to account for whatever console/portable version of an Ubisoft game i didn't know about that used said format so as to allow this kind of "extracting assets with proper filenames" thing () . and given that these games doesn't actually use filenames at all*, instead preferring to load assets by their IDs instead through that format, i wasn't too keen to go forward to that idea.

with that being said, this doesn't sound too hard to implement. assuming i don't screw anything up, i might have a decent idea or two to work around this issue.

(*) - as you may have known by now, Michael Jackson: The Experience had in-house subsidiaries working on the game. their own versions of the game, to be precise, and they weren't necessarily made with one platform in mind. PS3 and Wii versions used an engine which had said format in it that works rather differently from the other versions of the game, as made by other in-house subsidiaries. Xbox 360 version used an engine that was designed exclusively with that version in mind, and it wasn't fully identical with the aforementioned versions. same with the PSP ver as well, not to mention the Vita, 3DS and iOS versions of the game which are massively different from the aforementioned versions in that they not only use another Ubisoft engine but had an entirely different look-and-feel to the whole thing as well.


so i took a look at those "shortcuts" and what i've said of them is true except for the fact that they not only have the needed filename to "extract an asset" from, they always look like this. $shadow$/ab/ab/abab0000.$hd$.bik in some games, they do come with a "key" of sorts (like "$hd$") but nothing particularly useful otherwise.

the only possible way i could think of would be for the script to read "default.cfg" file (since it has some actually useful info in it, all written in text though) so the script could do more with "shortcuts" but i would have to "reinvent the wheel" to make that happen. so yeah, implementing hack after hack just to get one actual asset from another bf through an "main" one is, as i said above, not exactly "ideal".


honestly i don't even know why i wrote this wall of text, i'm not particularly fond of it. you are right about shortcuts being actually filenames though.

RetingencyPlan commented 2 years ago

OK, i'm tackling this now. like, right now. no guarantees that it'll work though.

RetingencyPlan commented 2 years ago

i was just about close to ensure the script extracted assets with proper filenames but... things didn't go as well as i'd hoped. here is what i managed.

sally_bf_alt[bms].zip this script is not entirely functional but it attempts to extract all the available assets in the "main" bigfile first, then gathers all the "referenced assets" from other bigfiles so it can try to do something with them. i had an exhausting time with pulling this off and i'm not sure i want to "refine it" to something that you want.

the latest quickBMS version isn't too friendly with this script when it comes to "main" bigfiles that weigh at about 3GB or lower. i just don't know what to do here.


for context sake, this is what i mean when i say "things didn't go as well". quickbms_0_11_1_error.txt there's this "exception handler" error where quickbms somehow manages to "hang up" as it's trying to run the script with the main bigfile.

icup321 commented 2 years ago

Oh, I see... Yeah, LyN engine BF formats seem to be way too complex/shitty for QuickBMS to handle extraction properly from what you've told me.

In that case, the only way I see for extracting the assets from LyN engine games properly would be if someone were to create modding tools/programs specifically for LyN games. Sadly, I just don't think that will happen anytime soon, especially with how Ubisoft used LyN for mostly shovelware dancing games, it's no wonder no one gives a shit about this engine.

I'll keep this issue open unless I find another way to be able to extract LyN BF files. If I do, I'll simply link it here.

RetingencyPlan commented 2 years ago

well, i'm still thinking of extracting assets "properly" from these bf files. although looking back at what i've managed with quickBMS i may have pushed it to its limits.

from what i see, the LyN engine had a very good codebase that was kinda wasted as the years went by. there were some concepts that were carried over from the Jade engine and improved upon in LyN, i feel. but i only know about little of it. not sure about modding but a program that would dive deep into the inner workings of LyN-based games would be interesting to see.

i don't know of any other LyN BF extractor beyond my very own sally_bf.bms. well there were SOME LyN BF scripts but mine seems to be the one with the most polish given how much time i've invested into the format. with that said, i'll be looking forward to whatever you bring to the table.