Page 2 of 2 FirstFirst 1 2
Results 21 to 39 of 39

Thread: TBS Decompiler for new version of The Banner Saga

  1. #21
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Gest, do you think that a tool that decompresses all the *.z files on the game, in one big batch, is easy to make? It would produce a bunch of text-files (with same names, minus the extensions) in the same folder as the .z files, but these can easily be opened and processed "in parallel" by advanced editors. This is vastly useful in tracking variable changes across multiple files/events/scenes etc.
    Together we stand, divided we fall.

  2. #22
    Quote Originally Posted by Gestaltzerfall View Post
    I have created a new version that should support the new *.story.z file format.


    https://www.mediafire.com/file/23qbq9...iler3.air/file

    Till now i've tested only random samples.
    Please tell me if you find some bugs or problems.
    The story.z-files directly inside the '\tbs3\assets\saga3\story' folder are currently not working.
    I have to parse them piece by piece, but I don't recognize the right format.

    For example opening_choices.story.z contains some story questions like "Did you destroyed the bridge?", "Did you rescued the dredge baby?".
    When I'm starting a new game none of these questions are asked. I can only choose between Rook and Alette.
    I think they're not used in the current TBS build.

  3. #23
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Ha! Maybe this is evidence of their initial intent: To have a "save-game-builder" for those that didn't want to import (or had lost their files). Maybe it's useful (to us) in some such manner?
    Together we stand, divided we fall.

  4. #24
    Quote Originally Posted by Aleonymous View Post
    Gest, do you think that a tool that decompresses all the *.z files on the game, in one big batch, is easy to make? It would produce a bunch of text-files (with same names, minus the extensions) in the same folder as the .z files, but these can easily be opened and processed "in parallel" by advanced editors. This is vastly useful in tracking variable changes across multiple files/events/scenes etc.
    In general, this should be no problem. But you may have to be patient until I have the motivation.

  5. #25
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Quote Originally Posted by Gestaltzerfall View Post
    In general, this should be no problem. But you may have to be patient until I have the motivation.
    No pressure, of course. Now that [SPOILERS]Arberrang is saved[/SPOILERS] we have all the time in the world

    Last edited by Aleonymous; 07-30-2018 at 03:35 AM.
    Together we stand, divided we fall.

  6. #26
    I've build a new version.
    Now it's possible to jsonify all files in the selected assets directory( including subdirectories). The process can take some time...

    I do not recommend doing this on the original steam TBS directory. You propably will run out of memory. Don't try that on "C:" either.
    Just copy the preferred folder into another location and choose this one. This also makes it easier to clean up.

    Some of the TBS3 files still creating errors during the process, but TBS1 & 2 files should be fine. Files which engage errors will be logged.

    https://www.mediafire.com/file/hiz6e6...er3.1.air/file

  7. #27
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Wow, so it was that easy (for you) Thanks a lot, I will try this out tonight.

    I would assume that the default Steam installation folder is actually the safest place, with "VIGF" available anytime, if something is screwed... But, if you can request the JSON-ification only of specific directories, it should be fine (and fast) -- decompressing the whole assets dir would be more risky, surely
    Together we stand, divided we fall.

  8. #28
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Worked nicely Note: I had to uninstall previous version (yours too) for this to install properly.

    So, I tried to decompile the \steamapps\common\tbs3\assets\common\character\ folder. It only took a bunch of seconds (maybe 10-15) for ~450 files. Here's the report with the files it didn't manage to open in the subdirs
    Code:
    error prop\battlefield_blockers\1x2_blocker.clip
    error prop\battlefield_blockers\2x2_blocker.clip
    error prop\battlefield_blockers\3x3_blocker.clip
    error prop\dredge_bell.anim\die.clip
    error prop\dredge_bell.anim\get_hit.clip
    error prop\dredge_bell.anim\get_hit_new.clip
    error prop\dredge_bell.anim\master.clip
    error prop\dredge_bell.anim\master_se.clip
    error prop\dredge_bell.anim\vibrate.clip
    error prop\dredge_bell.anim\vibrate_new.clip
    error prop\riverdebris\stump.clip
    error prop\riverdebris\tree.clip
    error prop\tentpoles\pole1.clip
    error prop\tentpoles\pole2.clip
    447 Json files created.
    I also tested the decompiler on the *.story.z files. As you said, it opens most of them, but not all. Here's a few that "hit":
    Code:
    error arb_return_test.story.z
    error opening_choices.story.z
    error reward_unlocks.story.z
    Thanks again! Will try to put this to good use
    Together we stand, divided we fall.

  9. #29
    Here's a new version of the decompiler.
    I think i solved the current problems with the story files.

    In addition, I found and fixed some bugs which were included in the old versions of the decompiler.
    Under certain circumstances it was possible that some information was lost (e.g. switching point-of-view during the animated conversation scenes).
    If you modded some convo files from TBS 1&2 with an older version of the decompiler I recommend to load the original files from scratch and making the changes again.


    I've changed the 'mass'-decompiling option only to decompile just the 'json.z', 'story.z' and 'sbv.z' files.
    These are the only files that make sense to decompile. As a result memory problems should'nt occur anymore.
    The support of '.clip' extension is legacy from the original decompiler. I think their internal format where changed throughout the years.
    Maybe I'll add support later. But a quick look into the resource loading mechanism of the *.clip files gives me little hope.


    https://www.mediafire.com/file/s331h4...er3.2.air/file

    Please tell me if you find some bugs or problems.
    Last edited by Gestaltzerfall; 08-01-2018 at 02:05 PM.

  10. #30
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    You're unrelenting, man. Thanks a lot, honestly.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  11. #31
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Unrelenting is an understatement

    Since you're very much into modding the modding tool (!), I would like to recommend some functionalities, for you to consider implementing (they might be 10min work for you!):

    1. "Find and Replace" functionality in the editor, so that we don't have to go back-and-forth [copy-paste] between TBSdec and, e.g., npp.

    2. "Recompile All" button, that takes all the JSONs (etc) in current folder-tree and puts them back into JSON.Zs (etc), overwriting the old files.

    3. Decompile/Recompile the CLIPS files (for animated sprites & portraits). This must be the most tricky. For the record, initial implementation of animations (e.g. in Factions) was relying only on SWF. In first release of Saga1, for each animation we had a spritesheet (a big PNG) plus a JSON file that "put the frames together"; the Mod-Content DLC of Saga1 still has these "source" SWFs of which one can easily extract spritesheets with licensed Adobe tools. In subsequent versions (of Saga1), about the same time as it went to mobile & consoles, they introduced these CLIP files which are probably a "packing" of the spritesheets and the JSONs (judging from the file sizes), to have it all self-contained in a single file. I am wondering if CLIPs are just a compression or something, so that the contained assets (namely the spritesheets and JSONs) can be extracted, modified, and recompiled. I've asked John Watson about this many times, but never got a response; he just said that it's an in-house tool that does this etc. I don't think Zeno can do anything with these files, but I haven't used it in ages. So, please have a look, and we can ask Stoic again, maybe bugging Drew, Chad or David (whoever is their "tools" guy).
    Together we stand, divided we fall.

  12. #32
    Here's a new version.
    https://www.mediafire.com/file/wun36a...3.2.3.air/file


    Fixed Bug: It could occur to generate corrupt Json when having an empty linkpath-Element in a convo-file.

    Features: Find Text, Reworked Decompile All & Added Recompile All

    Find Text:
    You can search through the selected file. All found text pieces will be marked. The textarea will automatically scroll to the next position.
    This feature may still be a bit untested. Replacing text possibly comes in a later version.

    Decompile All:
    Works with *.sbv.z, *.json.z(except map_camp.json.z) and *.story.z in the selected directory.
    .z-extension will be stripped off.

    Recompile All:
    Works with *.sbv, *.json and *.story in the selected directory.
    .z-extension will be added.
    Existing .z-files will be overwritten.


    @Aleo
    But I have little hope with the new clip/animation-format. Read and converting those files is maybe a long term project.

  13. #33
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Quote Originally Posted by Gestaltzerfall View Post

    Features: Find Text, Reworked Decompile All & Added Recompile All

    Decompile All:
    Works with *.sbv.z, *.json.z(except map_camp.json.z) and *.story.z in the selected directory.
    .z-extension will be stripped off.
    Impressive, really impressive.

    By the way, i am sad to disagree with Aleo:

    a)"Find Text" is a waste of your time. Copying in a proper text editor (np++) offer SO MUCH MORE options (it's quickier than the adobe air framework, it offers indentaion, it offers mass search, find and replace, it offers compare and so on) that it offers really a slightly advange. My opinion is: keep it simple.

    b) Not a huge fan of "Recompile All". I prefer Zeno for that, but i understand the point, it could be really useful if you don't want to use it.

    REALLY (and i mean REALLY) appreciate "Decompile All" and your efforts in bug fixing.

    What's the problem "map_camp.json.z"? I remember it was problematic to "Recompile" trought TBSDec, but it used to Decompile it fine.
    Last edited by YaK; 08-05-2018 at 12:42 PM.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  14. #34
    Quote Originally Posted by YaK View Post
    Impressive, really impressive.

    By the way, i am sad to disagree with Aleo:

    a)"Find Text" is a waste of your time. Copying in a proper text editor (np++) offer SO MUCH MORE options (it's quickier than the adobe air framework, it offers indentaion, it offers mass search, find and replace, it offers compare and so on) that you it offers really a slightly advange. My opinion is: keep it simple.

    b) Not a huge fan of "Recompile All". I prefer Zeno for that, but i understand the point, it could be really useful if you don't want to use it.

    REALLY (and i mean REALLY) appreciate "Decompile All" and your efforts in bug fixing.

    What's the problem "map_camp.json.z"? I remember it was problematic to "Recompile" trought TBSDec, but it used to Decompile it fine.
    I'm using Npp respectively an IDE by myself.
    But some usability and comfort can't hurt. At least it wasn't too boring to implement it.

    To your map question...
    The map consist of 2 parts. 1 Json part that describes locations and their coordinates and a second part that describes clickable parts of the map.
    This second part is an more or less undocumented byte array. Its not human-readable and I don't know about its format.
    So when you open the map_camp.json.z manually, the decompiler keeps the second part in memory and puts it back when you save the file.

    Theoretically I can create a special case..., saving the raw bytes in a second file or something and hope its not gone missing when recompiling it. But I don't find it practically.
    Last edited by Gestaltzerfall; 08-05-2018 at 12:16 PM.

  15. #35
    Senior Modder YaK's Avatar
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    255
    Quote Originally Posted by Gestaltzerfall View Post
    I'm using Npp respectively an IDE by myself.
    But some usability and comfort can't hurt. At least it wasn't too boring to implement it.

    Theoretically I can create a special case..., saving the raw bytes in a second file or something and hope its not gone missing when recompiling it. But I don't find it practically.
    Well, if it's not boring for you, then it's okay

    Regarding the map, nevermind. It's fine as it is.
    My mods: YaK's SSLTBS1 Unofficial Fixpack ( www.nexusmods.com/thebannersaga/mods/1 ) and Drake's & YaK's BS2 Unofficial Fixpack ( www.nexusmods.com/thebannersaga2/mods/2 )




    I think, therefore I am... I think.

  16. #36
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Thanks for the update, Gestaltz! I'll try to give it a spin, ASAP. No more "requests", I promise
    Together we stand, divided we fall.

  17. #37
    Junior Member Pops's Avatar
    Join Date
    Oct 2018
    Posts
    8
    Hi ! First, thank you all for the efforts on making this game better, and I would like to apologize for my newbie question, but... how does this decompiler work ?
    I unpacked the .air file with Winrar, but after that I'm stuck... :-/

  18. #38
    Junior Member Pops's Avatar
    Join Date
    Oct 2018
    Posts
    8
    Hi again !
    After a night of sleep, I realized my question was dumb. It seems like I just have to copy and paste the file and the folder from the .air to the ZenoSaga1 folder, right ? By the way, I like the reference if it is one. ;-)
    I am not able to see my previous post, and so to delete it (because I'm new on the forum I guess). But anyway, it might be useful for future newbies like me.

  19. #39
    Skald Aleonymous's Avatar
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    2,425
    Hey there, and welcome I just approved all your posts (first 2 need approval, then you can fire at will).

    The TBSdec works pretty much like any piece of software: You install it (this one relies on AIR technology, so you might need to install that too), and then you open it. You don't need to place it (the program) in any particular directory. The files you edit, however, can be found in the game's assets subdirectory.
    Together we stand, divided we fall.

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •