Author Topic: Faster Than Light  (Read 5404 times)

FyberOptic

  • King of Earth
  • Administrator
  • Hero Member
  • *****
  • Posts: 2522
  • Oh god what is that?
    • Fybertech.com
Faster Than Light
« 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:

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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.
« Last Edit: October 05, 2012, 01:04:03 am by FyberOptic »

FyberOptic

  • King of Earth
  • Administrator
  • Hero Member
  • *****
  • Posts: 2522
  • Oh god what is that?
    • Fybertech.com
Re: Faster Than Light
« Reply #1 on: October 05, 2012, 11:39:47 pm »
I've been working on deciphering the continue.sav file, but it's slow-going.  There's obviously way more to keep track of in a save game than in a simple game config file.  But I figured out quite a bit, from the crew format, to energy levels, even the room damage and doors.

I took advantage of that in whipping the flagship.