garwel

[1.7] Kerbal Health 1.3.5 (2019-04-14)

Recommended Posts

41 minutes ago, garwel said:

I released Kerbal Health 0.5.3 as the last KSP 1.2.2-compatible version. It has the same features and bug fixes as KH 0.6.1 (+ one minor enhancement). I am now ceasing support for KSP 1.2.2.

Thank you very much!

Share this post


Link to post
Share on other sites
11 hours ago, garwel said:

Multipliers interact in a rather logical way. If they have a similar multiplier (e.g. 50%, as most default configurations have), their crew capacities stack. So, for instance, a Hitchhiker (50% to Crowded for up to 4 kerbals) and a Cupola (50% to Crowded for up to 2 kerbals) on the same vessel give a 50% multiplier to Crowded for 6 kerbals. If their multipliers are different, the resulting multiplier will be something in between. You will see the actual estimated HP effect in Health Report in the Editor.

Okay, it sounds like capacities stack (though this is not likely to be a factor as we need to have more than enough seats anyway) but the multiplier itself is effectively capped by the best available (typically 50%). Based on my understanding of the health factor descriptions it sounds like the biggest challenge is mitigating and reversing the effects of crowdedness, and to a lesser extent microgravity. 

So for a fairly spacious vessel with two hitchhikers and two cupolas for three crew:

  • The -0.5 HP per day from being assigned is effectively countered by +0.5 HP per day from CommNet connectivity (assuming we've set up an adequate relay network).
  • Crowdedness would drain the following HP/day: 5 HP max * (3 crew / 10 seats) * 50% cabin multiplier = 0.75.
  • Microgravity would cost another 0.5 HP per day (unless we add a centrifuge).
  • The two cupolas would "heal" a total of 2% of the each crew's "injuries" (missing HP) per day, leading them to stabilize at 62.5 HP below maximum - or about 50% health for level-3 kerbals (130 max HP).
  • Infrequent events (sickness, accidents, EVAs) would lead to temporary dips in HP, which could become dangerous if several happen to occur at the same time.

Overall it's manageable, but we need both plenty of seats and multiple cupolas (or potentially analogous parts such as greenhouses, med-bays, etc.) to prevent health from stabilizing at a dangerously low level, which is a bit unwieldy. Part packs like Stockalike Station Parts, which adds several larger crew cabins and cupolas, will come in handy here... Once configured, anyway - speaking of which, would you prefer that compatibility patches be submitted as pull requests to the KerbalHealth repo, or to the other mods?

---

One suggestion: adjust crew cabins' multipliers to account for their differing crew:mass ratios.

In stock we have four cabins:

  • Mk1 and Mk2: 0.5 tons per seat (first-class seating)
  • Mk3: 0.40625 tons per seat (economy seating)
  • Hitchhiker storage can: 0.625 tons per seat (station habitat)

Unfortunately this means that the Hitchhiker is strictly worse than the other cabins - it even has a much lower crash tolerance. (The Mk3 cabin is arguably too good, but it's not much of an issue because there's rarely any reason to bring more than a couple of kerbals anywhere at any given time).

Life support is typically an opportunity to improve on stock balance by giving bulky or heavy cabins like the hitchhiker unique features or better stats. If we change the crowdedness multipliers to (1 - crewCapacity / mass) for each cabin, the Hitchhiker becomes more attractive:

  • Mk1 cabin: 50% crowdedness multiplier for 2 kerbals
  • Mk2 cabin: 50% crowdedness multiplier for 4 kerbals
  • Mk3 cabin: 59.375% crowdedness muliplier for 16 kerbals
  • Hitchhiker: 37.5% crowdedness multiplier (i.e. reduced by 62.5%) for 4 kerbals 

Share this post


Link to post
Share on other sites
4 hours ago, PocketBrotector said:

Okay, it sounds like capacities stack (though this is not likely to be a factor as we need to have more than enough seats anyway) but the multiplier itself is effectively capped by the best available (typically 50%). Based on my understanding of the health factor descriptions it sounds like the biggest challenge is mitigating and reversing the effects of crowdedness, and to a lesser extent microgravity. 

So for a fairly spacious vessel with two hitchhikers and two cupolas for three crew:

  • The -0.5 HP per day from being assigned is effectively countered by +0.5 HP per day from CommNet connectivity (assuming we've set up an adequate relay network).
  • Crowdedness would drain the following HP/day: 5 HP max * (3 crew / 10 seats) * 50% cabin multiplier = 0.75.
  • Microgravity would cost another 0.5 HP per day (unless we add a centrifuge).
  • The two cupolas would "heal" a total of 2% of the each crew's "injuries" (missing HP) per day, leading them to stabilize at 62.5 HP below maximum - or about 50% health for level-3 kerbals (130 max HP).
  • Infrequent events (sickness, accidents, EVAs) would lead to temporary dips in HP, which could become dangerous if several happen to occur at the same time.

Overall it's manageable, but we need both plenty of seats and multiple cupolas (or potentially analogous parts such as greenhouses, med-bays, etc.) to prevent health from stabilizing at a dangerously low level, which is a bit unwieldy. Part packs like Stockalike Station Parts, which adds several larger crew cabins and cupolas, will come in handy here... Once configured, anyway - speaking of which, would you prefer that compatibility patches be submitted as pull requests to the KerbalHealth repo, or to the other mods?

---

One suggestion: adjust crew cabins' multipliers to account for their differing crew:mass ratios.

In stock we have four cabins:

  • Mk1 and Mk2: 0.5 tons per seat (first-class seating)
  • Mk3: 0.40625 tons per seat (economy seating)
  • Hitchhiker storage can: 0.625 tons per seat (station habitat)

Unfortunately this means that the Hitchhiker is strictly worse than the other cabins - it even has a much lower crash tolerance. (The Mk3 cabin is arguably too good, but it's not much of an issue because there's rarely any reason to bring more than a couple of kerbals anywhere at any given time).

Life support is typically an opportunity to improve on stock balance by giving bulky or heavy cabins like the hitchhiker unique features or better stats. If we change the crowdedness multipliers to (1 - crewCapacity / mass) for each cabin, the Hitchhiker becomes more attractive:

  • Mk1 cabin: 50% crowdedness multiplier for 2 kerbals
  • Mk2 cabin: 50% crowdedness multiplier for 4 kerbals
  • Mk3 cabin: 59.375% crowdedness muliplier for 16 kerbals
  • Hitchhiker: 37.5% crowdedness multiplier (i.e. reduced by 62.5%) for 4 kerbals 

Nice plan; your maths looks right.

The reason I left Mk3 cabin with a 50% bonus is that it's actually well-balanced already. Although it is the best crew module in mass per kerbal terms, it's still very heavy and has capacity of 16--much more than you normally need. It is also more expensive per kerbal ($1875) than mk1 ($275), mk2 ($1050) or the hithchiker ($1000). The only thing I think needs changing there is power consumption: I'll increase it from 1.5 to 2 EC/sec per kerbal.

I agree about the Hithchiker. I'll improve its multiplier to 0.375 and will also increase power consumption to 2.5 EC/sec per kerbal. The latter will also apply to mk1 cabin (which is currently as good as mk2, but cheaper). Gonna implement these changes in the next release, but you can edit the appropriate config (KHStock.cfg).

Share this post


Link to post
Share on other sites

Bug report:

Just testing out the KCT dev release for the first time in 1.3, so I am watching the space centre at high time warp for a while. I keep getting dropped out of time warp by a nullrefexception. Took a look at the log, and I'm pretty sure kerbal health is the one having trouble, but I'm not sure. Here's the relevant portion of my log:

[LOG 09:22:24.092] [KerbalHealth] Next event processing is scheduled at Y1, D18, 02:22
[LOG 09:22:24.095] [KerbalHealth] Next event processing is scheduled at Y1, D20, 01:27
[LOG 09:22:24.099] [KerbalHealth] GetInfected event has fired for Bill Kerman.
[LOG 09:22:24.104] [KerbalHealth] Infected condition added to Bill Kerman.
[LOG 09:22:24.108] [KerbalHealth] Next event processing is scheduled at Y1, D20, 02:35
[LOG 09:22:24.111] [KerbalHealth] PanicAttack event has fired for Jebediah Kerman.
[LOG 09:22:24.117] [KerbalHealth] Next event processing is scheduled at Y1, D22, 00:31
[LOG 09:22:24.687] [KerbalHealth] GetSick event has fired for Bill Kerman.
[LOG 09:22:24.691] [KerbalHealth] Infected condition removed from Bill Kerman.
[LOG 09:22:24.694] [KerbalHealth] Sick condition added to Bill Kerman.
[LOG 09:22:24.695] [KerbalHealth] Next event processing is scheduled at Y1, D22, 01:16
[EXC 09:22:24.699] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()
[EXC 09:22:25.031] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()
[EXC 09:22:25.122] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()
[LOG 09:22:33.829] [Kopernicus] Ast. ZPE-154 has been untracked for too long and is now lost.
[LOG 09:22:33.833] [Vessel Ast. ZPE-154]: Vessel was destroyed.
[EXC 09:22:35.471] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()

EDIT: Removing kerbal health stops the null refs.

Edited by Errol

Share this post


Link to post
Share on other sites
1 hour ago, Errol said:

Bug report:

Just testing out the KCT dev release for the first time in 1.3, so I am watching the space centre at high time warp for a while. I keep getting dropped out of time warp by a nullrefexception. Took a look at the log, and I'm pretty sure kerbal health is the one having trouble, but I'm not sure. Here's the relevant portion of my log:


[LOG 09:22:24.092] [KerbalHealth] Next event processing is scheduled at Y1, D18, 02:22
[LOG 09:22:24.095] [KerbalHealth] Next event processing is scheduled at Y1, D20, 01:27
[LOG 09:22:24.099] [KerbalHealth] GetInfected event has fired for Bill Kerman.
[LOG 09:22:24.104] [KerbalHealth] Infected condition added to Bill Kerman.
[LOG 09:22:24.108] [KerbalHealth] Next event processing is scheduled at Y1, D20, 02:35
[LOG 09:22:24.111] [KerbalHealth] PanicAttack event has fired for Jebediah Kerman.
[LOG 09:22:24.117] [KerbalHealth] Next event processing is scheduled at Y1, D22, 00:31
[LOG 09:22:24.687] [KerbalHealth] GetSick event has fired for Bill Kerman.
[LOG 09:22:24.691] [KerbalHealth] Infected condition removed from Bill Kerman.
[LOG 09:22:24.694] [KerbalHealth] Sick condition added to Bill Kerman.
[LOG 09:22:24.695] [KerbalHealth] Next event processing is scheduled at Y1, D22, 01:16
[EXC 09:22:24.699] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()
[EXC 09:22:25.031] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()
[EXC 09:22:25.122] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()
[LOG 09:22:33.829] [Kopernicus] Ast. ZPE-154 has been untracked for too long and is now lost.
[LOG 09:22:33.833] [Vessel Ast. ZPE-154]: Vessel was destroyed.
[EXC 09:22:35.471] NullReferenceException: Object reference not set to an instance of an object
	KerbalHealth.CureEvent.ChancePerDay ()
	KerbalHealth.Event.Process (KerbalHealth.KerbalHealthStatus status)
	KerbalHealth.KerbalHealthList.ProcessEvents ()
	KerbalHealth.KerbalHealthScenario.UpdateKerbals (Boolean forced)
	KerbalHealth.KerbalHealthScenario.FixedUpdate ()

EDIT: Removing kerbal health stops the null refs.

I've had a similar issue with these two mods installed together as well. I pretty much always have KCT, so I don't know if it happens when only Kerbal Health is installed.

Share this post


Link to post
Share on other sites

Thanks! I think I know what may be causing it.

UPD: Got it, squashed the bug. Its side effect was that a kerbal couldn't cure at KSC. Will include the fix in the next release.

Edited by garwel

Share this post


Link to post
Share on other sites

just looking at USI Life Support compared to TAC as I am thinking of switching for my 1.3 career.   and it also has an EC per Kerbal value tied to it already.  thus if TAC or USI life support systems are installed you will want to remove your EC/Kerbal to avoid this double charging the crew for their EC usage. 

 

as it is now, I have just made a MM patch on my system that says if it detects TAC or USI-LS it removes the EC/Kerbal from all the Kerbal health modules.

Share this post


Link to post
Share on other sites

@garwel sorry if this was mentioned earlier, but is a "day" mean 6 hour stock Kerbal day? If so, maybe it would be better to convert into hours for whose of us who playing with modded planets? Also, did that last MM patch with EC/kerbal removal for USILS available somewhere?

Share this post


Link to post
Share on other sites

@ZobrAAnot at home so I cant paste it but I will try to remember it now.

 

@PART[*]:HAS[@MODULE[ModuleKerbalHealth]]:NEEDS[[USILifeSupport],[TacLifeSupport]]:FINAL
{
	@MODULE[ModuleKerbalHealth],*
	{
		-ecConsumptionPerKerbal
	}
}

the needs statement may be wrong.  will need to verify the Life support mod names for MM

 

must run :Final to be sure to grab any parts other mods may have added..  and if they are using :Final as well you will need to be sure this one is last by naming the .cfg appropriately.

 

I will have to check this out when I get time to see the exact syntax I used.

Edited by Bit Fiddler

Share this post


Link to post
Share on other sites
9 hours ago, ZobrAA said:

@garwel sorry if this was mentioned earlier, but is a "day" mean 6 hour stock Kerbal day? If so, maybe it would be better to convert into hours for whose of us who playing with modded planets?

Yes, the day is considered 6 hours. Multiply it by 4 if you are playing with RSS or similar mods. If I find how to access day length, I may enable auto adjustment.

13 hours ago, Bit Fiddler said:

just looking at USI Life Support compared to TAC as I am thinking of switching for my 1.3 career.   and it also has an EC per Kerbal value tied to it already.  thus if TAC or USI life support systems are installed you will want to remove your EC/Kerbal to avoid this double charging the crew for their EC usage. 

 

as it is now, I have just made a MM patch on my system that says if it detects TAC or USI-LS it removes the EC/Kerbal from all the Kerbal health modules.

I know that USI-LS and TAC-LS use EC for life support. However, at least USI-LS uses tiny amounts of it, which you can almost forget about when designing a ship. One of the points of this mod was to encourage (or, well, force) players to build bigger, more complex ships for long missions. If you are going to the Mun or Minmus, you don't really need a health module, so your EC usage will remain low. But interplanetary travel assumes a different level of comfort, which in turn requires more power. It means that a couple OX-STAT panels are not enough any more; you'll have to provide enough EC for your kerbals' well-being. However, if you find that you don't really need all these health modules (or you need a temporary power boost), you can simply disable them and they'll stop eating power.

What I may do in the future is review the amounts of EC the modules take. It was defined rather arbitrarily, so I can make them lower (or higher) when I decide what to compare them against. Meanwhile, you are free to modify the configs to suit your play style.

Besides, if you use Kerbal Health 0.5.3 or higher, you should use resourceConsumptionPerKerbal instead of ecConsumptionPerKerbal.

Share this post


Link to post
Share on other sites
13 minutes ago, garwel said:

Yes, the day is considered 6 hours. Multiply it by 4 if you are playing with RSS or similar mods. If I find how to access day length, I may enable auto adjustment.

I guess you can look at code of Historian mod for that :) Here is 24h time format on the info bar:

Spoiler

cEeoOw2.jpg

 

8 minutes ago, HebaruSan said:

It's a solar day length isn't it?

Edited by ZobrAA

Share this post


Link to post
Share on other sites
9 minutes ago, ZobrAA said:

It's a solar day length isn't it?

Huh, I never thought of that before. You're right, we need to apply this conversion:

https://en.wikipedia.org/wiki/Sidereal_time#Sidereal_days_compared_to_solar_days_on_other_planets

length of solar day = (length of sidereal day) / (1 − (length of sidereal day orbital period))

Share this post


Link to post
Share on other sites

After looking at USI-LS a bit more it seems that USI also is dealing with overcrowding and cramped quarters as part of that mod as well.  so the 2 of these while not necessarily conflicting with one another do duplicate this mechanic as well as the EC/Kerbal (or Resource/Kerbal I guess it is now called).  not sure how best to resolve the duplications but you may want to mention this in your OP to warn players of this and the potential it has to cause them problems.

 

I will report later in more detail as I play this career a bit more to let you know how well they get along, and any ideas I may have for resolving conflicts.

Share this post


Link to post
Share on other sites
1 hour ago, Bit Fiddler said:

After looking at USI-LS a bit more it seems that USI also is dealing with overcrowding and cramped quarters as part of that mod as well.  so the 2 of these while not necessarily conflicting with one another do duplicate this mechanic as well as the EC/Kerbal (or Resource/Kerbal I guess it is now called).  not sure how best to resolve the duplications but you may want to mention this in your OP to warn players of this and the potential it has to cause them problems.

USI-LS' habitation mechanics do overlap with Kerbal Health, so I advise to disable them (just set their effect to none in USI-LS settings). It is mentioned in the mod description on Github, but I'll duplicate it here.

Share this post


Link to post
Share on other sites
On 2017-5-30 at 8:29 AM, garwel said:

If I find how to access day length, I may enable auto adjustment.

KSPUtil.dateTimeFormatter.Day will give you the length of the day in seconds (.Year for length of year in seconds).

This works for the stock Kerbal and Earth calendars, the RP-0 Earth calendar (RSS date time formatter mod), and for Kopernicus/Sigma Dimensions custom calendars.

Edited by Aelfhe1m

Share this post


Link to post
Share on other sites
1 hour ago, Aelfhe1m said:

KSPUtil.dateTimeFormatter.Day will give you the length of the day in seconds (.Year for length of year in seconds).

This works for the stock Kerbal and Earth calendars, the RP-0 Earth calendar (RSS date time formatter mod), and for Kopernicus/Sigma Dimensions custom calendars.

Thanks man! I suspected it, but haven't checked. Will implement in the next release.

Share this post


Link to post
Share on other sites

Here are some additional configurations to extend KerbalHealth functionality to various part packs.

Also, the pending community update to HabTech will include KerbalHealth support.

Edited by PocketBrotector
HabTech Classic

Share this post


Link to post
Share on other sites
On 6/4/2017 at 9:45 AM, PocketBrotector said:

Here are some additional configurations to extend KerbalHealth functionality to various part packs.

Also, the pending community update to HabTech will include KerbalHealth support.

If you'd like to have these configs included in the mod, you may send a pull request. Otherwise, I added a link to the OP.

Share this post


Link to post
Share on other sites

Suggestion. As we now have to deal with sickness and accidents, may be we need a medbay of some sort on stock?

Like

@PART[Large_Crewed_Lab]
{
	MODULE
	{
		name = ModuleKerbalHealth
		resourceConsumption = 2
		multiplyFactor = Sickness
		multiplier = 0.5
	}
	MODULE
	{
		name = ModuleKerbalHealth
		partCrewOnly = true
		hpMarginalChangePerDay = 4
		ecConsumptionPerKerbal = 5
	}
}

 

Share this post


Link to post
Share on other sites

Kerbal Health 0.6.2

  • Added: Day length and home world should now be compatible with universe-changing mods
  • Added: Time unwarp when things happen (such as exhaustion) to kerbals on a mission
  • Changed: Increased EC consumption for most stock parts
  • Changed: Science Lab now only affects its own crew
  • Changed: A medic can heal 2 sick kerbals without penalties (2x better than a Scientist)
  • Changed: Death HP level is now fixed at 0, but you can now disable death in Settings
  • Fixed: Bug with curing sickness at KSC

Download here

Share this post


Link to post
Share on other sites
1 hour ago, ZobrAA said:

Some bug found:

 

It's a known issue. The thing is, your HP change depends on the situation: whether you are in microgravity (e.g. in orbit), at home, have connection to KSC, etc. The Health Report (in the Editor) doesn't know how exactly you are going to use your craft. So it assumes a more-or-less most common situation:

  • Microgravity is on
  • Connected is on
  • Home is off
  • All health modules are on

Here, your situation was different: microgravity was off, home was on, and the health module was off. Hence the different figures.

In the future, I will add a dialog where you can define how to calculate these factors. For now, you may either do it manually or use simulators such as KRASH before launching your vessel.

Share this post


Link to post
Share on other sites
1 minute ago, garwel said:

In the future, I will add a dialog where you can define how to calculate these factors.

That would be wonderful! :)

Edited by ZobrAA

Share this post


Link to post
Share on other sites

Kerbal Health 0.6.3

  • Added: You can now select, which factors to include in the Health Report calculations
  • Added: Kerbal Planetary Base Systems (KPBS) compatibility
  • Changed: Cupola EC consumption changed to 2 per kerbal (for marginal health bonus only)
  • Fixed: If exhaustion start level is set to 0 in the Settings, exhaustion should not occur
  • Fixed: Potential error with calculating min/max limits for factor multipliers in complex vessels

Download here

Edited by garwel

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.