Just a quick update here for those interested;
I have been doing some more of the technical design, for ease of use (to switch from project to project) I decided to make AIWorld be the main point of access. The project/simulator has no idea about the AI Drivers, or anything about that. Instead it has a bunch of different structures to communicate with the world. I have still been working with LFS at this time, though the AI part of the project should be able to be placed in any other project.
I've named the project as well. A.I.R.S. Short for; Artificial Intelligence for Racing Simulations. I am not looking at creating gaming AI - and as stated before I have no idea or intentions of this AI actually being competitive as it is all experimental. That said my main connection with LFS is written inside the "LFS_to_AIRS" conversion file. This file has handlers that receive InSim, OutSim and OutGauge messages, and using these messages it will update the AIWorld.
I also have an idea of how I want the driver to deal with the world through the PhysicalSensor, VisualSensor and CarController; however not all the details have been worked out. The limitations -should- be placed within the sensors themselves, before it even gets to be used in the AI brain, however since I want to allow the AI to follow a line directly (as the first stage) then the sensors will likely need to change or something.
I have setup my very first, very simple, test situation at the autocross park. About 50 meters in front of the starting location I placed two green cones; for human use and saved that file as "AI_VIEW". I also placed a blue cone in the center of the two green ones, and named that "AI_DRIVE". The Ai Drive layout will be loaded since currently I look for the blue cone - and I realize this will get more challenging when it comes times to support additional tracks
- and make that the AI's destination. The AIWorld starts in state AIWS_GRID_WAIT
, which means the driver is waiting for the lights to come on. then it will move into stage AIWS_GRID_WARM, which means the driver should shift into first and get some throttle input to increase engine revs. Finally the state will change into AIWS_RACE_GREEN, which the AI should start driving.
However, currently I need to work on the shifting. I did shift the car into first, although it doesn't happen in the game so I need to work on the "CarControl" class; which will end up being where driver reaction times come into play and the whole "PrepareTo(SHIFT)" thing will come in to make things more realistic for the AI, although harder on the programmer!
I've also been thinking about my "layered" driving system, where the first layer makes the controls that the driver wants to happen; even if its 100% throttle in an LX6 while cornering. Then the next layer looks at the controls from that, and modifies it; so that the throttle is not 100% since this layer knows it is likely a bad idea. The next layer handles things that have become a problem; understeer/oversteer etc. And of course another layer will handle the shifting and other actions of the driver to keep the car within the preferred power-band. I have yet to figure out technically how I want to pull it off. And I also have yet to figure out how to add the 'emotions' to the AI; the stress/business that effects things like reaction time and sensory input.
Of course that will come in time, for now I just want to drive the car from the start point, through the green cones; and then add more points for the car to follow. Of course this is following a predetermined driving line without any visual sensor input; but I've got to make sure I can drive the LFS car before I try the experimental stuff!
Thanks for reading, hope you enjoy and show the support!