Space Engineers

Space Engineers

Not enough ratings
Death Penalty (Resurrection Sickness) with Multiplayer
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Block, Script, Other
File Size
Posted
Updated
94.566 KB
22 Jul, 2017 @ 8:57am
5 May, 2021 @ 1:17pm
20 Change Notes ( view )

Subscribe to download
Death Penalty (Resurrection Sickness) with Multiplayer

Description
This mod adds a penalty system for dying. It's not meant to make the game easier, but harder.
Each time you die, your max health gets capped at a lower amount.

Single Player: supported
Multi Player: supported (Limited testing completed)
Dedicated Server: supported (Limited testing completed)
Other Mods: no issues reported

Last SE version tested: 1.190.008 (Single Player 1.197.075)


I created this mod because once you have a Medical Room, there's no penalty for dying. If you're low on oxygen, you could just kill yourself and replenish it that way.

Details:
Each time you die, you get a penalty point. Your max health is (penalty ^ factor). By default this is
1 death - 75 health
2 deaths - 56 health
3 deaths - 42 health

Every 10 minutes without dying you will recover 1 penalty point.

This mod is configurable. Once you have loaded a game with it, look in SpaceEngineers/storage/1086167149.sbm_DeathPentalty/sickness.cfg. Config file contains details about each setting.

Commands:
• /sick - to get your current stats and remaining sickness time
• /sick all - As admin to get stats for all players
• /sick ver - to display the current version

Config File:
Parameter
Default
Range
Description
penalty.factor
0.75
0.0 to 1.0 (float)
Max health is penalty ^ factor * 100
penalty.recovery
600
60* - (int)
Number of seconds - without dying - to recover a penalty point. Precision of about 1 second.
penalty.maxPenalty
0
0 - (int)
Maximum penalty score. 0 for unlimited.
penalty.enabled
True
True | False (bool)
Enable Penalty (If False, only disables the health cap).
respawn.oxygen
1.0
0.0 - 1.0(float)
Initial oxygen level when respawning**.
respawn.hydrogen
1.0
0.0 - 1.0(float)
Initial hydrogen level when respawning**.
respawn.energy
1.0
0.0 - 1.0(float)
Initial energy level when respawning**.
vanilla.heal.rate
1.0
0.0 - ?(float)
Vanilla heal rate multiplier. If auto healing is enabled.
vanilla.heal.cap
0.7
0.0 - 1.0 (float)
Vanilla auto healing cap. If auto healing is enabled.
mod.logLevel
info
trace - crit (string)
Log level to use {crit, error, warn, info, debug, trace}.
*It takes about 10 seconds just to respawn. You can set a recovery value of less than 60 seconds, but It really doesn't make sense.
**Care should be used with setting these values to zero, as characters could be quickly killed or be permanently stuck.

A bunch of credit goes to Death Counter, as this is how I was able to learn a huge chunk of the required logic.

This mod can probably be paired well with the Transporter Mod since you can no longer just kill yourself to "teleport" to other Medical Rooms.

BUGS:
• Loading an automated backup of a game will not revert the penalty states. This is a limitation of SpaceEngineers.
• After a penalty point is recovered, indicates "resurrection sickness subsides", even if still sick (incorrect message).
• System.IndexOutOfRangeException reported during startup. Possibly fixed; synchronization issue, hard to verify.
• Natural heal rate seem to be too fast after first death.
• Medkits don't seem to be usable when sick ("Can't consume More" message)
• Medkits reported to cause game crash when "sick".


Recent Fixes
• Fixed incorrect heal rate (Was WAY too fast). (2021-01-26).
• Possible fix for System.IndexOutOfRangeException (2021-05-05).
32 Comments
CynicDragon 4 Oct, 2024 @ 11:57pm 
Please make this compatible with eat/sleep, sending motivation your way
Spiros 28 Aug, 2024 @ 8:33pm 
shoot, I thought this may be good to use with "Eat. Drink. Sleep. Repeat!" to prevent players from backspacing all the time
Borgie  [author] 13 Jun, 2023 @ 7:22am 
Thanks for sharing the stack trace.
That trace looks like it might be coming from the "Eat. Drink. Sleep. Repeat!" mod. (DrinkWater is not part of vanilla)

It's always possible that there's a compatibility issue between the two mods, unfortunately I've really not had time to work on this mod in quite some time.
Into 12 Jun, 2023 @ 4:06am 
Exception occurred: System.NullReferenceException: Object reference not set to an instance of an object.
at DrinkWater.MyStatPlayerFood.Update()
at Sandbox.Game.GUI.MyHudStatManager.Update()
at Sandbox.Game.Gui.MyHud.UpdateBeforeSimulation()
at Sandbox.Game.World.MySession.UpdateComponents()
at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)
at Sandbox.MySandboxGame.Update()
at Sandbox.Engine.Platform.Game.UpdateInternal()
at Sandbox.Engine.Platform.Game.RunSingleFrame()
at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass11_0.<Run>b__0()
at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
at Sandbox.Engine.Platform.Game.RunLoop()
at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
at SpaceEngineers.MyProgram.Main(String[] args)
at avaness.SpaceEngineersLauncher.Program.StartSpaceEngineers(String[] args)
at avaness.SpaceEngineersLauncher.Program.Main(String[] args)
Into 9 Jun, 2023 @ 8:31am 
It seems it is linked to server instabilities I am experiencing. Every time someone respawns, for whatever reason, the server crashes.
Fredrik Metcalf 19 Jan, 2023 @ 1:03am 
I like this. Seems death is completely pointless in vanilla.
Borgie  [author] 11 Sep, 2022 @ 11:29am 
Yes, medkits and heal-rate seem to be off currently. I'll have to look into this further when I have some time.
I've not encountered any crashes though, at least in single-player.
K.Hunter 1 Sep, 2022 @ 8:57am 
A somewhat important problem I have with the mod is that if you attempt to use a medkit item while the health penalty is in effect, you will get a game crash. Is that something that can get fixed, so that you can still use them but will end up not getting more health than what you're capped to, and of course without having any crashes? :)
Borgie  [author] 8 Jun, 2022 @ 4:28pm 
I don't know that it's out of the scope, but I'm not sure of how I'd implement that. I'm assuming the player would be stuck in the state of "dead" until the cooldown ends. I guess you could just insta-kill any player who respawns too soon.
Fimbultul 2 Jun, 2022 @ 4:56am 
Is it possible to add an respawn cooldown, or is that out of scope of this mod?