[Modding] FTL UnPacker 1.0.1 - .dat un- and repacker GUI

Discuss and distribute tools and methods for modding. Moderator - Grognak
Didero
Posts: 14
Joined: Fri Sep 21, 2012 12:26 pm

[Modding] FTL UnPacker 1.0.1 - .dat un- and repacker GUI

Postby Didero » Sat Sep 22, 2012 12:21 pm

While Bas's ftldat is incredibly useful and very important for the modding community here, it can be a bit hard to use, with having to install Python and using the command line. Therefore I decided to create a GUI (Graphical User Interface) to make packing and unpacking these .dat files easier.

And to that end I present the FTL UnPacker:
Image

It's written in Java, so you will need to install that from Java.com if you don't have it already. But I think for most people this won't be necessary as they already have it installed.
The upshot is that it is multiplatform, so Windows, Mac and Linux users alike can use it. I've only been able to test it on Windows though, so if you're on a different platform, please let me know if it works!

I tried to make the program as straight-forward as possible to use.
The first tab is the 'Unpack' tab, where you can specify the .dat file you want to unpack and the location where you want to unpack it.
The 'Pack' tab is for packing up unpacked files into a .dat file, again with a field for specifying the location of the files to be packed, and a field to indicate where the packed .dat file should be placed.
For all these fields, you can either type in the location manually, or navigate to the file or folder by clicking the 'Browse...' button next to the textfield.
There's a more extensive explanation in the included Readme, but hopefully the program is easy enough to use without having to read that.

The program can also be run from the commandline, to make automated use easier. The explanation is again in the Readme file, but the basics of it is that you can use the arguments 'unpack' and 'pack' to unpack and pack files, respectively. You do have to provide two more arguments, namely the source file or folder and the target folder or file.
An important difference between using the command line and the GUI is, that the GUI will ask before overwriting files, but when using the command line the program will just overwrite existing files if they have the same name. I did it this way to not hold up automated scripts, but it is something to keep in mind.

Download here (version 1.0.1).

Changelog:
Version 1.0.1 (25 Sept 2012):
-Fixed FTL UnPacker not running on Java 6
-Fixed 'Browse' buttons pointing to the wrong folder when using relative paths

Version 1.0 (22 Sept 2012):
-Initial release


Finally, thanks to the people here who dug into the files to see how they were packed together, and to Bas in particular for making ftldat and posting the code online, it made it a lot easier to make FTL UnPacker!

I hope FTL UnPacker is easy to use, but I'm open to suggestions for improvements.
Last edited by Didero on Wed Sep 26, 2012 7:34 am, edited 2 times in total.
Alblaka
Posts: 98
Joined: Thu Sep 20, 2012 1:41 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Alblaka » Sat Sep 22, 2012 12:31 pm

Now, kudo's on making FTL-scripting avaible to those who can't use CMD-lines.
Anything providing more modding incentive for the uprising modding community of FTL is useful ^^

(I will still stick with my .bat files. A simple doubleclick instead of calling a program, choosing a folder, etc...)
Greetz,
Alblaka
Didero
Posts: 14
Joined: Fri Sep 21, 2012 12:26 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Didero » Sat Sep 22, 2012 12:36 pm

Alblaka wrote:Now, kudo's on making FTL-scripting avaible to those who can't use CMD-lines.
Anything providing more modding incentive for the uprising modding community of FTL is useful ^^

(I will still stick with my .bat files. A simple doubleclick instead of calling a program, choosing a folder, etc...)


Thanks :)

And you can still use this program in a .bat file, as I explain a bit in the post and more extensively in the 'Advanced Usage' section of the readme. I tend to be pretty verbose though, so I can't blame you for missing that.
Basically, you can unpack automatically with "java -jar FTL_UnPacker.jar unpack path/to/.dat extract/folder", where you obviously have to replace the last two arguments with actual paths. If there's spaces in the path you'll have to enclose it in quotation marks to not confuse the parser. I specifically built that in since I knew people would like to use '.bat' scripts.
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby swixel » Sat Sep 22, 2012 1:02 pm

Didero wrote:I specifically built that in since I knew people would like to use '.bat' scripts.


