Re:Show HN: I added autopilot to the lunar lander game
by ricardobeat on Friday March 10, 2023 @02:47AM
(#35091622)
The target velocity is a factor of height, and the autopilot has “160” hardcoded as the ceiling, so going above that means it will never decelerate fast enough.
https://github.com/szhu/lunar-lander-autopilot/blob/master/a...
Re:Show HN: I added autopilot to the lunar lander game
by szhu on Friday March 10, 2023 @09:38AM
(#35094784)
That's a ceiling for the speed the autopilot is okay with letting the lander descend. There is no ceiling to how much hard it will try to "apply the brakes".
I agree that the target velocity calculation is off though. I was excited that I came up with something reasonably theoretically correct for correcting rotation... and for figuring out when to fire the engines I just gave up and eyeballed it :)
Re:Show HN: I added autopilot to the lunar lander game
by szhu on Friday March 10, 2023 @01:42PM
(#35098958)
Update: I added a new algorithm, and I think it might be impossible to crash the ship now.
Let me know if you can still reproduce the bug!
The autopilot did a perfect job of stopping the rotation and lateral motion, so the lander came down straight as an arrow. Unfortunately, the autopilot didn't even try to decelerate! I crashed into the moon at 0.9 degrees and 770 MPH.