Space Engineers

Space Engineers

Stamina
51 Comments
Ugga 22 Nov, 2022 @ 3:51pm 
@keyspace We really liked your mod. If you can fix it for DS, we will be very happy. :)
Of course, we understand that when an error is not permanent, it is difficult to find and fix it. I hope there are more players from Dedicated Servers and could help with reports.
keyspace  [author] 22 Nov, 2022 @ 1:27pm 
@Ugga

Thank you for reporting! I suspect it's a bug with the mod itself, but one that I'm not sure how to reproduce. :(
Ugga 15 Nov, 2022 @ 5:19pm 
@keyspace I am a DS administrator. The mod was on the server for 2 days.
On the first day, players began to complain that stamina was not restored to 100% after restoring health.
Everything was OK with me. Stamina was restored.
The next day, my health dropped to 99% from suffocation and did not recover to 100%. Looked at the file. Their stamina froze at 27, 46, 84%...
I disabled the mod until the reasons were clarified so as not to spoil the gameplay.

I assume that this is a mod conflict or a glitch in this mod. No mod other than "Eat. Drink. Sleep. Repeat!" does not affect the change of characteristics of the character after death.
keyspace  [author] 15 Nov, 2022 @ 12:07pm 
@Ugga

I've also just tested with what seems relevant from your mod list - "Eat. Drink. Sleep. Repeat!" (id 2547246713).

"Stamina" seems to work same way as described below.
keyspace  [author] 15 Nov, 2022 @ 11:49am 
@Ugga

> In the stats.xml file, the health are not reset to 1.

`stats.xml` doesn't track health, it's only one field per player, called "Stamina".

I guess you meant stamina instead of health?.. This mod does not track health.

Are you checking the correct save's Storage folder?

Does the DS have write permissions to this folder?

Are there any errors in the server's console/log?

What is different in your server setup compared to mine (except the extra mods)?
keyspace  [author] 15 Nov, 2022 @ 11:48am 
@Ugga

Actually, never mind, turns out I never uninstalled the DS, so testing now (Through the Windows-based launcher SpaceEngineersDedicated.exe).

In my "Mars Planet" test game, there are no other mods than this one (id 2166947275), plus its dependency TextHUD API (pulled in automatically).

I have verified that after taking damage (from a fall) the Stamina field is saved to `stats.xml`.

After healing up in a medbay _or_ a survival kit, the character's health is increased, stamina rises as expected, and the changes are reflected in `stats.xml` after next auto-save.

To be specific, the `stats.xml` file I'm viewing is:

%appdata%\SpaceEngineersDedicated\Saves\Mars Planet\Storage\2166947275.sbm_Stamina\stats.xml
keyspace  [author] 15 Nov, 2022 @ 11:06am 
@Ugga

Thank you for reporting.

Although I've installed SE again, it doesn't look like I'll be able to debug Dedicated Server Issues any time soon.

Can only suggest disabling the mod for now. :(
Ugga 14 Nov, 2022 @ 4:32am 
@keyspace
I couldn't find mod incompatibilities. In stats.xml, for each character on the DS, health decreases after bad weather or a battle. Recovery in a survival kit does not raise the stamina cap. In the stats.xml file, the health are not reset to 1.
After the death of the character and re-entry, everything is OK.

Installed mods "Eat. Drink. Sleep. Repeat!" and "AiEnabled".

In single player everything is OK.
keyspace  [author] 13 Nov, 2022 @ 11:05am 
@Ugga

AFAIR this was common on DS, especially when used with other mods that set health <100% after re-spawn.

Stamina is capped by health. Have you found a bug where stamina is below health, and no longer rising?..
Ugga 12 Nov, 2022 @ 5:13pm 
@keyspace
Dedicated Server bug. After losing HP and recovering, stamina does not return to 100% again.
keyspace  [author] 22 Feb, 2022 @ 10:59am 
@odiwalker

Yes. The license is CC BY-SA 4.0 - follow the link in the "Source Code" section of mod description. Basically, "as long as you distribute the same way". Be sure to change something in the mod thumbnail.

The code is simple and an OK place to start modding, yes.
odiwalker 12 Feb, 2022 @ 8:57pm 
This is one of the cleanest and best streamlined mods I ever saw, so much so Im using it to learn how to mod for a while. I'm a begginer at that and I would like to know if its ok for me to change the code of this mod to add other stats (besides stamina) and to publish it
keyspace  [author] 26 Jan, 2021 @ 7:47am 
Hey @defe, a few complications that come to mind:

- it would probably need to cover all the other states, not just Sprinting - so, another table;
- it would also have to take into account the helmet state (open/closed), as well as atmospheric oxygen level (high/low/none), and possibly some edge cases on weather transitions.

I'm intentionally trying to keep this as simple as possible, with just one extra game dynamic to track, and relatively little code to maintain.

In short, something like that surely seems doable, but I'm not going to do it any time soon.
defe 24 Jan, 2021 @ 5:38pm 
hi keyspace, can you make something like this?... if currMovementState == MyCharacterMovementEnum.Sprinting get oxygen = player.Character.GetSuitGasFillLevel(OXYGEN) then oxygen -= 0.01f MyVisualScriptLogicProvider.SetPlayersOxygenLevel(playerId, oxygen)

i found this if it could help :p https://pastebin.com/TqpL6TFw
Planewalker 23 Jan, 2021 @ 7:24am 
Nice mod, thank you!
chris_cz 11 Sep, 2020 @ 12:44pm 
thanks a lot for your work!
chris_cz 11 Sep, 2020 @ 12:44pm 
Hi @keyspace, no i have no reason.
It was just my opinion, but i spent few hours ingame with your mod and its great, i am not sure now to slow down bellow 50% ...
keyspace  [author] 11 Sep, 2020 @ 9:01am 
@chris_cz Do you have a reason?..

I've previously tried making stamina follow a logistic curve instead of a linear one, and it worked OK-ish - except for the "black border" fade-in getting too choppy then, due to the simplistic way it's coded.

Anyway, I've filed this for the future on github:

https://github.com/keyspace/Stamina/issues/2
chris_cz 11 Sep, 2020 @ 8:40am 
Hi, your stamina mod is one of the best i've seen in the game i really love it that i have to manage my stamina.
I would just like to add slight gradual slow down bellow 50%
Aemond "Stong Chin" Targaryen 25 Aug, 2020 @ 2:13pm 
@keyspace copy, thank you! I will post if any bugs with 5 of us on a server
keyspace  [author] 25 Aug, 2020 @ 6:55am 
@Gaulc21 Yes, bots are ignored by the mod - that was the simplest solution to stop their stats from being fed to the game host; and so they don't run themselves to death (would need some AI coding).

It worked for me three weeks ago, on a dedicated server - although it was just me and the spiders, no other players.
Aemond "Stong Chin" Targaryen 25 Aug, 2020 @ 1:52am 
This doesnt affect bots does it and does it seem to work for multiplayer right now?
keyspace  [author] 5 Aug, 2020 @ 8:17am 
v0.2.2 released.

- Fix exception where bots were still iterated in networking code.
keyspace  [author] 5 Aug, 2020 @ 8:17am 
I was able to reproduce the bug on a dedicated server. Thanks again @metalsnake!
keyspace  [author] 5 Aug, 2020 @ 5:16am 
Thank you. I'm setting up now to debug this proper.
defe 4 Aug, 2020 @ 8:08pm 
this mensagge is filling the DS console " 2020-08-05 00:06:22.274: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Keyspace.Stamina.Stamina_Session.SendUpdatesToAllPlayers()
at Keyspace.Stamina.Stamina_Session.UpdateAfterSimulation()"
keyspace  [author] 4 Aug, 2020 @ 4:56pm 
@metalsnake I'd greatly appreciate if you tried multiplayer again, see whether the issue is still there.

The "fix" was made blindly, without any testing; it seemed simple, but not sure I guessed right. If it doesn't work, looks like I'll have to set up a dedicated server for this, to avoid the ping-pong.
keyspace  [author] 4 Aug, 2020 @ 4:52pm 
v0.2.1 released.

- Try not to crash multi-player servers on player log-in if data is not fully loaded.
keyspace  [author] 4 Aug, 2020 @ 4:04pm 
Ooh, looks like you're the first to try this in multiplayer. :D

Is this a dedicated server, or are you hosting on the same computer? (Shouldn't make a difference, just asking for easier bug reproduction.)

Regarding the question - maybe; but this probably won't do anything in high-oxygen environments (like on Earth-like surface), effectively granting unlimited stamina there.
defe 4 Aug, 2020 @ 2:03pm 
is anywhere in SE api, or could be possible to drain O2, instead of health? I don't want to be annoying. It's just an idea :P
defe 4 Aug, 2020 @ 1:58pm 
its me again :P @keyspace check this out... i am using this in a private server. server crashes after my buddy login in.. " 2020-08-02 02:09:42.531 - Thread: 1 -> Object reference not set to an instance of an object.
at Keyspace.Stamina.PlayerStats.Recalculate(IMyPlayer player)
at Keyspace.Stamina.Stamina_Session.UpdateAllPlayerStats()
at Keyspace.Stamina.Stamina_Session.UpdateAfterSimulation()"
keyspace  [author] 3 Aug, 2020 @ 4:10pm 
v0.2 has been released a few days ago. (Couldn't post here because of Steam Workshop bug.)

- Added a dark overlay on the screen edge that fades in as stamina gets low. (On retrospect, this still isn't visible enough, especially at night.)
- Fixed a bug where stamina of bots (wolves, spiders, etc.) was being applied to the game host. Should get less sudden deaths now.
keyspace  [author] 3 Aug, 2020 @ 4:08pm 
Draining stamina when discharging firearms seems an interesting addition that I haven't thought of; getting a penalty in low-oxygen environments with helmet open (such as at high elevations) is one that I have.

I'm not big on simulating panic in-game, IMO that's best handled by player head. (Maybe that's what you meant, and I misunderstood.)

However, I'd prefer to get the essentials right before introducing extras. This'll have to wait.
defe 31 Jul, 2020 @ 2:39pm 
Thanks to you, this is more than a simple mechanic, the way i see its like game changing!!! for example, can i suggest to add a weapon firing/aiming/recoiling debuf , or maybe panic/stressed/danger debuf? i mean ,a small algorith to make you nervous during a melee fight or space battle or perhaps low oxygen(to generate a psycological anxiety like subnautica) !. this brings a certain inmersion that SE lacks.. im no dumb, i know this will requiere time, im my self a hobbyst/uC proggramer, but that will be Game CHANGING. Also, this could look great if it is merged in HUD (like a bar, probably), or alongside with HELMET HUD MOD
keyspace  [author] 31 Jul, 2020 @ 1:40pm 
As could have been guessed, I forgot to check for "bots". Turns out bots have the same Steam ID as the host/server. This will be addressed shortly.

Thank you again @metalsnake for reporting.
keyspace  [author] 31 Jul, 2020 @ 1:13pm 
OK, I can confirm the bug - albeit with spiders. Not sure they ever run, but grinding them down does show debug messages about low stamina.

This might be an odd one to debug. I'd suggest turning either monsters or the mod off for now.
keyspace  [author] 31 Jul, 2020 @ 11:26am 
@Chipstix213 It's supposed to be per-character, based on the player's Steam ID. But there may be a bug. I haven't gotten to debugging it yet. It's also not tested in multiplayer, not yet.

@metalsnake Nope, I see no realism in that, sorry. :D Will get to fixing it ASAP.
defe 31 Jul, 2020 @ 11:09am 
@keyspace looking from another way, it adds a certain realism to melee encounters, like an urgency to kill them (i used with zombies) and weather and hell its creepy
defe 31 Jul, 2020 @ 10:50am 
sorry, i rarely play online. but yes, it seems that
Chipstix213 31 Jul, 2020 @ 10:30am 
Does that mean you take all the damage from all the characters in world? Does it not handle multi player?
defe 31 Jul, 2020 @ 9:33am 
"there is an ever-increasing amount of damage being applied, as it would usually do with the player character getting exhausted? " yes,exactly! it appears to be happening when wolves are moving. By the way i really like this mod, thank you! :)
keyspace  [author] 31 Jul, 2020 @ 9:02am 
@metalsnake Quite possible, I haven't tested with wolves/spiders.

Do you die suddenly, or is there an ever-increasing amount of damage being applied, as it would usually do with the player character getting exhausted?
defe 30 Jul, 2020 @ 4:38pm 
hi, i randomly die when wolves are running. is this a bug?
keyspace  [author] 28 Jul, 2020 @ 10:55am 
@Skallabjorn ACK.

@Solraven You must've been trying to comment on some other mod.
Solraven 28 Jul, 2020 @ 1:37am 
i was trying to create variant groups for hand tools but completely failed. i see things like this and think it must be possible, right? i just wanted to move the tools to one toolbar slot to wheel through. possibly 4 slots one for each type so if you die and loose your good tool the button still works with your junky tools. i posted in the workshop discussion but didn't get a response.
Skallabjorn 27 Jul, 2020 @ 7:49pm 
Comment - DNSK - We didn't "take" the mod from another author, if you look, those authors are all willing contributors to the DNSK project....

As well... we took the precaution of international copyright due to KEEN antics with mods and modders ( and ask the powers that be at KEEN, they learned the hard way the DNSK CR was fully registered, whats the saying, "my lawyer is bigger than yours......" )..

Anyways... thanks to your comments ( and your sideways kilter-ed indication of its 'source' as code..., we are looking at your code...... if its ours.......

if its not... then well done.....

Nuff said...
NeonDrip 27 Jul, 2020 @ 6:03pm 
When you cant change a mod to your liking so you just make what you want from scratch, a true modder move my man :steamhappy:
JSHALO2025 27 Jul, 2020 @ 11:05am 
lol now we need mod a where it makes use the bathroom, organic matter could be used, good job adding this :cozyspaceengineersc:
keyspace  [author] 27 Jul, 2020 @ 10:45am 
@Stillintus That's why I wrote the thing from scratch. Also, Hunting certainly has stamina - under the name of fatigue, though.
Stillintus 27 Jul, 2020 @ 8:26am 
If you took the code for this from Daily Needs then you are breaking that licence ... doesn't matter if they took from another mod because that previous doesn't have stamina involved