The online racing simulator
Car driving lessons InSim (WIP)
Note: This concept is still in progress and not publicly accessible at the moment.

The goal is to learn basic car controls and obey traffic rules.

The idea is to have a multiplayer server so several people can do driving lessons in parallel. Also, people can compare their progress with others. The server will be using Layout Square because it has the largest open area for the lesson layouts to fit in.

When you join the server, you will be presented with a list of driving lessons. Once you complete a lesson or a set of lessons, new lessons will be unlocked for you. When you select a lesson, you will be spawned automatically at the correct starting point.

To be able to check correct usage of various car lights and switches during the driving lessons, each player will have to have a special application running on their computer, which will connect to the local LFS instance via OutGauge and send lights and switches information to the server using special InSim commands.

Main features:

- AI traffic
- speed limits
- car lights and switches checking (turn signals, lights, handbrake etc.)
- pedestrian crossings with marshalls as pedestrians
- multi-lane roads
- intersections with traffic lights
- traffic signs (using InSim buttons or custom autocross layout sign textures)

Example lessons:

- car starting procedure
- uphill start
- downhill stop
- 3-point turn
- reverse parking
- intersection with traffic lights

I will use this thread to post progress of the features.

Ideas and suggestions are welcome Smile
Sudden braking, L parking, parallel parking, driving back 25-50 meters, what to do on bumps, and vehicles with road priority should definitely be included in this study.

Additionally, the use of ribbons and mirrors may be among the things that should be emphasized in this training.

Thanks for the work.
Emergency Stop, P Parking, Straight/Reverse Parking, U-Turn
They should stop before the pedestrian crossings, and if there's a traffic light intersection, their front wheels must not be after the line, use indicators when changing lanes
Quote from Flame CZE :[b]Note: This concept is still in progress and not publicly accessible at the...

maybe already mentioned but moose test should be fun Smile
Quote from Flame CZE :[b]Note: This concept is still in progress and not publicly accessible at the...

Hi

Interesting that someone else has had the same ideaThumbs up

But, I think, instead of creating a new layout, why not use the Blackwood or Westhill layouts? They are already made, Blackwood could be more for city driving, and Westhill for country driving lessons. I have to say I have no idea if this is possible, but say you could put traffic lights etc elements into those layouts, wouldnt that be perfect?

Mp
You're right, making use of the existing open config areas would be nice as well. There's one issue though - they are designed for left side driving only, so in order to support right side driving too, the road markings and signs would need to be updated in the layout.

I've already got a simple traffic light system in place so I can put them into the layout.

I think I'll start with a single player local InSim app for now and maybe extend it to multiplayer later.
Perfect, my wife just started driving lessons in real life. This should come in handy. Tnx man, looking forward to a public releaae.
Quote from Flame CZE :You're right, making use of the existing open config areas would be nice as...

Hi.

Is there anything you like to share with us, a layout perhaps?

Thanks,

Mese
I haven't worked much on the driving lessons layout, but I've got a server running called [WIP] City Bus Driving where I've started working on a traffic driving layout primarily suited for buses, with the help of a few other players.

For driving lessons style server, I suggest joining [RL] Real Life 1 where you have to take some driving lessons and take a test before you get a driving license.
Attached images
lfs_00002005.jpg
lfs_00002004.jpg
lfs_00002003.jpg
Quote from Flame CZE :I haven't worked much on the driving lessons layout, but I've got a server...

Hi

Just awesome man!!

This is just what we need to get better drivers.

Would be intersesting to have a "drivers day" with some entusiasts driving around, I guess theres no way to implement AI drivers into this layout?

Mese
There is a way to control AI drivers now using a new InSim packet. I would like to do that at some point but it will be a big project for me.
Ok, would be nice to understand how to work with Insim..
Actually communicating with InSim is the easier part Big grin You listen for specific packets coming from LFS telling you about the current state of the car (speed, acceleration, position etc.) and then send other packets telling the AI car what to do (turn the wheel, accelerate, brake etc.) in regular intervals like every 100 ms.

I've got a very early prototype where I tell an AI car to drive at a constant speed using a PID controller:



Source code here

The harder part is to make it so that it follows the given path, obeys traffic rules, avoids collisions etc.
I'm really impressed with your work. I think you have to have some experience in programming to be able to use Insim, you can't start from scratch, it will take ages to get anything done.
Obviously, knowing various algorithms is a must.

Well done with that PID loop, it's tuned quite well.
I like the creative use of objects in the layout to overcome some of the current limitations Smile especially distance markers for the bus stops; hopefully the big update will help in this regard.

As we discussed already for the PID, I think you could improve it by feeding the output of the speed PID to a throttle PID and a brake PID to allow smoother braking, but this is already looking pretty good. And then maybe state machine/behavior tree and things like that to control the overall behavior of the AI? Definitely a big project
Quote from Bokujishin :..I think you could improve it by feeding the output of the speed PID to a throttle PID and a brake PID to allow smoother braking..

That is exactly how a PID loop works - its output is fed back to the input in a certain way and multiplied by 3 constants, each corresponding to a particular contribution: P-proportional, I-integral, and D-differential. Making it slower/faster/smoother is a matter of tuning a PID loop, where those 3 constants are adjusted for the particular system and desired performance. The PID loop for XFG in the video is very well tuned, as the set speed is reached quite quickly without any overshooting or undershooting.

If he tunes it such that the car brakes or throttle more smoothly, it will result in a slower acceleration/deceleration, which may be ok for a traffic NPC car. That can easily be done by lowering P and I constants.

In a very similar way, a PID loop can be used for steering to allow the car to follow a predefined path - this is what AI in LFS does at the moment.
The fact that the current PID is nicely tune (I do agree it is) is actually what I was thinking has room for improvement: as you said, the set speed is reached quite quickly - too quickly for smooth driving actually, especially in braking - and controlling acceleration instead of speed directly would allow for more flexible driving. Of course, changing the current coefficients depending on the situation might also work, but has more room for mistuning.

My suggestion was based off my experience working on a drone simulator a few years ago, which has stabilized flight modes, one of which allows controlling speed directly: by moving the stick, you control forward/lateral speed, with their own PIDs, which then gets fed to the angular speed PIDs, which then feed into the pitch and roll PIDs.

Car driving lessons InSim (WIP)
(19 posts, started )
FGED GREDG RDFGDR GSFDG