The online racing simulator
Controlling the car via inSim
(7 posts, started )
Controlling the car via inSim
I am not a very experienced driver in LFS yet but I have some Artificial Intelligence programming knowledge. An idea that I want to attempt to realize is to have a car autonomously drive around a track.

I know this is a major project (would be based on a Neural Network probably) but this post concerns the basic problem: controlling a car.

I've read that it is not possible to directly control a car through inSim, but you can send simulated keypresses. My question then is: how to send axis values (for wheel, throttle, brake and clutch) to LFS by use of keypresses.

Apparantly you can send axis values from a script file, but can you run a script file with a command sent by inSim?

I think it should be possible somehow, since on this forum there is also the rev-limiter app which (I think) controls the throttle, an axis value.

TL;DR
How do I send wheel/clutch/brake/throttle axis values to LFS with inSim?

Thanks for thinking with me.
In a word, no. InSim allows you to get data about the state of the game, and even allows for a level of interaction, but you'd have to make your program into a controller interface if you wanted to control the car in game. You should look at this.
No InSim, but you can always write something to simulate DXInput controls.
Quote from Noodleguitar :since on this forum there is also the rev-limiter app which (I think) controls the throttle, an axis value.

as all this so called 'apps' do, they alter memory values of LFS, which basically is hacking/cracking... (others call it 'tweaking' which then all of a sudden would make it more legal :facepalm
Actually.. I know Krammeh's rev limiter app simply toggles ignition when hitting the limiter (which isn't cheating).

Like Dygear and Keling said, if you wanted to build an AI driver for LFS, you'd need to implement a controller interface on your side, LFS doesn't have that capability. Blackbird has also spent some time working on AI stuff here as well. Looking around the programmer forum you should be able to see his progress.
Thanks, clear answers

I've searched a little on how to simulate continuous inputs, and the easiest way seems to use the mouse as a steering device and then simply control mouse positions from a program. So, x values would be steering and y values would be acceleration and braking.

I said earlier that you could send axis values from an LFS script but that was wrong. It seems you can only change axis bindings with scripts.
You can
  • Control the mouse input as you suggested (which has been done before and works).
  • Proxy dinput8.dll and alter steering input that way (unless you have a wheel with 3 pedals connected to the computer, it's probably not worth the trouble).
  • Write a virtual input device (which would give you best level of control but requires some study of WDK).

Controlling the car via inSim
(7 posts, started )
FGED GREDG RDFGDR GSFDG