todo: history
Save Deletion is a glitch in Half-Life 2 based games which allows the player to force the game to restart the map they're currently on, as if it was loaded from the console, by reloading a save that doesn't exist.
Over the years, SD has been subject to a lot of controversy due to its execution and it technically "breaking" the flow of the run.
There are multiple ways of performing it, some more legitimate than others.
The "Legit" method for Save Deletion was originally discovered by UnrealCanine.
Later on, 2838 has managed to perform a save delete by utilizing a very long name, discovering the "Barely-Legit" method, which was quickly adopted, as it was faster and more convinient to perform.
In 2022, a conversation has sprung up regarding Save Deletion on Linuxnative builds on the game, and 2838 has proposed that save "";reload
may work. However, no one has actually tried to perform SD using this method until 2024, when peng found out that it does work, and it works on every build, on every OS. This included Source 2004, where SD was thought to be impossible.
Upon Entering the map you want to save delete on, simply saveload with a save that is NOT an quicksave.
After that, go into the game menu, and delete the saveload save.
Lastly, die. Explosives and fall damage are good for this.
This method does not work in Source 2004.
No saves can happen between the saveload, and the death. THIS INCLUDES AUTOSAVES. most maps in valve games autosave a second or two after entering them. This needs to be kept in mind, as SD won't work if the autosave happens after the sl.
Once again, Saveload upon entering the map, and be careful with autosaves.
However, instead of dying, execute the reload
command in the console.
This command is usually executed when the player dies, and this skips that step.
This method does not work in Source 2004.
This method is generally refered to as "Quick Save Deletion."
Upon entering a map, Once again, Saveload, and then execute one of these binds, depending on your OS and Game Version. The game will not be able to find the save, due to its name and a save delete will occur:
Linux / Mac Wine | Windows | XBOX | Linux / Mac Native | |
---|---|---|---|---|
Source 2004 | Global Method* | Global Method* | - | - |
Pre-Steampipe | Long Name Method* | Long Name Method* | "save CON;reload" |
- |
Post-Steampipe | "save CON;reload" |
"save :;reload" |
- | Global Method* |
The long name method wasn't included in the table above due to it's lenght. It looks like this:
"save aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaretrhtgxfhtfgdxhtgfhrdtghfrtfgrhthrfgthrfawwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwgrtdfrgdftdddddddddddddddddddddddddddddddddeetret4rtrfhthfrthrfaaaaaaaaaaaaaaaaaaaaaaaaaaa;reload"
The actual characters don't matter, only the length.
The global method works on every version, on every OS, however, it requires the use of the "exec" command, and creating a CFG file, so its usually not recommended.
First, create sd.cfg
in the cfg
directory of your game. For Half-Life 2, it's located in Half-Life 2/hl2/cfg
.
Open it with a text editor, and inside of it put save "";reload
.
Now, in game bind exec sd
to a key.
This method is known to not work on some setups with some versions, but the cause of that is currently unknown.
This glitch boils down to 2 things: How Valve load save games and how maps are made.
The reload command's function is to load the current or most recent save made by the player. But if it is deleted or doesn't exist, the game will restart the current map instead.
// See if there is a most recently saved game
// Restart that game if there is
// Otherwise, restart the starting game map
Note left by the developers.
pSaveName = saverestore->FindRecentSave( name, sizeof( name ) );
if ( pSaveName && saverestore->SaveFileExists( pSaveName ) )
{
HostState_LoadGame( pSaveName, remember_location );
}
else
{
HostState_NewGame( host_map.GetString(), remember_location, false );
}
Some relevant code, pSaveName returns as false in the if() function if the save is deleted or doesn't exist.
Using the new methods avoids losing time to bad menuing or random freezes when opening the menu due to your PC as it can be simply done from a simple key press.
The new methods abuses how the Windows file system works and how Valve tracks the player's current save name.
Once you make a save, the name for that save is saved in m_szMostRecentSaveLoadGame
//-----------------------------------------------------------------------------
// Purpose: Remebers the most recent save game
//-----------------------------------------------------------------------------
void CSaveRestore::SetMostRecentSaveGame( const char *pSaveName )
{
if ( pSaveName )
{
Q_strncpy( m_szMostRecentSaveLoadGame, pSaveName, sizeof(m_szMostRecentSaveLoadGame) );
}
Some relevant code.
However, the name itself in the game has a character limit of 260 characters. This leads into problems with how Windows indexes and stores files. Windows' file system only allows for file paths up to 260 characters long by default, so any save file with an extremely long name would always be shortened to make room for the file path.
Save's name in the game aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...(219 a's later)...aaaaaaaaaa
Save's path in Windows D:/Half-Life 2/hl2/SAVE/aaaaaaa...(219 a's later)...aaaaaaaaaa
Save's actual name aaaaaaa...(219 a's later)...aaaaaaaaaa
________________________
24 characters are missing from original save name.
Because of this, the save file's real name would differ from its actual name in the operating system and the game won't be able to find it. In this case, the save if() operation would fail like above in the Old Method, triggering the fail safe and effectively doing a Save Delete.
Post-Steampipe
For Post-Steampipe, it is still unknown to why the Pre-Steampipe method would not load the game correctly and why the colon method only works on Post-Steampipe; however it is most likely due to how it stores saves' names and how it load saves.
The global method works by simply having the game be the one to fail create the save, as opposed to the filesystem or the operating system. save ""
results in the game trying to create a save with no name, and it fails.
However this trick will not help you in games that do not have "newgame" spawners and you will only spawn with no weapons or the suit. This can be seen when you Save Delete on the map "d2_prison_05" of Half-Life 2.