I think I can help shed some light on the crew section of the save file.
And just to illustrate, I went and started a new game. Say hello to my crew (or at least Phillips, since it is him we will be playing with):
After this I saved and quit, and this is how the save file looks in a hex editor (do not try editing it in any kind of plain text editor!)
The interesting part is highlighted in red.
Now, you may notice that the crew is listed above my highlight, but as far as I can tell this is just a list of how the ship was equipped at the start of the game, and does not actually do anything - but I could of course be wrong.
In any case, the data for our dear crewmember Phillips (or Chris Phillips as is his full name) starts at the "0E" at the top of my red box - or rather at the "0E 00 00 00". This is a 32 bit integer in little-endian format, it basically means "14", and it is the length of his name - which, as you can see is the next field.
If you want to change his name, you MUST (!!!) change the length to match, or the game cannot read the save and it will freeze on load. Same thing applies to the race pair for that matter.
But first let me dump a small table here:
Code: Select all
Int32 Length of name
Int32 Length of race
Int32 0000 0000 ? - No idea what this does
Int32 X coordinate
Int32 Y coordinate
Int32 Room tile (0-3)
Int32 0100 0000 ? - No idea what this does
Int32 Piloting (0-30)
Int32 Engines (0-30)
Int32 Shields (0-110)
Int32 Weapons (0-130)
Int32 Repair (0-36)
Int32 Combat (0-16)
Int32 Gender (0 = female, 1 = male)
Int32 Stat repairs
Int32 Stat combat kills
Int32 Stat piloted evasions
Int32 Stat jumps survived
Int32 Stat skill masteries
This basically describes the entire chunk.
I think the easiest way to explain it is to show an edit, so here is what I did to our man Phillips:
So, what has happened? Well, to take it from the top; first I changed the length of his race from "05 00 00 00" to "06 00 00 00" to compensate for me changing his race from "human" (5 characters) to "mantis" (6 characters) - note that I made sure to insert an extra character in the file instead of overwriting one of the "00"s. This also means that everything after has been shifted one spot if you compare with the before image.
Then after changing his race, I went and moved him away from his former human buddies. This meant skipping past the mystery "00 00 00 00" (every crew member I have ever seen has had a 0 here, so ??), and the "64 00 00 00" which is hex for "100 health on this guy". This leaves us at the "FB 01 00 00" (507 in decimal) which is his X coordinate on the ship, followed by the "C0 00 00 00" (192) which is the Y coordinate.
Now, I want to move him to the top left corner of the med bay, which is 6 squares left and 2 up from the current position, which means that we have to move him 210 pixels left and 70 up (somebody found out here: http://www.ftlgame.com/forum/viewtopic.php?f=4&t=2190
that each square is 35x35 pixels). So I need to move him to 297x122 (507 - 210 = 297, 192 - 70 = 122), which in hex is "29 01 00 00" and "74 00 00 00".
But that is not enough (at least I don't think so, haven't tried it yet). The next two ints are the room number and the room tile number. For the first I unpacked the "data.dat" and looked in "kestral.txt" which gives the room layout for the Kestral ship I'm using - long story short; the helm is room 0 and the med bay is 4, so that int was changed from "00 00 00 00" to "04 00 00 00".
The next one is easier: Top left square is 0, top right is 1, bottom left is 2 and bottom right is 3 - basically the order they naturally fill up a room, ignoring any computer terminals. Here Phillips is going from position 1 in the helm to position 0 in the med bay.
Ok, once that we are done mutating and moving the guy it is time to be nice to him. We skip another mystery int - this one is "01 00 00 00" for all the crew I have seen, so no idea what it does. But then we get to the skills, this is basically a row of 6 ints detailing your skills in order. They were all 0, but I decided to just max them all just for fun. As my table shows, the max values are 30, 30, 110, 130, 36, and 16 - which in hex turn into; 1E, 1E, 6E, 82, 24, and 10 (they still take four pairs each in the save file, so "1E 00 00 00" etc.).
So after all that, how does it look like when I load my mutilated save? Why, like this (wave for the camera Phillips
Anyway, that was all for now. Feel free to ask questions, but no guarantees that I can answer them.