This is getting to the point where I should probably release the C++ version of the file manager (I've just been distracted by the world and too lazy to polish things) -- I mean, the .dat files aren't exactly a new format, I just haven't been bothered to fix it.

though, if I might inquire: why Java over C#.NET? You're handling the same syntax, and most people would already have .NET on Windows ... and many people would have Mono on Linux.
Alblaka
Posts: 98
Joined: Thu Sep 20, 2012 1:41 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Alblaka » Sat Sep 22, 2012 1:38 pm

Didero wrote:And you can still use this program in a .bat file, as I explain a bit in the post and more extensively in the 'Advanced Usage' section of the readme. I tend to be pretty verbose though, so I can't blame you for missing that.
Basically, you can unpack automatically with "java -jar FTL_UnPacker.jar unpack path/to/.dat extract/folder", where you obviously have to replace the last two arguments with actual paths. If there's spaces in the path you'll have to enclose it in quotation marks to not confuse the parser. I specifically built that in since I knew people would like to use '.bat' scripts.


Why should I download an additional program to use a more complex call in a bat, when I can just use the bat and the basic command? :3
Of course you could argue it's more useful for putting stuff into distintive folders, but if you're used to using Junctions/SysLinks that's not much of concern in first place (aka, I have all my bats, the unpacked-ressource/data folder and a shortcut to start the game all in the same folder, easyly accessible).
Greetz,
Alblaka
Didero
Posts: 14
Joined: Fri Sep 21, 2012 12:26 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Didero » Sat Sep 22, 2012 4:30 pm

though, if I might inquire: why Java over C#.NET? You're handling the same syntax, and most people would already have .NET on Windows ... and many people would have Mono on Linux.[/quote]
Because I already know Java, and I don't have any experience with the C family.

Alblaka wrote:
Didero wrote:And you can still use this program in a .bat file, as I explain a bit in the post and more extensively in the 'Advanced Usage' section of the readme. I tend to be pretty verbose though, so I can't blame you for missing that.
Basically, you can unpack automatically with "java -jar FTL_UnPacker.jar unpack path/to/.dat extract/folder", where you obviously have to replace the last two arguments with actual paths. If there's spaces in the path you'll have to enclose it in quotation marks to not confuse the parser. I specifically built that in since I knew people would like to use '.bat' scripts.


Why should I download an additional program to use a more complex call in a bat, when I can just use the bat and the basic command? :3

Because ftldat is only command-line, and FTL UnPacker has both a GUI and command line options.
But I understand that you don't want to switch if you already have a working setup.
Icehawk78
Posts: 230
Joined: Tue Sep 18, 2012 4:55 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Icehawk78 » Sat Sep 22, 2012 4:53 pm

swixel wrote:
Didero wrote:I specifically built that in since I knew people would like to use '.bat' scripts.


This is getting to the point where I should probably release the C++ version of the file manager (I've just been distracted by the world and too lazy to polish things) -- I mean, the .dat files aren't exactly a new format, I just haven't been bothered to fix it.

though, if I might inquire: why Java over C#.NET? You're handling the same syntax, and most people would already have .NET on Windows ... and many people would have Mono on Linux.

Ew, as a native Linux user, please, no!

Java, C++, Python, Ruby, etc - are all natively multiplatform on all the major operating systems. .net is not - it's a closed-source, proprietary language which is mediocrely implemented via the Mono project on any operating system other than Windows. Mono/Wine are not reliable or valid workarounds for multiplatform compatibility.

(And realistically, for the average Windows user, Java is just as likely to already be installed as the .net framework - it doesn't automatically come preinstalled on every version of Windows, and a lot of programs require java.)
Skrubby
Posts: 1
Joined: Sat Sep 22, 2012 10:15 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Skrubby » Sat Sep 22, 2012 10:18 pm

Hello,

I started playing with this. I never really did any modding before.

I thought I was doing it right, but I am encountering problems.

After deciding to simply try to unpack and repack the same data before trying to pack my new data.dat, I found that it doesn't work even doing that.

I will unpack the data.data to a folder along the lines of c:/ftldata/original data and simply reverse the process and send that same data back to the data.dat file, and i get an assertian failed runtime error from the game when I go to play it.

I can simply uninstall the game and reinstall it and it works just fine, but anytime I try to pack data, even the original game's data, it does this.

Any ideas?
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby swixel » Sat Sep 22, 2012 10:49 pm

Icehawk78 wrote:Java, C++, Python, Ruby, etc - are all natively multiplatform on all the major operating systems. .net is not - it's a closed-source, proprietary language which is mediocrely implemented via the Mono project on any operating system other than Windows. Mono/Wine are not reliable or valid workarounds for multiplatform compatibility.

(And realistically, for the average Windows user, Java is just as likely to already be installed as the .net framework - it doesn't automatically come preinstalled on every version of Windows, and a lot of programs require java.)


EDIT: Removing potentially inflamatory parts.

C#'s language spec has been open since 1.0. Mono also runs with full C# 5.0 support (and everything in .NET 4.5's API, missing only a few things it doesn't need back in early versions), and carries WinForms 2 now. Mono doesn't need Wine. .NET is a library/framework, and Mono is a compiler/interpreter/language implementation which ships with that framework. Mono is in the Ubuntu std repos, and the binary for Mac just drops into place.

C++ isn't multiplatform, it's platform agnostic; the programmer has to make the application cross platforms (users can't just drag binaries across and hope for the best, which is what it sounds like you were implying).

Skrubby wrote:I will unpack the data.data to a folder along the lines of c:/ftldata/original data and simply reverse the process and send that same data back to the data.dat file, and i get an assertian failed runtime error from the game when I go to play it.

I can simply uninstall the game and reinstall it and it works just fine, but anytime I try to pack data, even the original game's data, it does this.


You've modified something to an invalid value; what, specifically, I couldn't tell you. I got it when I started tweaking the prof.sav file to find out what things were, but I've also had it when I botched a replace of a file in data. What are you modifying?
Didero
Posts: 14
Joined: Fri Sep 21, 2012 12:26 pm

Re: [Modding] FTL UnPacker - .dat un- and repacker GUI

Postby Didero » Sun Sep 23, 2012 9:37 am

Could you please move the programming language discussion to a different thread? It's dragging the thread off-topic. I made this in Java because it's the only real programming language I know, that's all there is to it.

Skrubby wrote:After deciding to simply try to unpack and repack the same data before trying to pack my new data.dat, I found that it doesn't work even doing that.

I will unpack the data.data to a folder along the lines of c:/ftldata/original data and simply reverse the process and send that same data back to the data.dat file, and i get an assertian failed runtime error from the game when I go to play it.

I can simply uninstall the game and reinstall it and it works just fine, but anytime I try to pack data, even the original game's data, it does this.

Any ideas?

I don't have any ideas off-hand, no, sorry. What OS are you on? I've only been able to test it on Windows, so if you're on a different OS and it doesn't work there, I've got some fixing to do.
Can you be a bit more specific on what exactly you did? What size is the newly created 'data.dat'?

Also, it's a good idea to make a backup of the original .dat files instead of overwriting them.