-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental hab-cabin time implementation #317
base: main
Are you sure you want to change the base?
Conversation
I went back to this after a bit to clean up after myself. There's a big hole in issue 199's formulation (and the one I implemented). It's well-suited to round-trip voyages on a long-duration mothership, where the crew's forays are very short, but it struggles with the concept of an interplanetary base. Let's say I have an interplanetary shuttle rated for 6 months, it takes 4 months to get there or return, and I have a Duna base rated for 5 years. Bob takes the shuttle to Duna, within the shuttle's hab limit, and then stays in the base for 2 years. But the moment he gets back on the shuttle, his collective time away from Kerbin is greater than the shuttle's limit and he's down to cabin time; unless he's alone on a shuttle with tons of seats, he's not going to make it back. The official version of USILS handles this with the "best ever seen" rule and then limits your time in a particular vessel based on that vessel's stats. But it's cheesable by switching vessels, adjusting the crew with EVA, and so on; by fixing those problems, we've brought back the original problem. I have a personal branch where I'm experimenting with an alternative: the vessel hab time is just the base months times multiplier, and then an individual Kerbal's cabin time is one-fifth of that plus the base 0.25 months or whatever you set it to. So on a vessel with no hab space, like just a capsule, you have 0.25 months of cabin time no matter what*. But on a vessel rated for 2 years, you have ~5 months of cabin time to work with, which means you can use a 2-year-rated vessel as the shuttle in the above example no matter how long Bob's spent on Duna. Technically that's roughly a 20% buff to total survival time in any vessel with a habitat module, minus the time lost from no longer having the multi-seat bonus. I think that's fine, but the numbers could always be reworked. * By getting rid of the scaling just based on number of seats, this also means a vessel without any habitat modules can never support Kerbals longer than 0.25 months even if you undercrew it. I think this is a net positive since it encourages the use of small, short-term habitat parts for vessels beyond LKO. And those ships can be undercrewed to get the longest hab time and thus the longest cabin time (extra 1/5) thereafter. |
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.