47
« Last post by FyberOptic on October 05, 2012, 12:40:24 am »
Thought I'd make a topic about FTL since I've been reversing the crap out of it. I'll drop in the prof.sav file format first, which is normally at My Documents\My Games\FasterThanLight\prof.sav:
int - 0x00000004
int - number of achievements to follow
achievements[]:
- int - ID string length
- char[] - achievement ID string
- int - difficulty achieved on (0 for easy, 1 for normal)
int[9] - unlocked ships (1 for unlocked)
int[3] - unlocks for unused ship slots???
int - number of top score entries to follow
score_entries[]:
- int - ship name length
- char[] - ship name string
- int - ship type ID string length
- char[] - ship type ID string
- int - score
- int - sector
- int - victory (1 if yes)
- int - difficulty (0 normal, 1 easy)
int - number of ship best entries to follow
ship_best_entries[] - same format as score_entries
int - Most Ships Defeated
int - Total Ships Defeated
int - Most Beacons Explored
int - Total Beacons Explored
int - Most Scrap Collected
int - Total Scrap Collected
int - Most Hired Crew
int - Total Hired Crew
int - Total Games Played
int - Total Victories
crew_records[5]: (Most Repaired, Most Combat Kills, Most Piloted Evasions, Most Jumps Survived, Most Skill Masteries)
- int - skill value
- int - crewman's name length
- char[] - crewman's name
- int - race ID string length
- char[] - race ID string
- int - ??? difficulty? (usually 1)
I figured out basically 99% of it, which should be enough to edit or even recreate. If you're just looking to cheat (like I was!) then you'll need a list of the achievements IDs to add, which are as follows:
ACH_SECTOR_5
ACH_SECTOR_8
ACH_WIN_EASY
ACH_WIN_NORMAL
ACH_UNLOCK_ALL
ACH_SCRAP
ACH_SHIPS
ACH_NO_UPGRADES
ACH_PACIFIST
ACH_NO_REPAIR
ACH_NO_MISSILES
ACH_NO_DRONES
ACH_NO_BUYING
ACH_NO_DEATH
ACH_BURNING
ACH_BAD_DODGING
ACH_ONE_VOLLEY
ACH_BOARDING_DRONE
ACH_INVADE_SHIP
ACH_SLICE_DICE
ACH_SUFFOCATE
ACH_UNITED_FEDERATION
ACH_FULL_ARSENAL
ACH_TOUGH_SHIP
ACH_ENERGY_SHIELDS
ACH_ENERGY_POWER
ACH_ENERGY_MANPOWER
ACH_STEALTH_DESTROY
ACH_STEALTH_AVOID
ACH_STEALTH_TACTICAL
ACH_ROBOTIC
ACH_ONLY_DRONES
ACH_IONED
ACH_ROCK_FIRE
ACH_ROCK_MISSILES
ACH_ROCK_CRYSTAL
ACH_MANTIS_CREW_DEAD
ACH_MANTIS_SLAUGHTER
ACH_MANTIS_SURVIVOR
ACH_SLUG_VISION
ACH_SLUG_NEBULA
ACH_SLUG_BIO
ACH_FED_PATIENCE
ACH_FED_DIPLOMACY
ACH_FED_UPGRADE
ACH_CRYSTAL_SHARD
ACH_CRYSTAL_LOCKDOWN
ACH_CRYSTAL_CLASH
If you want a more detailed explanation of each, look at data/achievements.xml file, which is embedded in the resource/data.dat file, to which I'll also post the format of:
Header:
int - number of file offset entries
int[] - file offset entries
File Entries:
int - file content size
int - filename length
char[] - filename (no null terminator; usually contains Linux-style pathnames also)
char[] - file content
The resource/resource.dat file uses the same format.
I guess I should also mention that an "int" is always a 32-bit signed value in the above. I didn't conclude that ALL of them are signed, but I know for a fact that some (like your amount of scrap) are, to which I assume the developer probably used that quite often.