Reset After Death

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

DovahClown
Posts: 20
Joined: Sun Dec 08, 2019 10:51 am

Reset After Death

Post by DovahClown »

Currently if you die, you press the spacebar and you reload the last save. I think there should be an option to restart instead. Yes, you could warp to the current map or don't save at all, but I feel there should be an option in the settings that allows you to choose whether you want to reload from last save upon death or restart the map. There are many features I find GZDoom has that is a significant improvement over the original DOS version, but there are also feel there are features in the DOS version that was done perfectly. Restarting the map and losing all equipment as a punishment for dying was one feature DOS did perfectly. It made me want to avoid death at all costs so I could take my equipment to the next level. I only used saving for when I wanted to stop playing for the day or had to do something. There is a mod that allows you to do a pistol start, but it doesn't affect the death restart mechanic at all. It just makes it so you only have a pistol at the start of each level. I want to keep my equipment when I go to the next level and lose it if I die. That mod did the reverse of what I wanted. Any chance this can be added as an option?
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: Reset After Death

Post by m8f »

Just noting that this probably could be done in a mod. It would consist of two main parts:
1. A script that toggles a user cvar according to current dead/alive status.
2. Assignable key that checks that cvar and calls "map *" or "+use" ("-use" must be accounted here, too).

Or, maybe just binding "map *" to a key in console would suffice:

Code: Select all

bind X "map *"
and hit that key instead of space after death.

Anyway, I wouldn't hold high hopes for this option to be added to the engine. It's up to engine devs, of course.
DovahClown
Posts: 20
Joined: Sun Dec 08, 2019 10:51 am

Re: Reset After Death

Post by DovahClown »

m8f wrote:Just noting that this probably could be done in a mod. It would consist of two main parts:
1. A script that toggles a user cvar according to current dead/alive status.
2. Assignable key that checks that cvar and calls "map *" or "+use" ("-use" must be accounted here, too).

Or, maybe just binding "map *" to a key in console would suffice:

Code: Select all

bind X "map *"
and hit that key instead of space after death.

Anyway, I wouldn't hold high hopes for this option to be added to the engine. It's up to engine devs, of course.
I hope the devs add it, but in the meantime I will take your suggestion on binding.
Edit: Only issue I found with Map * is the PAR time Counter is reset after using it. PAR times have never been a big deal, but it would still be better if there was a mod that could enable restart after death or if the devs put it in the engine.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Reset After Death

Post by Matt »

This does seem like the sort of very well known, intentional original behaviour that doesn't get in the way of any other stuff (rendering, etc.) that seems like GZDoom should support natively without requiring the user to load third-party software... half the time I'm even reminded to think about this I'm not 100% sure it isn't an option already.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Reset After Death

Post by Apeirogon »

Gzdoom autosaves at the beginning of the each level, except first, so you could just load last autosave. If you dont turn it off of course.
DovahClown
Posts: 20
Joined: Sun Dec 08, 2019 10:51 am

Re: Reset After Death

Post by DovahClown »

Apeirogon wrote:Gzdoom autosaves at the beginning of the each level, except first, so you could just load last autosave. If you dont turn it off of course.
Load last autosave is the issue. I want the ability to autosave or manual without it using that save when I die. Say i have a shotgun, a pistol, and 100 armor in E4M1. Then I beat that level and move on to E4M2. I still have the pistol, shotgun, and 100 armor. Then I die and restart E4M2 with no armor, no shotgun, and only a pistol. That's what I want GZDoom to do.

Edit: The only thing I've been able to find is to turn off auto saves and then make a manual save when I'm done playing for the day, then delete it right after loading up. That seems to be the only way to avoid reloading after death and have correct PAR Times.

Edit Edit: Nevermind. PAR Times are incorrect even with the "Save, Load, Delete Save" Method. It seems the only way to get correct PAR Times is to allow the game to load from the last save upon death. I was never big into PAR times anyway. I'll just use the "Bind X map *" that was suggested instead. Even if the DEVs don't implement my suggestion, this is still the best source port. It puts all Bethesda's official Ports to shame. Even their new Unity Port isn't nearly as good as GZDoom.
PKr
Posts: 3
Joined: Wed Feb 02, 2022 4:49 pm

Re: Reset After Death

Post by PKr »

May I ask someone knowledgeable what exactly is the issue with pistol start support and why it cannot be added to GZDoom?

I am looking at g_game.cpp in GZDoom 4.7.1 right now:

Code: Select all

void FLevelLocals::DoReborn (int playernum, bool freshbot)
{
	if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
		!G_SkillProperty(SKILLP_PlayerRespawn))
	{
		if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()))
		{ // Load game from the last point it was saved
			savename = BackupSaveName;
			gameaction = ga_autoloadgame;
		}
		else
		{ // Reload the level from scratch
			bool indemo = demoplayback;
			BackupSaveName = "";
			G_InitNew (MapName, false);
			demoplayback = indemo;
		}
	}
Why exactly can't this solution work?

if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()) && Options.getSomeNewRandomCvar() == 0)
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}

For example... I've added

Code: Select all

CVAR(Bool, pistolstartafterdeath, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
doommenu.cpp

and changed g_game.cpp to

Code: Select all

//
// G_DoReborn
//
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
EXTERN_CVAR(Bool, pistolstartafterdeath)
void FLevelLocals::DoReborn (int playernum, bool freshbot)
{
	if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
		!G_SkillProperty(SKILLP_PlayerRespawn))
	{
		if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()) && !pistolstartafterdeath)
		{ // Load game from the last point it was saved
			savename = BackupSaveName;
			gameaction = ga_autoloadgame;
		}
...and everything works perfectly? And if I'll ever play mods/wads which would require to start the game from the save file, I would just set pistolstartafterdeath to 0.

I am not a coder, so please explain what's wrong with this solution?
Post Reply

Return to “Feature Suggestions [GZDoom]”