Keeping on the useless retro engineering, i manage to get all the data out of the fast_lane.ai in a simple way. I never found anything on the web doing it properly (blender was able to do it apparently with an import addon, but i never managed to get it to work).
I used a python converter which allows you to extract any data from the fastlane without going thru Blender or Fastlaneutils, and translate them to CSV. In the future (and this is probably more for myself), that would allow you to interfeer with the inputs directly into the fastlane. ****ed up a little braking in a fast corner? Well, you can now edit the data directly : included are the spline position on the track (distance), the Gas, brake and steering inputs (x,y,z), and the sidelines (right and left_boundaries). The CSV file is a complete nightmare to read with regular human eyes BUT it has everything, while the lua files are super simple.
I haven't coded the python app to save it back to a fast_lane.ai file yet, but i'm on my way. It also need a more detailed option (i think i stayed on a 1% precision for this one, so 7 meters for the 8km track i was working on) in case anyone would want to edit the inputs on a very specific part of a corner.
Anyway, because there's a goal to this nonsense, the idea is to be able to load some of this data into the aihints.lua script
@shi started to mess with.
If you're not familiar with coding, python and ****, don't worry : neither do I. It's just some retro engineering and basic computer typing.
If you wanna give it a try, you need
https://dotnet.microsoft.com/fr-fr/ and
https://www.python.org/downloads/release/python-3137/
To use the python apps, when in the ai folder, shift + right click, open powershell window here. Then just type the app call : "python analyze_ai.py fast_lane.ai" first, then "python generate_fastlane_lua.py" if you want to have the lua conversions.
A first python app attempted to decrypt the fast_lane format and how to read the data, but i ended up with a mess cause the way it's packaged and exploited ingame is not intuitive at all.
It apparently depends on the track but i was lucky enough to find that link :
https://assettocorsamods.net/threads/extract-ai-pit-fast-lanes.2013/#lg=attachment5126&slide=0, which, coupled with
https://github.com/gro-ove/actools/tree/master/AcTools/AiFile, was pretty helpful.
Note that the python apps need to be in the same folder as the fast_lane.ai. The saved resulting files would appear in the folder.
To transfer the data to a CSV file, i made the analyze_ai.py. Open with powershell, type "python analyze_ai.py fast_lane.ai", it should automatically detect the best format and save the result as a CSv file.
Now, using the "generate_fastlane_lua.py" : Open with powershell, type "python analyze_ai.py fast_lane.ai" and you should get 3 lua files. As i'm still trying to figure out what would work best and for further testing (and to see what's the impact on the game perfs), it creates 3 lua files : detailed, medium and light. It looks like this, which is understandable for all :
local fastlane_data = {
[0] = {
distance = 0.000000,
x = 414.438,
y = 4.913,
z = 710.346,
right_boundary = 4.941,
left_boundary = 0.670
},
[1] = {
distance = 7.887292,
x = 406.701,
y = 4.881,
z = 711.875,
right_boundary = 5.577,
left_boundary = 0.763
},
etc etc...
At the moment, i have access thru the lua script to : each car position, its distance to next car, its distance from the fastlane, its distance to the sidelines. I still have to figure out how to configure the car being Left or Right to the fastlane.
What it could allow in the future : implement a behavior depending on the car position and what script to apply. Let's say left = danger, car on the right, apply countersteering and extra braking for example. Another cool feature that i 'm trying to add : in case of a car very close at front, increase speed and attempt overtaking, then careful driving while being on the inside line to not overshoot the corner. There's probably plenty of possibilities i haven't thought of, most of them being either not reliable or completely insane, but maybe there could be a few ones worth it to help those poorly designed ai Hints.
Anyway, this is just for the challenge, but i'm sure people involved in creating AI fastlanes and/or playing with lua scripts would enjoy to finally have access to this fast_lane.ai data, as i found the ressources about it to be extremely scarse and cryptic. Now, it's easy to access. I'll upload the CSV to .ai converter later.