Fix survival chance per timestep calculation#287
Merged
Capkirk123 merged 1 commit intodevfrom Nov 15, 2025
Merged
Conversation
TF consistently interprets the 'momentary failure rate' curve as 'instantaneous hazard rate' - the proportional failure rate of systems still working at the current time - for display purposes (e.g. the 'Reliability' and 'MTBF' displays are calculated as if it is the hazard rate). However, the conversion to a failure chance per update cycle wasn't done correctly, and the actual failure rate over time didn't match the instantaneous MTBF when the failure rate is not constant. Now, the cycle reliability curve directly specifies the hazard rate h(t) (which is the same as the 'failure rate' λ(t)), and the chance to fail over a timestep Δt is h(t)*Δt.
Collaborator
|
I have no issues with this change. I always said from the start that I didn't fully understand the math involved, but it sounds like you do :) This will have long tail repercussions in overall game play though so that's up to the current RP maintainers to decide. |
|
For more context, last week in the RO/RP Discord we discussed this problem, analyzed the possible solutions. |
Member
|
I have no concerns, making the actual failure rate match displayed failure rate is obviously desirable and the change during normal runtime seems fairly minor. If the longer tail becomes a balance issue we can just tweak the curves directly. |
Collaborator
|
Yeah that’s my main concern as this change is much more forgiving past the
rated burn time. I think it’s a good change it just might require some
curve changes for balance
- John Vanderbeck
- http://www.johnvanderbeck.com
…On Mon, Nov 10, 2025 at 3:36 PM Capkirk123 ***@***.***> wrote:
*Capkirk123* left a comment (KSP-RO/TestFlight#287)
<#287 (comment)>
I have no concerns, making the actual failure rate match displayed failure
rate is obviously desirable and the change during normal runtime seems
fairly minor.
If the longer tail becomes a balance issue we can just tweak the curves
directly.
—
Reply to this email directly, view it on GitHub
<#287 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHKZSACE4XEGJDO5GVHNT34DZOLAVCNFSM6AAAAACLVPBTI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMJTHAYDIMZVGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Member
|
I'll merge now, and see how it goes. If it becomes a problem we can adjust the curves later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TF consistently interprets the 'momentary failure rate' curve as 'instantaneous hazard rate' — the proportional failure rate of systems still working at the current time — for display purposes (e.g. the 'Reliability' and 'MTBF' displays are calculated as if it is the hazard rate). However, the conversion to a failure chance per update cycle wasn't done correctly, and the actual failure rate over time didn't match the instantaneous MTBF when the failure rate is not constant.
Now, the cycle reliability curve directly specifies the hazard rate h(t) (which is the same as the 'failure rate' λ(t)), and the chance to fail over a timestep Δt is h(t)*Δt.
Below is a plot of the cumulative failure distribution with 10 000 random samples, for both implementations. 'TestFlight' is the current implementation in TF; 'h·Δt' is the fixed implementation in this PR.

Many thanks to KSP-RO Discord user 'igui', who first found this problem and helped figure out the details of the implementation and this fix.
Make sure you have read and understood the contributing guidelines!
Pull Requests that don't follow the guidelines will be rejected. If you need help or are confused just ask, and we will be glad to help.