Whew, was busy today.
Started by adding a bit of extra information to the insim interface for those that joined the server to see what the AI is thinking/doing. As in, you can watch DLv2 adjust braking point and entry speed.
Then I got tired of Jared (the artificial driver) launching from a stop so bad, so I spent a lot of time there and ended up rewriting the entire state. Instead of using a timer to lift off the clutch and press in the throttle, I added a bit of logic that seemed to work in my head. In some cars Jared will launch about 90% as effectively as the LiveForSpeed ai on Pro. In other cars, he doesn't do so well. LX6 is what I used for most of the testing.
It is a remarkably short period of time, I had to watch a replay in 0.125x speed to dig into what was happening, and watching the LFS ai didn't help. The logic I used can be found in
this blog post on my site.
While watching the starts over and over, I noticed that the driver waits until the green lights to put the car into first. Why not prepare that during the red lights?! It was almost as easy as pushing a state during the red lights, except, not because the car would stall. I opened the ShiftToGear action and modified it to have a case where it could keep clutch pressed, for waiting on the grid in gear.
While in there I decided to add in support for the MRT which has the special case of downshifting to get into first. Success. Jared can now drive the MRT.
I did a lot of watching today and even tried a few different tracks, BL1, FE2, SO3, etc, and the only track that is working really well is FE1. Partly because it is still using my hand created layout, and partly because most of the algorithms that process the track (center line, racing line, corner detection etc) were written and tested primarily with FE1.
I think spending a little more time on the basic racing line and getting the corner information corrected could go a long way in allowing Jared to drive faster laps. While BL1 and SO3 were working, they did throw some errors/warnings at me and the corner detection was a little, off. For instance SO3 turn 3 started at turn 3 and ended down the back straight after turn 6. As much as I can I want to avoid feeding hand crafted data to the driver, so I need to spend some time to figure out how to process the data better.
On another note, On FE1 with the XRG Jared is faster than the LFS AI on Learner mode. As long as he starts, or gets, in front he can start pulling a gap. He still doesn't know about other cars, so he won't pass cleanly, and will probably take himself out if he comes up from behind on another car.