[phpBB Debug] PHP Warning: in file [ROOT]/ext/paybas/breadcrumbmenu/event/listener.php on line 203: Undefined array key 47 [phpBB Debug] PHP Warning: in file [ROOT]/ext/paybas/breadcrumbmenu/event/listener.php on line 203: Trying to access array offset on value of type null Soft Permadeath v7.1 - "MENUS!" (Now on GitHub) - ZDoom
Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Grab Version 7.1! GitHub Repository Here. Latest build required
Over the last week, I've been working on a permadeath system for ZDoom! Initially I programmed a hard permadeath system that would force you to restart the entire game by killing the player if they loaded a savegame after dying. I won't go into how I did it so no one else attempts this, but after some advice from NeuralStunner, I instead opted for something less destructive: soft permadeath!
The mod now supports customizable permadeath and respawning! For example, if lives are enabled, you have a limited pool of lives. Dying drops one of your lives, which can be recovered if you happen to find your corpse. By default, dropped lives disappear the next time you respawn, but this can also be disabled. Otherwise, you can respawn endlessly. Lives and respawn penalties can be disabled entirely with another CVAR.
Also added is a reward system which can be disabled. Complete a level with no deaths, and you get an extra life! But don't worry, if you beat a level with no lives left, you get one as a consolation prize. Hub based games work a bit differently: you only get an extra life the first time you enter a hub level.
I likely won't take this further since implementing features such as weapons or ammo dropping requires that I support specific games or mods. I do plan on creating a mod that can be loaded on top of this one, however.
Spoiler: Features
Current Features:
Game agnostic! Should work in all ZDoom games.
Partially mod and level agnostic. Some levels and scripts might be broken by this, and I have no idea how well it plays with other mods.
Fully customizable permadeath and respawning options! See the relevant CVARs below.
MENUDEFs for full customization!
Further reward customization! You can now set the number of levels the player must beat without dying before receiving a 1UP, as well as whether or not the player receives a pity life.
// These CVARs are used to keep track of the permadeath system
// Permadeath
// These control the permadeath system
server bool AllowPermadeath = TRUE; // Is permadeath allowed?
server int PlayerDeaths = 0; // How many times has the player died?
// Lives
// These control the lives system
server bool EnableLives = TRUE; // Should there be lives?
server bool DropLives = TRUE; // Should lives be dropped upon death?
server bool EraseDroppedLives = TRUE; // Should dropped lives be erased upon next death?
server int MaxStartingLives = 3; // How many lives does the player start with?
// Punishment
// These control the punishment system
server bool EnablePunishment = TRUE; // Should the player be punished? Overrides lives
server float Punishment1 = 1.0; // Punishment for Very Easy difficulty
server float Punishment2 = 1.0; // Punishment for Easy difficulty
server float Punishment3 = 0.9; // Punishment for Normal difficulty
server float Punishment4 = 0.75; // Punishment for Hard difficulty
server float Punishment5 = 0.5; // Punishment for Very Hard difficulty
// Rewards
server bool EnableRewards = TRUE; // This enables and disables the rewards
server int LevelsUntilReward = 1; // How many levels must be beaten until rewarded?
server bool RewardForNo1Ups = TRUE; // Does the player receive lives if they have none?
Spoiler: Default Punishments
Very Easy & Easy: No punishment. Normal: Health is set to 90% upon respawning. Hard: Health is set to 75% upon respawning. Very Hard: Health is set to 50% upon respawning.
Look for one of these guys near your corpse if lives are enabled!
Spoiler: Lé FAQ
Isn't this really easy to cheat, such as by save scumming?
Absolutely! The point isn't to stop people from doing those things, however, but rather give those that play fair a new way of playing their favorite games or mods.
Why not just play a coop game by yourself?
Because not all maps properly support this feature. The script allows for features that might be hard to do in multiplayer, and coop also forces certain things that might be undesirable, such as extra item or monsters spawns.
Will this work for all mods and maps?
Unfortunately I cannot guarantee that. I used uniquely named scripts and functions where possible, but there will always be conflicts. For example, some mods, such as Hideous Destructor, give the player items when their health reaches a certain point that are not removed upon respawning. Use at your own risk!
Zandronum?
Not likely, at least not for a while. This mod requires cutting edge ZDoom features to function. Quite a few of the features in this mod can be done in a coop game, too!
Is it okay if I use this code in my project?
You betcha! I am releasing this as a public resource, and as a preview of things to come.
Spoiler: Bugs
Known Bugs:
CVARs may interact with each other or affect gameplay in interesting ways.
Mods that define difficulties higher than 4 have no punishments besides the default.
Fixed Bugs:
A known issue is that if you disable permadeath mid level, it won't take effect until the next one. This will be fixed in the next release.
The CVAR that keeps track of player deaths also does not work as intended due to a mistake on my part. Whoops!
Lives are awarded at the start of a new stage regardless of deaths.
Lives counter conflicts with Heretic powerups and will be moved.
Permadeath does not work when traveling between levels in a hub. Whoops!
The respawn marker wouldn't appear under certain circumstances.
On difficulties outside the default range (ie 0 - 4), the player would respawn endlessly.
Obituaries are currently broken.
If the player turns off permadeath mid level, then re-enables it, it won't turn back on until the next level.
Punishments would kill the player instead of respawn them when transitioning to levels past the first.
Last edited by Snarboo on Fri Nov 07, 2014 9:53 pm, edited 25 times in total.
Nice! I like this idea a lot, definitely would like to see this idea bloom. On a related note, how feasible (or, indeed, related to any wizardry here) would it be to add a lives system to zdoom's multiplayer, so I can screw around with mods in co-op without infinite lives? That'd be just lovely.
I'm not sure how feasible lives are in coop. There's no real way to prevent a player from respawning, but one option might be to transform the player into a harmless ghost if they run out of lives. Then again, they could just quit and rejoin to get around that!
Well, Hideous Destructor has a functioning lives system, but I was hoping for something I could use with other mods (namely those that don't work in Zandronum) that I might give death a little more weight, to keep players from just throwing themselves at obstacles blindly. I imagine you'd run into problems when different player classes (as assigned per mod) come into it, maybe. Just wishful thinking on my part, so far.
The mod is actually player class agnostic! :) I use an enter script to give the appropriate power up to the player, then check against that. I also used named scripts, so this shouldn't affect mods with heavy ACS usage too much, but I can't be certain.
IMX wrote:Is it possible to show how many times you died in the intermission screen?
Depends on how deaths are kept track of! If you track it with a [wiki=Classes:ScoreItem]ScoreItem[/wiki], it should be possible to show it both on the HUD and during the intermission. Otherwise I'm not sure if the intermission screen can show ACS variables or CVARs.
Mod has been updated! Check the first post for latest features. :)
Edit:
A quick bugfix release to fix the broken reward system, as well as re-enable Hexen and Strife support, has been released. Be sure to update if you play those games!
Another bugfix release, this version fixes a bug that would cause the player to respawn endlessly when playing on a difficulty outside the defaults (ie 0 - 4), as well as force the respawn marker to appear in cases where it normally wouldn't.
Edit:
This new version allows you to turn on and off the permadeath system at will, and changes how the lives system works so obituaries show properly!
Edit 2:
Quick hotfix released that fixes difficulties below normal being broken. Also added a nice light to the extra lives!
For the next version, I plan on adding CVARs to disable the lives system, rewards system, and possibly even the punishment system! Once those are added, that should be the definitive version assuming no more bugs pop up.
It's not a 'bug', as nothing is *technically* broken, but if you run this with Hideous Destructor, and you die either from bleedout or while bleeding, you'll remain bleeding when you respawn.
There's nothing I can really do about that since that's a specific feature of Hideous Destructor. I'd have to remove the relevant actor that causes the player to bleed upon respawn.
This is a pretty cool idea and I like it. It would go great with scoredoom I think if only scoredoom had a local high score leader board.
My only niggle is that a free life for every level without dying seems like a bit much. I think a 1-up for every 3 levels without dying would seem a bit more balanced.
Yeah, I'm not really sure how to handle the rewards system as of yet, but that's not a bad idea! Might throw in another CVAR for that. :p
New release, this time with a fancy-schmancy options menu!
Edit:
Quickly pushed out another build based on Legend's suggestion! You can now set how many levels you must beat without dying before you receive an extra life. You can also disable the pity life given to you if you have no lives left at the start of a new level. Be sure to redownload if you downloaded the previous build within the last 30 minutes. :)