Skip to content
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

Set hyperdrive last service date to game start date for new games. #4910

Merged
merged 1 commit into from
Jul 10, 2020

Conversation

The-EG
Copy link
Contributor

@The-EG The-EG commented Jul 10, 2020

This sets the hyperdrive last service date to the game start date for new games. Currently, the hyperdrive service date is still set to Jan 1 3200 for new games:
image

Currently, that means that new games start with a hyperdrive that is 19 years out of service!

A new game after this change:
image

Also in regards to the likelihood of the hyperdrive breaking:
Perhaps I'm particularly unlucky, but it would seem that a breakdown becomes fairly likely above 15 jumps after the service period ends. Just doing some quick testing, I got the drive to break 4 times in a row (out of 4 test runs) in the 13-17 jump range. I don't think this is necessarily bad, but it's not anywhere close to the maximum in BreakdownServicing.lua (255), and the likelihood of a random number being less than 0.0588 (~ 15/255) seems like it wouldn't be a given (the test is Engine.rand:Number() < service_history.jumpcount / max_jumps_unserviced).
Actually, if I'm thinking about this correctly, the chance that the drive will break after 15 jumps should be about 5.8% (if random is perfectly random , etc.). Each jump after the service period ends should increase the likelihood of the drive breaking by just under 0.4% each time.

Out of curiosity, I ran 1 million random numbers (Engine.rand:Number()) and it's not favoring either end, so perhaps I am just that unlucky?
image

@impaktor
Copy link
Member

I got the drive to break 4 times in a row (out of 4 test runs) in the 13-17 jump range. I don't think this is necessarily bad, but it's not anywhere close to the maximum in BreakdownServicing.lua (255), and the likelihood of a random number being less than 0.0588 (~ 15/255) seems like it wouldn't be a given

You've considered that it's commulative? 1/255 + 2/255...., so by 15 jumps the random number generator has with high probability drawn a low number, in your case 15/255. I think if one made a plot of how the code actually works, you'd see what's going on.

@The-EG
Copy link
Contributor Author

The-EG commented Jul 10, 2020

@impaktor Yes, but not in the correct way. That's what I get for posting things late at night with no sleep!
Even at 15 jumps, the probably is low (I think around 5% is correct). But the probability of something that can happen 5% of the time happening over 4-5 trials is pretty good: about 20% by the time you get to 5, and probably more than that since the probability increases each trial.

@The-EG The-EG deleted the hyperdrive-breakdown branch July 10, 2020 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants