Logo135.png We're building a new wiki, so information on this page may be out of date.

We'd love for you to help us out!

Save Deletion

From SourceRuns
Jump to: navigation, search
Save Deletion
Discoverer(s) Old Method by UnrealCanine

New Method for Pre-Steampipe by 2838
Games Half-Life 2

Half-Life 2: Episode One
Half-Life 2: Episode Two
Portal
Portal 2

Engine OrangeBox Engine

2004 Engine

Save Deletion is a Glitch available to most versions of the OrangeBox Engine and only to version 4044 of the Source Engine 2006. It is also present on the newer 2011 version of the Engine, which Portal 2 uses. It is used to replenish health, ammo and required vehicles or items to continue with the game. This trick is similar to doing the "map" or "restart" command in the console.

How to

Old Method

This is the original way to do Save Deletion and is also the reason for its namesake.

When entering a map, do 2 saves, then go to the menu and delete your very last save. Now simply resume the game and press your 'reload' bind or kill yourself by jumping off from high ground of intentionally being killed by enemies or trains to respawn.

Chapter selecting

A close and glitchless version of Save Deletion, when entering the first map of any chapter, you can restart that chapter through the New Game menu to regain your health and ammo.

New Methods

Instructions vary between games and mods running on the Pre-Steampipe and the Post-Steampipe versions of the Source Engine. These can't be used interchangeably.

Pre-Steampipe

First make a save with an extremely long name, preferably over 200 characters. Then simply do the reload command.

Post-Steampipe

Like before, make a save but with a single colon as its name. Then simply do the reload command.

Executing in runs

You can automate this action by binding a key to the command save <appropriate save name for your method of choice>;reload (note that with the pre-Steampipe save name you should stop at around 210 characters to avoid hitting the command limit and leave room for the reload bind).
To optimally do a Save Delete in runs, when entering the map you wish to Save Delete on, Save/Load once (twice if once doesn't work) and then press your Save Deletion bind.

Explanation

This glitch boils down to 2 things: How Valve load save games and how maps are made.

Why am I at the start of the map?

Old method

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.

New methods

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.

Pre-Steampipe

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.

Where did these items come from?

Weapons, health and HEV suit given to you when doing a Save Deletion on d1_canals_11. These items only spawn on New Game, which is essentially when you do a Save Delete.

In the game, every map is equipped with "newgame" spawners which spawns entities when the map is loaded fresh. Those entities could be health, energy, weapons and especially vehicles or items required to continue progressing through the game.
These "newgame" spawners were placed for testing out maps. Because of this, when you do a Save Delete you will most likely be put at the beginning of the map with appropriate weapons and vehicles or items that a player should have when reaching the map when playing the game casually.
This can be seen in the Water Hazard chapter of Half-Life 2 as Save Deleting on any of the maps in the chapter will result with the airboat also spawning in with you. The same could be seen in chapters Highway 17 and parts of Sandtraps in Half-Life 2.

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.




Personal tools