Fix that sometimes ships get stuck the moment they start to dock#5127
Conversation
3ec9fde to
631b82b
Compare
|
sorry for the force pushes, minor alterations |
|
Turned into a draft, because the queue does not work well at large time accelerations |
src/ShipAICmd.cpp
Outdated
| int queue_pos = 0; | ||
| // since ground stations have a different path for each pad, this queue is | ||
| // not needed there | ||
| if (type->IsOrbitalStation()) |
There was a problem hiding this comment.
No single-line if/for statements please, always use brackets especially with something like this.
There was a problem hiding this comment.
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.
|
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)
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. |
|
Hey @Gliese852 what's happening wiht the PR? It seemed really promising. |
|
@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). |
876b6fc to
b5bc47c
Compare
|
@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? |
90e4530 to
6a3a044
Compare
Fixes that sometimes ships get stuck the moment they start to dock
631b82b to
a97f3c2
Compare
|
All that was left of my PR was just one line, although it is quite useful. |
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 reproduceAdd a simple queue for docking with the station in order to somewhat reduce the probability of a collision of shipsIt didn't work out that easy, let's postponeAlso in order to find out which ships are in a given frame, I implemented theFrame::GetBodiesInsidefunction, and for its work - theCollisionSpace::GetGeomsfunction.