Alright, almost every track has two grooves - a left one, and a right one. The right one on an oval is treated as off-line, whereas the left one is the racing line.
Because of this, pit road also has two lines - again, one left, and one right.
For some reason, every single track had both the pit lines on top of each other, meaning all the AI crammed into one lane, regardless how wide the pits actually were. So I spaced them out so that there are now two lines on all tracks. The AI treat these lanes strangely. They treat the left one as the "in" lane, using it if they have not yet had service. The right lane is the "fast" lane, and is where things get strange. If they enter side-by-side, the AI will use the fast lane when needed, but will also just come to a dead stop instead of missing their pit stall. Stranger still is that they don't always use the fast lane when exiting the pits, regardless if it would be wise. More than a few times I've seen them prefer to sit in a line rather than use the fast line, yet all the same traffic seems to be a lot worse if you have the lanes merged together as one.
Speaking of merging, when they enter the pits, there are going to be two lines that allow them to do so. One is on the left (racing line), the other on the right. By default, the right lane would immediately jump to the left and copycat all the way to the other side.
Default pit entrance for Phoenix (on the right side)
I didn't want the AI to swerve like maniacs, so I decided to give each lane the ability to go to the pits. This has the added bonus of allowing cars to enter the pits side-by-side.
Modified pit entrance to Phoenix, along with the modified pit road lanes
There was an unexpected consequence to this. For whatever reason, the AI does not seem very coordinated on some tracks. If a car is off-line and decides "PIT NOW", it will follow the outside pit entry line, as expected. They will account for traffic, slowing down drastically if the need arises. The first problem is that they will only slow down so much, before deciding to commit and cutting in front of cars - they seem incapable of aborting a pit stop. The bigger problem is that cars on the racing line do not always respect this, and it seems to be entirely based on the tracks rather than the drivers. The driver on the racing line will completely ignore the car trying to pit, and can inevitably crash or spin out the car trying to pit. This almost always causes the pitting car to be spun back out onto the live racetrack, potentially in harms way.
But it gets weirder. The pitting car will insist it has made it to pit road (even if it is on the track), and will beeline for it. This is mostly fine if there is no pit wall (assuming they don't take out any oncoming cars), but if there
is a pit wall, the AI will decide that the most reasonable course of action is to slowly grind along the wall, wheels completely locked to the left. Once they are adjacent to their pit stall, the car will automatically teleport to its stall, receive service...and then promptly retire the race. (The game cites it as a "DNF".)
I might add this entire process does not trigger a full course yellow, unless the pitting car causes another car
that is not actively pitting to crash or spin.
One final note about pit road behavior is that the AI don't always seem to fully understand how pitting should work. On some tracks, they will pit as you expect, with cars trickling in over the course of a three to seven lap interval (depending on track size and fuel consumption.) The weird thing is that this does not always seem to work as intended. On some tracks, you'll end up with
the entire damn field pitting on the same lap. This seems especially common on tracks under a mile in length, though it does not seem exclusive to this.