Experimental hab-cabin time implementation #317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In response to #199 I put together a (shaky, experimental) revamp of the habitation time system in such a way as to support almost everything that issue explains. Testing suggests everything works as intended, though I have not been totally rigorous with these.
The principle is that instead of resetting hab and home timers whenever a Kerbal switches vehicles or the like, each Kerbal has a personal cabin timer, which caps at the BaseHabTime in the settings panel, and a "how long have I been in space timer" of (now - LastAtHome) which is compared against whatever the current vessel's hab duration is. (That duration is calculated the same way as before, minus the BaseHabTime per seat times hab multiplier, which is going into the cabin time extension. Think of it a little like supply time vs. starving time now.)
A Kerbal only feels "comfortable" when their current vessel's hab duration is longer than they've spent in space so far. This means that when you put a Kerbal in a huge fancy LKO station and then send them on a trip to Eeloo in a tiny ship with one Hitchhiker, they'll only care about the tiny ship's habitation value for the journey. (Think of it as Kerbals getting harder to please the longer they've been away from home.)
Once a Kerbal no longer feels comfortable with current habitation, their cabin timer starts counting down; at 0 they take the homesickness penalty. This timer counts down slower if there are more empty seats in the vessel (this is where the BaseHabTime per seat went) or if the vessel has a HabMultiplier, and it gradually counts up (to the cap) if they're comfortable in hab space again, thus allowing you to send a Kerbal on multiple few-days-long expeditions out of a central large mothership.
This approach thus keeps the flexibility of the old home timer setup in allowing Kerbals to depart from motherships on short trips, while preventing abuse (or just confusing numbers on the monitor!) from, e.g., briefly taking Kerbals out of a large vessel to boost the others' home timers as if they were the only ones onboard.
Issues at the moment:
Non-revamp parts of this might also be useful: commit f9d3e57 fixes #316, commit 846dba1 fixes #307 (turns out you should use vessel.Die() on an EVA Kerbal), commit 5481815 fixes #239, and the rest of this fork also corrects a few small typos. As such I don't expect this whole thing to be merged, it's more of a personal testbed.