app written in lua to make new race strategies and some small adjustments to the AI of AC/CSP
A last alpha update for DumbAI with the best I could do for blue flag behaviour (I'll stop to spam the topic for a while :-) )
To summarize this app a last time, the logic is very simple:
- check for leader behind me
- if yes, slow down to a speed limit and make a lateral move based on AI spline
The speed limit can be modified in the UI, 90 kmph works OK for me with F1 1988 and GT3. The default distance limit to trigger blue flag behavior is 50 meters, a good compromise between a not too much surprise move that would cause a crash and a too early move that would stuck the leader to 90 kmph. Works OK for me with F1 1988 and GT3 too, but can be also modified.
The AI looks at the next turn and chooses allways to make a lateral move from the AI spline so that it takes the most external line of the next turn. Works quite good for most straights and simple turns.
I added a Bot class to add some kind of "memory" and register events between frames.
In this way, I was able to diminish the risk of crash in complex turns such as chicane: the bot chooses the external line of the first turn and then, as long as the overtaking event is not finished, it stores the spline offset and keeps this absolute lateral side for the next turns (without trying to cross the AI spline to find the next opposite external line of the chicane).
With this storage, the AI is also able to make a small brake event at the beginning of the outlapping so that it brakes quicker to the speed limit, with the hope it will help overtaking by the leader.
Also, I added the capability to manage some context information to avoid crashes when leader is overtaking a train: the first AI to be overtaken checks in front of him before returning to its normal AI spline in the case of the leader would be still just a little bit in front and aside of him, slowed down by the next AI car to overtake (observed this particular crash situation in the former version).
It seems that for 180° turn like Parabolica, the AI chooses the internal trajectory, which in fact works very well with F1 1988 so there may be some potential of improvement for the next versions, by studying more carefully the impact of the angle of the next turn.
I noticed the most difficult situation for the AI seems to be when the turn is not strong, near a straight or in a straight and the AI spline is slowly crossing the track. Likely, the collider prevention may have a role here. In Monza 88, you can see this effect in Curva grande (if the leader has not outlapped the late one just after the chicane, it has difficulties to decide to overtake in the curva) and just after Ascari chicane in the beginning of the Rettifilo centro.
So the issue is not completly solved but I have the feeling the "pile up" effect has been diminished, I never saw an AI that would be stuck more than one or two seconds in my tests.
OK, that's all folks for this DumbAI :-)
Now that there is a bot class able to store things across frames, I will try to find a json format to store and read different possible strategies for pitting, changing compounds etc...Let me know if you tried it and found things to improve: I did it this app as a small service for myself but if people feel it is interesting and want to test things, I can add them as much as my spare time allows it :-)