CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
571 stars 85 forks source link

Parking AI confused in large parking lots #1626

Closed krzychu124 closed 2 years ago

krzychu124 commented 2 years ago

Fixes #924, fixes #423, fixes #352, fixes #1394

Proposed change should result in better detection of end PathPosition which vehicle should reach before starts flying to parking spot. It's not perfect solution but user reports say that change in behavior is significant and parking location decisions are much better compared to current public version.

I'm not entirely sure if we should completely remove endPos argument or only for specific cases like e.g.: residents calculating parking spot in advance to mimic the case: "I live in that city long time, I know best parking spots"


Update (4th Aug/22):


Build zip

krzychu124 commented 2 years ago

No more low-hanging fruits. Ready for review.

krzychu124 commented 2 years ago

Code looks fine, but how do I test the parking? They parked before, they park now, how do I know it works?

Probably the easiest way is to observe parking spots that have two potential entrances, one banned for cars and much closer then other one not restricted but objectively requires longer path. Before the fix they were more likely to stop moving before entering restricted segment and fly the remaining distance to the parking spot. Now they should take longer, more realistic route and also fly only if necessary (e.g. only within the segment width/length).

Example scenario where I actually noticed the problem and tested it multiple times: cim going from blue building. Parking spaces are only available at the top. Red path is possible with old version (8/10 attempts), green is when using this version. Notice car ban.

image