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

Change #8001: Don't add docking tile cost when ships are still too far from their destination #8009



Copy link

@SamuXarick SamuXarick commented Feb 18, 2020

I noticed the problem with #8001 was mainly due to the added cost of docking tile penalty, though it could also be related with ship curve penalties as well, but I decided to mess with docking tile. I know it's used to separate the ships heading to docking tiles of a single station multi-dock.

So I thought of not adding this penalty too early in the search as an effort to reduce the number of pathfinding search nodes. It is only added when the distance to the destination is less than 16 Manhattan tiles.

@SamuXarick SamuXarick force-pushed the yapf-ship-docking-tile-penalty branch from 75973b4 to 0b4cac0 Feb 19, 2020
@LordAro LordAro requested a review from PeterN Feb 22, 2020
@SamuXarick SamuXarick force-pushed the yapf-ship-docking-tile-penalty branch 2 times, most recently from 3653240 to 3a4470f Feb 25, 2020
Copy link
Contributor Author

@SamuXarick SamuXarick commented Feb 25, 2020

I've been testing diferent costs for docking tile occupancy, to experiment with their intended purpose of spreading ships to diferent docking tiles, and I realise 300 may be too little. A value around 1400-1500 resulted in a better spread.

1500 cost: 12 ships, 12 docking tiles, ships occuppied 12/12
Lardingstone Transport, 1961-07-05

300 cost: 12 ships, 12 docking tiles, ships occuppied 6/12
Lardingstone Transport, 1962-10-30

Perhaps if this PR is accepted, docking tile penalty cost could also be adjusted for a better spreading of ships.

PS: These tests were done with the #8021 fix already in.

@SamuXarick SamuXarick force-pushed the yapf-ship-docking-tile-penalty branch from 3a4470f to ffc9c34 Feb 27, 2020
Copy link

@techgeeknz techgeeknz commented Jun 6, 2020

This is just a thought, but how is distance to the station calculated (for adding the penalties)? Does it take into account the setting for "station spread"?
I ask this because it could look mighty strange if a ship were to sail past an empty dock only to turn around and sail back to it again because the penalty wasn't added soon enough.

@SamuXarick SamuXarick force-pushed the yapf-ship-docking-tile-penalty branch from ffc9c34 to df41ac7 Dec 18, 2020
Copy link

@TrueBrain TrueBrain commented Dec 20, 2020

I am not convinced at all that this is a proper way to solve ship path-finding. It might work for the cases you tried, but it reads to me many more cases will start failing horribly. Basically, you are chunking the path-finders, which is good for performance, but gives many many side-effects most of the time.

Additionally, the way you describe your patch feels to me that you don't really understand what is going on, but that this just happened to work. This too is a reason I am not convinced.

I would need an opinion of someone with in-depth knowledge of our path-finders to convince me otherwise. Or someone who really did his research here, and showed many different cases to proof that common use-cases don't break now.

In general, ship path-finding is hard, because of the open seas. It will always be slow, unless someone comes up with a complete novel idea how to solve it.

@TrueBrain TrueBrain closed this Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants