- 2,566

- Helsinki
refer to this post on one way to modify the TRACK AI line with LUA (one assumes, in real time)Hi Mr, thanks for your input.
My aim would not be to write a complete AI behaviour, I believe it is hardcoded in C / C++ anyway.
I have much to learn with AC / CSP api. From what I gathered, you can access with the lua API to variables defining some conditions used by the hardcoded AI model. So more like modifying AI behaviour by adjusting some of those available variable rather than building a whole AI model in Lua.
e.g. if I look at the blue flag implementation by Nuzzi, if I oversimplify, it is an iteration on every AI car to check with spline position if there is another car in an area beside it with a supplementary lap , and if so just set the throttle to a percentage of the max value.
While we are here, why not putting a lateral move for the late car according to the AI lines and track limits so that it let the best line to the overtaking one ? It would cost not much more I think while probably facilitating the overtake by another AI.
in the Flag App from Nuzzi, you have a lot of other iterations every frame to check if there is a stalled car somewhere in the track etc... so if , say, one does not want a virtual safety car but just the blue flag capability, we would not increase computation cost ?
I run 3 Nuzzi apps at the same time without having stuttering so I believe we have some possibilities.
Another example would be to modify the decision to pit by testing track weather conditions and include a condition where you have to pit and get wet tyres if weather has moved from dry categories to wet categories or even better if it is possible to access to the track rain quantity conditions (I think it is possible). Still have to figure out how much memory we can put into lua objects because if it is an instant decision, that would be not really realistic (e.g. the AI would go to pit too often in changing conditions)
"click to expand"
Battle Challenge for SRP mod by takeyoh, with AI controlled by lua script.Hi @Tetri ,
Could you tell me where you found this information about AI scripts? Which version of CSP is intended to enable AI scripting? I’m interested in this functionality if it is really implemented.
I tend to agree with you, but I ‘d go further because from my point of view, as Fastlane depends heavily of the car type and physics, the ideal solution would lead to allow users to link a car to an ai file before loading the track.
Youtube
So, with the help of chatgpt and Gemini, I created...
Last edited: