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

Cargo truck transfer pathfinding fixes #1703

Merged
merged 7 commits into from
Dec 13, 2022

Conversation

krzychu124
Copy link
Member

@krzychu124 krzychu124 commented Nov 29, 2022

Fixes #1701

  • fixes pathfinding issue when searching for cargo path with use of multiple types of cargo transport (train/plane/ship)
  • improves lane routing via CargoVehicle lanes which solves issues for buildings that suppose to allow for pass through vehicle paths like cargo terminals but also Airports DLC dual track Cargo Train Station

Note

I've swapped method for matching lanes for RoutingManager, because the original was already used by lane connection tool (and more) and I didn't want to increase complexity or scope of tests.
Additionally lanes with CargoVehicles are not available for configuration in game by any tools we support and at this state they are used internally only in form of invisible paths included in building assets and meant to be used as internal paths with certain limitations.

More info about the problem and small test savegame you can find in the mentioned issue.

Build ZIP

…tiple types of cargo transport (train/plane/ship) but also lane routing via CargoVehicle lanes which solves issues for buildings that suppose to allow for pass through vehicle paths
@krzychu124 krzychu124 added BUG Defect detected confirmed Represents confirmed issue or bug STABLE TM:PE STABLE branch LANE ROUTING Feature: Lane arrows / connectors VEHICLE RESTRICTIONS Feature: Vehicle restrictions PATHFINDER Pathfinding tweaks or issues TEST TEST version of the mod / workshop page labels Nov 29, 2022
@krzychu124 krzychu124 added this to the 11.7.3.0 milestone Nov 29, 2022
@krzychu124 krzychu124 self-assigned this Nov 29, 2022
@kianzarrin
Copy link
Collaborator

do we need to deal with Cargo Vehicle in LaneEndTransitionGroup ?

        public static LaneEndTransitionGroup GetLaneEndTransitionGroup(VehicleInfo.VehicleType vehicleType) {
            LaneEndTransitionGroup ret = 0;
            if (vehicleType.IsFlagSet(ROAD_VEHICLE_TYPES))
                ret |= LaneEndTransitionGroup.Road;
            if (vehicleType.IsFlagSet(TRACK_VEHICLE_TYPES))
                ret |= LaneEndTransitionGroup.Track;
            return ret;
        }

        public static LaneEndTransitionGroup GetLaneEndTransitionGroup(this NetInfo.Lane laneInfo) {
            LaneEndTransitionGroup ret = 0;
            if(laneInfo.MatchesRoad())
                ret |= LaneEndTransitionGroup.Road;
            if (laneInfo.MatchesTrack())
                ret |= LaneEndTransitionGroup.Track;
            return ret;
        }

Copy link
Collaborator

@kianzarrin kianzarrin left a comment

Choose a reason for hiding this comment

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

except for the minor readability issue LGTM

@krzychu124 krzychu124 merged commit 38f2e55 into master Dec 13, 2022
@krzychu124 krzychu124 deleted the bugfix/1701-cargo-truck-transfer-mixed-path-issues branch December 13, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected confirmed Represents confirmed issue or bug LANE ROUTING Feature: Lane arrows / connectors PATHFINDER Pathfinding tweaks or issues STABLE TM:PE STABLE branch TEST TEST version of the mod / workshop page VEHICLE RESTRICTIONS Feature: Vehicle restrictions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default vehicle restrictions break cargo tuck transport through cargo station (train/plane/ship)
3 participants