-
-
Notifications
You must be signed in to change notification settings - Fork 843
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
[Bug]: High level pathfinder passing patches with no water as the origin. #11862
Comments
The water region pathfinder expects the origin tile to have a patch of water, but under certain circumstances, this may not happen. This would make the gathering of neighbouring regions incorrect. When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVING OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. Try to look at the order destination unconditionally of order type and determine whether to check for docking tiles of the tile pointed by v->dest_tile, add the v->dest_tile or add no tile at all as the origin node.
The water region pathfinder expects the origin tile to have a patch of water, but under certain circumstances, this may not happen. This would make the gathering of neighbouring regions incorrect. When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVING OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. Try to look at the order destination unconditionally of order type and determine whether to check for docking tiles of the tile pointed by v->dest_tile, add the v->dest_tile or add no tile at all as the origin node.
The water region pathfinder expects the origin tile to have a patch of water, but under certain circumstances, this may not happen. This would make the gathering of neighbouring regions incorrect. When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVING OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. Try to look at the order destination unconditionally of order type and determine whether to check for docking tiles of the tile pointed by v->dest_tile, add the v->dest_tile or add no tile at all as the origin node.
The water region pathfinder expects the origin tile to have a patch of water, but under certain circumstances, this may not happen. This would make the gathering of neighbouring regions incorrect. When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVING OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. Try to look at the order destination unconditionally of order type and determine whether to check for docking tiles of the tile pointed by v->dest_tile, add the v->dest_tile or add no tile at all as the origin node.
The water region pathfinder expects the origin tile to have a patch of water, but under certain circumstances, this may not happen. This would make the gathering of neighbouring regions incorrect. When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVING OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. Try to look at the order destination unconditionally of order type and determine whether to check for docking tiles of the tile pointed by v->dest_tile, add the v->dest_tile or add no tile at all as the origin node.
I had a look at this, the problem is much weirder than I thought. Turns out the problem is not related to the new pathfinder at all. I put back the old ship pathfinder implementation (easy to do, it's only yapf_ship.cpp... you only need to do a couple of minor fixes). Note that the old pathfinder's SetDestination function is very similar to what the high level pathfinder is doing, and where @SamuXarick is trying different things. I did build a frankenstein build so it's not 100% sure that this problem exists in older openttd version, but it is highly likely. |
The water region pathfinder expects the origin tile to have a patch of water, but under certain circumstances, this may not happen. When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVESTATION OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock.
When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVESTATION OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. OT_LEAVESTATION OrderType still has the same destination as that of OT_GOTO_STATION, so assume they still belong to the same dock.
When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVESTATION OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. OT_LEAVESTATION OrderType still has the same destination as that of OT_GOTO_STATION, so assume they still belong to the same dock.
When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVESTATION OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. OT_LEAVESTATION OrderType still has the same destination as that of OT_GOTO_STATION, so assume they still belong to the same dock.
When a ship is departing from a dock, and wants to go back to it again, the destination tile is set as the origin, making the ship have a OT_LEAVESTATION OrderType. With this order type, the docking tiles aren't added as origins even though the tile is still that of a dock. OT_LEAVESTATION OrderType still has the same destination as that of OT_GOTO_STATION, so assume they still belong to the same dock.
Version of OpenTTD
20240121-master-g0841978304
Expected result
High level pathfinder always passes patches with water.
Actual result
High level pathfinder passes patches with no water as the origin. When getting neighbours with a patch like that, it eithers gets those where both regions have 1 patch, or none.
Steps to reproduce
OpenTTD/src/pathfinder/yapf/yapf_ship_regions.cpp
Lines 212 to 213 in c7d5ced
Load savegame, when the ship departs from the dock, it creates a scenario where the order type is changed to OT_LEAVING, but v->dest_tile points to the slope of the dock, which has no water.
ships crashing water regions.zip
The text was updated successfully, but these errors were encountered: