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

Fix that sometimes ships get stuck the moment they start to dock #5127

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

Gliese852
Copy link
Contributor

@Gliese852 Gliese852 commented Jan 26, 2021

  • Fix that sometimes ships get stuck the moment they start to dock.
  • Fix that during a long free flight the autopilot constantly corrects the course towards the target and this leads to unnecessary fuel consumption. Сan't reproduce
  • Add a simple queue for docking with the station in order to somewhat reduce the probability of a collision of ships It didn't work out that easy, let's postpone

Also in order to find out which ships are in a given frame, I implemented the Frame::GetBodiesInside function, and for its work - the CollisionSpace::GetGeoms function.

@impaktor impaktor requested a review from jaj22 January 26, 2021 16:41
@Gliese852 Gliese852 force-pushed the autopilot-fuel-queue branch 3 times, most recently from 3ec9fde to 631b82b Compare January 28, 2021 10:44
@Gliese852
Copy link
Contributor Author

sorry for the force pushes, minor alterations

@Gliese852 Gliese852 marked this pull request as draft January 29, 2021 11:45
@Gliese852 Gliese852 changed the title Fix/improve autopilot WIP: Fix/improve autopilot Jan 29, 2021
@Gliese852
Copy link
Contributor Author

Turned into a draft, because the queue does not work well at large time accelerations

int queue_pos = 0;
// since ground stations have a different path for each pad, this queue is
// not needed there
if (type->IsOrbitalStation())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No single-line if/for statements please, always use brackets especially with something like this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a decent amount of single-body-line if statements without brackets, though I agree in this case that if the body of the if statement is greater than one line it should have brackets.

@fluffyfreak
Copy link
Contributor

What happens to the queue at large time accelerations?
And if we're under high time acceleration can we skip the proper docking and just swtich from arrings straight to docked?

@Gliese852
Copy link
Contributor Author

@fluffyfreak

What happens to the queue at large time accelerations?

I noticed that with large accelerations of time, the queue begins to grow, up to dozens of ships, although with normal acceleration, there are a maximum of 2 ships in the queue (we have a very small flow)

And if we're under high time acceleration can we skip the proper docking and just swtich from arrings straight to docked?

yes, we will probably do so, although in the future I would like to see ships in the queue for which there is still no room at the station.

@fluffyfreak
Copy link
Contributor

Hey @Gliese852 what's happening wiht the PR? It seemed really promising.
If the work done so far is good, but you want to do more eventually, hten how about putting it up for review now and do the future work in a new PR?

@Gliese852
Copy link
Contributor Author

@fluffyfreak the fact is that the third part (with a queue), I would like to remake it strongly enough, I can remove it from the PR for now, and leave it with the first two parts (they are quite working).
We are going to greatly change the docking process (remove the "tossing" of the ship, remove the docking animation, change the tag system so that the autopilot can fly inside the station, make an assist mode so that the player can easily land manually on the rotating station). This is all related to how the work of the queue in the station will look like in the end, so I put it off.

@Bodasey
Copy link

Bodasey commented Jul 28, 2022

@Gliese852 If it's easy to separate the bugfix part from the new feature/improvement part, i please you to do as fluffyfreak proposed. I propose this in general to avoid annoying extra efforts and clarifications when you hard test a "redesigned internal code" branch and you first find a lot of things who are heritage from master branch.

First test: Superior conjunctions of the destination during the flight are done better (the ship now passes in front of the star and not behind any more), but you can still run out of fuel. The autopilot should realize them earlier? Get a better idea of the destination's position at an expected time of arrival?

@impaktor impaktor force-pushed the master branch 2 times, most recently from 90e4530 to 6a3a044 Compare January 26, 2023 21:29
Fixes that sometimes ships get stuck the moment they start to dock
@Gliese852 Gliese852 changed the title WIP: Fix/improve autopilot Fix that sometimes ships get stuck the moment they start to dock Feb 19, 2024
@Gliese852
Copy link
Contributor Author

Gliese852 commented Feb 19, 2024

All that was left of my PR was just one line, although it is quite useful.
It may partially alleviate the effect of #5735

@Gliese852 Gliese852 marked this pull request as ready for review February 19, 2024 20:15
@Web-eWorks Web-eWorks merged commit bd8757d into pioneerspacesim:master Feb 27, 2024
5 checks passed
@Gliese852 Gliese852 deleted the autopilot-fuel-queue branch February 27, 2024 22:04
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.

4 participants