I am Drakulix and I am totally new to this community, however I am enjoying the various nice mods for FTL already quite a while. Now the iPad is out and I tried my best to reverse engineer the iPad version and got some interesting details, I wanted to tell you all. I tried the last days to create some tools to make editing the iPad Version a lot easier, however I was running into some serious issues, I am not totally sure how to solve them. For that reason I decided to drop working on this and just share, what I found out, so some smarter people may be able to do that.
What to expect (short table of contents):
- extracting and modifing iPad game assets.
- differences to modding the Win/Mac/Linux version - most mods don't work out-of-the-box on the iPad
- a lot technical stuff, that is not very deeply explained. If you have no clue, what I am talking about, wait until some more skilled people have build nice interfaces around this stuff.
For clarification:
When I talk about bad performance on the iPad, it does usually not mean, that your game will lag. On an iPad 2, that might actually happen, but on my iPad Air I did not notice any lags so far. It actually depends on your device and is not very likely (FTL is not a very demanding game). However it will always drain your battery faster (not necessary noticeable on modern iPads), when I am referring to "bad performance".
So lets start:
1. All game assets are stored in a file called ftl.dat on the iPad
So your first question probably is, how to get that file. You don't need to grab it for modding as you will see later.
But okay, if you are interested anyway, I recommend using iFunBox. Jailbreakers will probably have other preferred ways.
2. The format is not the same as on PC.
Figuring out the format took me most of the time on my research, I was quite lucky, that I found some references to a library called SIL, though IDA Pro. ( http://achurch.org/SIL/ )
So download that library, go into the tools folder and run "make".
Windows people will probably need cygwin to do that, I will not provide a tutorial for that here (and please don't pm me about that subject), there are enought tutorials on the internet.
Mac Users need XCode installed.
You probably need to install some dependencies, the log will tell you. You do not need to build everything, just make sure that these tools are build probably: extract-pkg, build-pkg and pngtotex.
You can now extract the ftl.dat using extract-pkg. and upon writing a control file (see comments in the build-pkg.c file) also generate new ftl.dat files.
3.
The folder structure of the ftl.dat is the same as for data.dat and resource.dat. It contains fonts, data, audio and img, but also atlas, which brings us to the next point:
4.
The images are saved in a different format. Instead of .png, .tex is used.
Those .tex files are not any really known format (like dds or similar texture formats), but a custom format of SIL. You can generate your own texture files out of png files with pngtotex.
Some notes: Most textures on the iPad are saved with the -bgra flag of pngtotex. However that does not seem to make a huge performance difference, you do not need to set that flag, when converting textures. Some however are saved in PVR(TC), which is a lossy mobile format. It is mostly used for huge background textures and makes a significant performance difference. However PVR(TC) textures do not look very good (no clear edges and stuff), so you do not wanna use that for everything else then backgrounds.
After converting you can just replace the .tex files of the ftl.dat contents, before repacking and you will see your new image in-game.
5. the atlas folder contains even more wired textures.
It contains so called sprite sheets (google it) of some textures, also to save performance. You can however just delete a sprite sheet and place the images, that were contained in the sprite sheet, separately in the img folder at the normal paths. The iPad will fallback to the old paths, when no sprite sheets are found, which brings me to point 6:
6. There is no need to grab the original ftl.dat, if you got the game on your pc/mac.
You can just convert all .png textures (better create a small bash script for that) and pack the whole thing as ftl.dat and it will work! You will have a worse performance, then with the original files, because you are not using sprite sheets and probably also no PVR textures, but it works and is nice for testing.
7. To get your ftl.dat on the device simply use iFunBox. (or whatever you prefer)
Sounds like modding on the iPad is very easy, just patch all textures and repack everything, right? No its not:
1. Recreating the atlas files most be done manually by re-creating the sprite sheets out of the original textures. That means, if you just want to modify one file in the whole sprite sheet you need to rebuild the entire thing (actually that means you are distributing original game assets, when uploading your modified sprite sheet somewhere). And you should be interested in rebuilding the sprite sheets for peoples battery and those iPad 2 and mini owners, who might have lags otherwise.
2. Mods may very easily crash the game. Already modifing the main_base2.tex file in the img/ipad/main_menus folder might crash the main menu, if the format is not 4:3.
Some other image files also cause the game to crash upon loading. It seems that mostly backgrounds in 16:9/16:10 format are causing this, and need to have 4:3 counterparts in the ipad subfolder of the img folder.
But although I have already patched all backgrounds I still cannot get the captains edition mod to work, neither I could get better backgrounds to work. Somebody needs to test that file by file to figure out, what the iPad version accepts and all incompatible mods need to be patched to work correctly.
But some ship modifications are working nicely out of the box.
I have not the time and motivation to figure out, why the iPad version is still not loading the captains edition correctly, but I wanted to provide you guys the tools, so somebody else may figure out all that stuff.
Now feel free to discuss and try everything out. I will try to help everybody, as good as I can, but do not expect me to set up your modding environment.

- Drakulix