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

Aircraft pathfinding fix #1338

Merged
merged 4 commits into from
Feb 1, 2022
Merged

Conversation

krzychu124
Copy link
Member

TM:PE is searching for path for all AI's in game, so added vehicleType converter to handle all explicitly used vehicles by pathfinding. Previously they set vehicle type None which caused issues in path-finding code testing lanes with allowed vehicle types. This change may fix other rare issues that happened in the past for AIs not explicitly managed by TM:PE

closes #1327
closes #1329

Build zip

@krzychu124 krzychu124 added BUG Defect detected STABLE TM:PE STABLE branch PATHFINDER Pathfinding tweaks or issues TEST TEST version of the mod / workshop page labels Jan 30, 2022
@krzychu124 krzychu124 self-assigned this Jan 30, 2022
@krzychu124 krzychu124 added the Vehicle Behavior Vehicle behavior related issue label Jan 30, 2022
@originalfoo
Copy link
Member

Should we add a pathfinder version number (similar to how we add version in WhatsNew.cs) and if user loads a city with earlier (or no) pathfinder version clear all traffic to ensure all vehicles are using updated paths? #485

@originalfoo originalfoo added this to the 11.6.4-hotfix-4 milestone Jan 30, 2022
originalfoo added a commit that referenced this pull request Jan 30, 2022
- [Meta] TM:PE 11.6.4-hotfix-4
- [Meta] This is a bugfix release for aircraft pathfinding
- [Fixed] Aircraft stuck at taxiway junction #1338 #1329 (krzychu124)
- [Fixed] Aircraft taking off from taxiways #1338 #1327 (krzychu124)
@krzychu124
Copy link
Member Author

@aubergine10 no need here, I think. This applies only to aircrafts taking off so it will start working for new paths. Clearing all vehicles is a bit overkill in this case. Would be cool to add section in the options where user could select which vehicles are cleared.

@originalfoo
Copy link
Member

originalfoo commented Jan 30, 2022

... Clearing all vehicles is a bit overkill in this case. Would be cool to add section in the options where user could select which vehicles are cleared.

Would it be worth exposing ExtVehicleManager.DetermineVehicleTypeFromAIType() as public to make that easier? That way we can generate checkboxen from ExtVehicleType enum, also have a method that accepts an ExtVehicleType and despawns matching vehicles?

EDIT: #1341

@originalfoo
Copy link
Member

Tested this in-game, although without an airport... so I was focussed on all the other vehicles which seem to be working fine :)

  • Public transport incl. trains, buses, ferries
  • Cargo - trains, ships
  • Emergency helicopters
  • City services and road-based emergency services
  • Cars, etc.

Copy link
Member

@originalfoo originalfoo left a comment

Choose a reason for hiding this comment

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

Done another in-game test with a small airport and it seems to be working as advertised.

@originalfoo originalfoo mentioned this pull request Jan 31, 2022
@originalfoo
Copy link
Member

@krzychu124 If you can add a pathfinder version check, and want to despawn planes with this new update (assuming #1341 gets merged first):

Singleton<SimulationManager>.instance.AddAction(() => {
    UtilityManager.Instance.DespawnVehicles(ExtVehicleType.Plane);
});

@krzychu124
Copy link
Member Author

@krzychu124 If you can add a pathfinder version check, and want to despawn planes with this new update (assuming #1341 gets merged first):

Singleton<SimulationManager>.instance.AddAction(() => {
    UtilityManager.Instance.DespawnVehicles(ExtVehicleType.Plane);
});

I'll implement suggestion from kvakvs and merge, then you can add such thing in your PR 😉

@originalfoo
Copy link
Member

Will prolly do separate PR for that once both #1341 and #1338 are merged.

@krzychu124 krzychu124 merged commit 4f5440c into master Feb 1, 2022
@krzychu124 krzychu124 deleted the bugfix/1326-aircraft-pathfinding branch February 1, 2022 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected PATHFINDER Pathfinding tweaks or issues STABLE TM:PE STABLE branch TEST TEST version of the mod / workshop page Vehicle Behavior Vehicle behavior related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aircraft DLC: Aircrafts sometimes stuck at taxiway junction Aircraft DLC: Aircrafts take off from taxiways?
3 participants