Teleglitch: Die More Edition

Teleglitch: Die More Edition

Not enough ratings
Exploring the exitsave file
By Tuttles
A look through the structure of the exitsave file to better understand your run, and gain some insights to how this rust bucket of a game was coded
   
Award
Favorite
Favorited
Unfavorite
Forward
Everything here I discovered by looking at the exitsave file periodically throughout multiple playthroughs. This meant doing some runs with the express goal to do or get one thing more than another thing to determine which entry they're tied to. Some of this could have been figured out faster by looking at certain lua files. I also do not know how the game knows to look for an exitsave file, how it remembers your permanent stats, or what stats 0, 1, 23, 25, or 26 are for... so if you've figured these out let me know and I'll update the guide!
File Location
Getting The File
When you finish a level, you'll have the option to Save and Exit. Doing this will kick you to the Main Menu and generate a save file so that you can safely close the game and continue your run some other time. (You could also press Continue or start a New Game right away, which will delete the file you just made)

File Location
The exitsave file is saved in Steam's userdata folder for Teleglitch.
steam/userdata/<your_UserID>/234390/remote/

Now that you have a file, you can take a look at your run so far in more detail.

Caution: Launching the game will likely delete this file immediately, even if you do not load into your save or start a new run. Do not launch if you aren't 100% sure you can play

It's as if the file is loaded into ram and deleted from disk upon launch, but since the file can only be created by completing a level, this little quirk happens.
Level, Inventory, and Ammo sections
Level
The first line will be the next level of your run.
level2
If there were multiple teleporters to choose from, you may instead see the 'b' level
level2b

Inventory
The inventory section will be 20 lines in the order of your 20 inventory slots in-game.
Each entry will have the format of: Quantity in Stack, Item Name, and Ammo Loaded in Magazine
1 pystol 15
Important or rare items can only have a quantity (or 'stack') of 1 per inventory slot, but more common items such as consumables or crafting items can have stacks of 2 or more.
Items that do not have magazines such as one-time-use weapons, consumables, or crafting items will always have an Ammo Loaded of 0.

Empty slots in your inventory will be represented with a null entry
0 --- 0

The names of items will be different than how they appear in-game. That's because English is not the developers' primary language, but the language is close enough to figure it out with context. If you cannot figure out what a name is supposed to translate to in-game, search for it in the relvad.lua file (located in steamapps\common\TeleglitchDME\lua) and look at the "invtext" entry for that item. The game is almost entirely lua scripts, so the .lua files in general are also worth a look through to correct the many spelling mistakes that appear through out the game in terminal messages, item descriptions, post level monologues, etc. It's also possible to localize the game this way, but this "hard coded" string style makes it much more labor intensive than if it used dynamic language project files or something.

Ammo
Self explanatory structure: ammo type followed by how much of it you have. This information is hidden in-game unless you're actively holding a weapon, then you can see that weapon's ammo pool. So the only way to see your entire ammo stock is to have at least one weapon for every ammo type! Afaik, there is no hardcoded limit to how much ammo you can have here, but given that there's a fixed amount of loot and enemies (with % chance to drop loot) for each level, and you're also probably using said ammo, you're never going to find an entry higher than a few hundred. Unless you really like crafting nailammo and never using it...

Entry
Ammo Type
ammo0
mg bullets
ammo1
sshells
ammo10
cannonrnds
ammo2
9mmclip
ammo3
rifleammo
ammo4
nailammo
ammo5
battery
ammo6
hvel bullts
ammo7
expgrenades
ammo8
?unused?
ammo9
revammo
armor
armor health points (max 100). Not to be confused with the armor healing item
Wait....why is the armor entry lumped in with ammo??

Well, the next section, Achievement Qualifiers has the health entry right after it.
Looks like when they added achievements to the game, they misplaced the section's write out by one line and split the health section in two! D'oh
Stats sections
Special Achievement Qualifier Trackers
These are special trackers needed to know if you qualify for an achievement, but weren't stats previously tracked for the Game Over screen (see next section). Some of these entries will not be in your file if you haven't done that action yet, but if they are they will always be in this order.

g_framesunderinfluence
Frames spent with Stimulant active (game is 30 fps). Only appears if you've used stim
g_frameswithoutspeed
Frames spent without stim. These two entries were needed for Speedfreak
g_frombeginning 1
A flag that only appears if you started on Level 1. Needed for The Master Survivor
g_playerdamaged 1
A flag that only appears if you've received damage. Needed for The Untouchable
g_secretsgenerated
Needed in conjunction with the Secrets Found stat for The Attention Master
g_stimulanttimer
Frames of stim buff left. Will be -1 when buff has finished. Will be 0 if never stimmed
g_teleporterused 1
A flag that only appears if you've consumed a teleport item. Needed for The Hardcore Survivor

g_stimulanttimer is interesting because it's not really needed for an achievement to work. I guess it's a QOL feature to ensure that stim doesn't end prematurely between levels if you save and exit, which more people would be experiencing when going after the achievement. The stat counting down to -1 sort of explains why each 120 second stim activation always counts as 3601 frames instead of 3600 for g_framesunderinfluence....game must be counting 0 as an extra frame of buff.

Health
health
It's your health....max 150

Stats
Stats needed for the Game Over Screen. There's 5 that I haven't figured out yet, any insights would be appreciated! I have seen references to 4 enemies not reflected below: a second Green zombie entry, Sponge (or slow brown mutant), Jumping Spider (or Jumping Mutant), and Dummy. Dummy is only in the tutorial. The tutorial also includes another special enemy, a shooting target which seems to be a door, and a reference to a 'skeleton' that I have not seen referenced anywhere yet. So that's 6, so excluding the tutorial-only enemies that leaves one completely unused enemy?

stat0
unknown, always been 0 for me
stat1
unknown, always been 0 for me
stat10
Red Guards killed
stat11
Scientists killed
stat12
War Walkers killed
stat13
Sentry Guns destroyed
stat14
Swarmbots killed
stat15
Blue Walkers killed
stat16
Squids killed
stat17
Destroyers killed
stat18
Welders killed
stat19
Items Combined
stat2
Secrets Found
stat20
shots fired (total). Needed for Accuracy
stat21
shots fired (hit). Needed for Accuracy
stat22
Monsters In Void
stat23
unknown. Have seen large numbers early on that barely increased by later stages. Could be Knife kills, but that's not shown on any stat screen in-game
stat24
Cameras destroyed
stat25
unknown. Have seen small numbers here midway with minor increases by later stages. Thought it might have been teleporters used, but I've had runs where I've consumed a teleporter (flag was tripped) and this stat was still 0
stat26
unknown, always been 0 for me
stat3
Zombies killed
stat4
Slow Zombies killed
stat5
Giant Zombies killed
stat6
Mutants killed
stat7
Big Mutants killed
stat8
Machine Gun Zombies killed
stat9
Guards killed