pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.62k stars 375 forks source link

Autopilot couldn't land on a planet #2860

Open luovahulluus opened 10 years ago

luovahulluus commented 10 years ago

My autopilot couldn't land on a planet that was on a very close orbit around a brown dwarf. I managed to land on it after flying between the planet and the brown dwarf and then applying autopilot again.

Savegame from the place autopilot was stuck: https://www.dropbox.com/s/l72jzrvjg63hmiy/932Autopilot

johnbartholomew commented 10 years ago

Thanks for the save file -- the behaviour certainly seems buggy. I'll aim to investigate this over the weekend.

luovahulluus commented 10 years ago

I had to return to the planet to cash in on my assasination mission. Again I was stuck in the same place. I was in orbit around Ioliaay C,D when this happened, but the planet I was trying to land on was on orbit around Ioliaay D. Once I flew manually to an orbit around Ioliaay D, the autopilot was able to land.

RookieRay commented 10 years ago

I had a similar issue to this, it said my autopilot couldn't compensate for the planets gravity, it might be intentional.

johnbartholomew commented 10 years ago

Sorry for the lack of updates. I am still looking at this, but I haven't been able to put as much time into it yet as I hoped to. Unfortunately, before I can work out why the autopilot is failing here I need to get a better understanding of how the autopilot is supposed to work.

corundscale commented 10 years ago

I think the main culprit here (based on in-game observations, not examination of underlying source code) is that autopilot updates its course according to the target's movement and doesn't seem to use orbital mechanics in predicting intercept point. In case of rapidly orbiting bodies it means that it will waste massive amount of propellant adjusting trajectory back and forth as target is doing its rounds. A band-aid solution that tends to work is to enter orbit around the parent body first, disabling autopilot for most of the coasting phase can also help a lot.

Some smarter autopilot code using orbital parameters to predict intercept (also pre-adjusting trajectory for the effects of gravity and maybe using unpowered trajectories for short range flights like going between ports on the same planets) would be welcome, but I don't think I'm up for the task.