The online racing simulator
a dumb question about A.I. cars
OK. Before I go on, please realize I don't know a thing about coding. I do know that this game really wasn't geared for single player racing. Unless you want to count hot lapping. Now we have mod vehicles. A lot of them out there. You can't run a whole field of these modded cars in single player. And that makes sense cause you can't just code A.I. cars for every single mod that pops up. In LFS the A.I. cars are coded cars. The driver is in the car to look pretty and I guess provide weight. So what about coding the driver instead? How far away are we, technologically, from having the ability to have that? I don't mean sentience like those chat bots. Basically what I mean is something that's marginally more intelligent than the A.I. car. If you could do that with the drivers, then you could pretty much use whatever modded vehicle you want. I know now that this concept falls under the realm of possibility. Just not so sure about practicality. Has any thought been given to this? Or is it "Hell no! And don't bring it up again!" ?
Can you clarify what you mean by "coding the driver instead"?

AI is just a form of algorithms and math, like any other program code.
I have not seen LFS's code but generally AI in video games works like this:

The AI-code takes some data as input and outputs data as control.
In a racing game the input might be:
-car speed
-engine rpm
-car position
-track layout
-car properties (weight, condition of tires, center of gravity,...)
The more input data is taken into account, the more detailed the calculations can be.

and the output would be:
-steering wheel angle
-throttle position
-brake position
-all the other driving controls, like clutch, gearbox etc
Notice that for a non-cheating AI, this would be the same as for humans.

To get from use "data input" to "controls output", there needs to be some AI program code. The more detailed this code is, the better/faster/life-like the AI driver will be.

There is an old 2D racing game called "RARS" that was not about driving but about programming AI that would drive the cars.

In this link someone briefly explains how his AI-driver worked:
https://rars.sourceforge.net/selection/felix.html

Also interesting, but more technical:
https://rars.sourceforge.net/help.html
click "Tutorial Part 1,2,3,etc"
It explains in more detail how to code an AI for that racing game. The basic principle should apply for LFS too, just that LFS physics are more complex.
[quote="Gutholz;2037397"]Can you clarify what you mean by "coding the driver instead"?

AI is just a form of algorithms and math, like any other program code.
I have not seen LFS's code but generally AI in video games works like this:

The AI-code takes some data as input and outputs data as control.
In a racing game the input might be:
-car speed
-engine rpm
-car position
-track layout
-car properties (weight, condition of tires, center of gravity,...)
The more input data is taken into account, the more detailed the calculations can be.

and the output would be:
-steering wheel angle
-throttle position
-brake position
-all the other driving controls, like clutch, gearbox etc
Notice that for a non-cheating AI, this would be the same as for humans.
#4 - Racon
Quote from Racer Y :You can't run a whole field of these modded cars in single player. And that makes sense cause you can't just code A.I. cars for every single mod that pops up.

You can do that, unless I'm misunderstanding what you mean? I did all my testing of my mods against a field of 31 various AI cars, mostly mods. LFS just has to do some working out when you try a new combo, then the AI can drive the mods.
Attached images
aigrid.JPG
Well first off. I was wrong about a.i. not using mod cars. Hadn't played in a while. They didn't used to. When did that get fixed?
Anyways, basically what I was saying, trying to say was have all those inputs you code for the a.I. car and put it in a driver. Does that make sense? When the car is being used by a human, the car performs based on whatever we want it to do through various input devices. Like a wheel, a mouse, a whatever. I was saying have the a.i. driver operate the car in the same fashion only like the car, the A.I. driver's input is based on the racing line. I'm sorry, the technical end of this is over my head. What I really mean is having a race in single player where you're racing against the sim Drivers instead of the cars.
It does not really make sense Uhmm
It is hard to understand what you write.
What do you mean by difference between "driver" and "car"?


According to version history, AI can drive mods since 0.7B Feb 14, 2022.
BeamNg use your replay for making an "AI", there is a lot of nodes on the track, each nodes have some information about the car. The AI try to keep the same line and the same speed. When you make collision with AI or just overtake, the AI need to care about the situation. This is not easy to code i guess.
#8 - Racon
I don't know what method Scawen uses for AI, but there was a separate AI-driver project with a huge amount of detail here. I used to follow the driver around as he trained now and then, it was fun to watch his progress Smile
It's very easy, just join any online server and you can drive against human AI's, I've heard they are good drivers Smile

Jokes asside, you fail to understand many basic concepts. AI in LFS is trully learning to drive around a track like a human, but one with like 20-30 neurons, instead like 100 billion (that we humas have), so therefore its capabilities will be very limited. What you talk about smart AI, just look at self driving cars, this is still a cutting edge technology, a lot of money goes into research and developement. This is not a simple task at all, don't expect anything "smart" in LFS, it is as good as it gets. When you drive against AI in LFS, it is able to learn from you when you interract with it.
Quote from Gutholz :It does not really make sense Uhmm
It is hard to understand what you write.
What do you mean by difference between "driver" and "car"?


According to version history, AI can drive mods since 0.7B Feb 14, 2022.

"According to version history, AI can drive mods since 0.7B Feb 14, 2022."
The last time I actually played was in July maybe. I didn't use the mods.

"It is hard to understand what you write."
Sorry. It's hard for me to describe as I'm not all that great with a computer and when I've typed, I just woke up.

What do you mean by difference between "driver" and "car"?
When you play single player, what is it that you are playing against?
And I was pretty much wondering how hard would it be to have a.i. drivers that actually drove the car instead of just holding onto the wheel and could do so at a decent enough level.
I figure it can be done, but is it practical to do so. LOL would it be easier to program A.I. drivers than tire physics?

FGED GREDG RDFGDR GSFDG