Lesson 3
 

 

Here is some critical tips for producing AI cars that behave, easier to explain to you Guys in shorthand as you have AI experience already.


1. RACE.LP

Most critical to understand...

AI work off the centerline always

AI do not like crossing at or deviations from the centerline at even more than moderate angles and if this angle becomes too great the AI loses contact with the centerline and gets 'lost' and this is the primary reason why AI do not like chicanes, I will explain this later and the solution.

AI work from the given .exe physics and can only accelerate and brake similar to the car you are driving although after saying that there are AI parameters that can improve these physics.

AI get an instruction of speed and distance from centerline every 3 meters of track.

===============================================

This may seem obvious but if you don't constantly think back to these basics you wont understand why they do what they do and
how to tell them what to do

===============================================.


2. Tell an AI car what to do but most importantly where to do it !!

A simple group of LP instructions opened in notepad..

Track meters / AI speed
100 / 50mph
103 / 53mph
106 / 56mph
109 / 52mph

AI think AFTER they get the instruction, say at 100 meters the LP instruction is to do 50mph, depending on what speed they are going at when they get the instruction will result in a delay of various distance

Lets say the AI is doing 48mph when it crosses the 100 meter mark, well all being well it will probably say OK, accelerate and be doing 50mph by the time it gets to the 103 meter mark

Also it works exactly the same in reverse, the AI goes across the braking area LP instruction and maybe doing 110mph when it should be doing 100mph at that point

Well those 3 meters or 1 LP instruction (sometimes its 6 meters/2 LP instructions) of where the AI was supposed to be doing the speed you told it to do (via your race.LP replay lap) make an amazing difference on track especially when they are supposed to be accelerating out of corners or turning in at the correct speed, not hanging around thinking about it while they don't accelerate or run wide cause they are entering too quick.

Hence, now here is the single most important tip for successful AI cars, open your race.LP file (convert it to text thru LPEdit.exe tool) in notepad, copy - cut - then paste the top line onto the bottom of the page like this....

Sample.....

(Original race.LP) 12 records

2.001954,-.0727472,2.110989,3.067962E-03,0 //// THIS LINE
2.004913,-7.013194E-02,2.005944,1.687357E-03,0
2.007365,-6.734256E-02,1.905204,2.399434E-03,0
2.010377,-6.370761E-02,1.81005,2.721246E-03,0
2.012878,-6.033766E-02,1.720046,6.811944E-04,0
2.015642,-5.643012E-02,1.63599,1.686497E-03,0
2.018424,-5.221564E-02,1.558323,2.236471E-03,0
2.021033,-4.774348E-02,1.487403,2.000768E-04,0
2.023675,-4.370533E-02,1.42257,8.01526E-04,0
2.026447,-3.932529E-02,1.364316,1.533981E-03,0
2.028985,-3.504658E-02,1.312467,1.533981E-03,0
2.031439,-3.065706E-02,1.267169,2.572153E-03,0



(Modified race.LP) note; still 12 records

2.004913,-7.013194E-02,2.005944,1.687357E-03,0
2.007365,-6.734256E-02,1.905204,2.399434E-03,0
2.010377,-6.370761E-02,1.81005,2.721246E-03,0
2.012878,-6.033766E-02,1.720046,6.811944E-04,0
2.015642,-5.643012E-02,1.63599,1.686497E-03,0
2.018424,-5.221564E-02,1.558323,2.236471E-03,0
2.021033,-4.774348E-02,1.487403,2.000768E-04,0
2.023675,-4.370533E-02,1.42257,8.01526E-04,0
2.026447,-3.932529E-02,1.364316,1.533981E-03,0
2.028985,-3.504658E-02,1.312467,1.533981E-03,0
2.031439,-3.065706E-02,1.267169,2.572153E-03,0
2.001954,-.0727472,2.110989,3.067962E-03,0 //// GOES HERE !!!!!!!

Why? Cause we are now telling the AI cars what to do in advance so they are doing by the time they get to the spot, not after, how simple is that logic - DUH !

Most tracks require 1 record advanced but some tracks I have moved forward by 2 records and for just 1 track I recall advancing by 3 records for some reason.

Note; sometimes moving forward 2 records can have a negative effect as car turns into corner too soon and can get upset by this and will back off the throttle mid corner.

When want to test, reload race.text into LPEdit.exe and save as Race.LP

This is just one of a few tips coming for AI cars, but this is probably the most important one overall and remember this is only for the Race.LP for good reason as you will see.

Next will be the pass.LP and this is where I get to call a lot of people 'morons' hehe.

Mark

Go to Lesson 4



Originally posted by Mark Beckman on November 25th 2004 at the M4Driving.it Forum under the thread "Lesson 3"

Posts originally converted to html by Jordi Roda aka runrun.

 

 

 

Webpages and downloads hosted by:

Visit the SRMZ site

under the auspices of:

Visit the BCSims site