Lesson 1
 

 

Ok our first lesson needs to instruct people on the basic of making an AI car actually want to go around the track.

1/ AI positioning
2/ Replay
3/ Conversion - .trk
4/ Conversion - replay
5/ Records


1/ AI positioning..

AI cars are postioned both in the pits and at the start line by values placed in the track.ini file found in your track folder, they look like this for a track that is 6800 meters long and has a pitlane that is about 20 meters offset to the right and goes beyond the startline...

[pit_lane_0]

(*dont worry about this info usually here just yet*)

stall_0 = 100.00 -18.20 (negative values places to the right)
stall_1 = 90.00 -18.20
stall_2 = 80.00 -18.20
stall_3 = 70.00 -18.20
stall_4 = 60.00 -18.20
stall_5 = 50.00 -18.20
stall_6 = 40.00 -18.20
stall_7 = 30.00 -18.20
stall_8 = 20.00 -18.20
stall_9 = 10.00 -18.20 (10 meters after startline)
stall_10 = 6788.00 -18.20 (just before startline)
stall_11 = 6778.00 -18.20
stall_12 = 6768.00 -18.20
stall_13 = 6758.00 -18.20
stall_14 = 6748.00 -18.20
stall_15 = 6738.00 -18.20
stall_16 = 6728.00 -18.20
stall_17 = 6718.00 -18.20
stall_18 = 6708.00 -18.20
stall_19 = 6698.00 -18.20

[ starting_grid_0 ]
; 2x2 staggered grid
; polesitter on right
; track length is <6800.33>
; grid front center at <6786.00, 0.00>
; width between boxes 5.00
stall_0 = 6786.0 -2.50 (4 meters before startline)
stall_1 = 6786.0 2.50
stall_2 = 6776.0 -2.50 (negative places to right of center)
stall_3 = 6776.0 2.50 (positive places to left of center)
stall_4 = 6766.0 -2.50
stall_5 = 6766.0 2.50
stall_6 = 6756.0 -2.50
stall_7 = 6756.0 2.50
stall_8 = 6746.0 -2.50
stall_9 = 6746.0 2.50
stall_10 = 6736.0 -2.50
stall_11 = 6736.0 2.50
stall_12 = 6726.0 -2.50
stall_13 = 6726.0 2.50
stall_14 = 6716.0 -2.50
stall_15 = 6716.0 2.50
stall_16 = 6706.0 -2.50
stall_17 = 6706.0 2.50
stall_18 = 6685.0 -2.50
stall_19 = 6685.0 2.50

You need to get GPLRA and find the exact length of the track using a replay or ask someone like the track builder.

Please study the track.ini in any established track and even move the cars around a bit to test and for practice.


2/ Replay..

Ok jump in a car on your selected track and drive a lap around somewhere in the middle, slowly, smoothly and dont do anything stupid, this is only a test.

Capture the replay as per normal GPL, but make sure you have a couple of seconds before the start line and a coupe of seconds after the start line.

Write down the lap time.

My rule of the thumb is to capture the replay well before the start of the grid box'es and end it near turn 1.


3/ Conversion - .trk..

Install Winmip2 and read instrutions/ask in forum on how to unpack the tracks .dat file, go to unpack and find the tracks .trk file.

Copy the *track*.trk file and e mail it to me for cleaning, track builders should know how to clean their own .gtk before converting to .trk.

PS. E mail me first as I have 70 cleaned .trk files already.

Place cleaned *track*.trk file into the track folder (not back into the unpack folder)


4/ Conversion - Replay..

Ok, listen, this is important !!

If the track has no AI cars for it already, you MUST remove the 6 .LP files in the track folder...

Race.LP,
Pass1.LP,
Pass2.LP,
Maxrace.LP,
Minrace.LP
Pit.LP)

Read that again !

If the track has working AI already then leave them there but be aware that you will delete the information contained in them replaced by your information so you may want to back them up first (I just zip them up and leave them in the track folder)

Ok open up RPL2LP, find your replay and double click on the replay and that will open up in RPL2LP as the drivers name and actual lap time (thats why I told you to write down the lap time).

Note - If you get a message about the 7th surface blah blah blah then your .trk file isnt cleaned or in the track folder.

Click on the lap time and it will highlight in blue, now look in the right hand column and select one of the 6 LP files you wish to create...

Race
Pass1
Pass2
Maxrace
Minrace
Pit

.. click on that selection (it will go blue as well) and click on "Convert".

You must do this 6 times to get each .LP file.

Note - that there are 11 LP files to choose from in RPL2AI, the others are for Nascar games, you only need the 6 listed.

Even though you only have the 1 replay, you can use that for this test for all 6 .LP conversions.

Now go to track and see your AI cars attempt to follow your test lap.


5/ Records..

This is the one that gets most confused.

Records are the values every 3 meters that the AI cars read from and you must have the exact amount of records matched to the track or else your AI cars will drive around in the middle of the track at 40 kmh and just crawl forward slowly in the pits and dissapear.

To get the records correct, find the exact length of the track, say 6000 meters and divide into 3 ie; 6000/3 = 2000.

This track will be close to 2000 records and that is the value that must be entered into the "LP records" value box in RPL2AI.

Notice I said close ? It doesnt always go so smoothly and often you need to change the value by 1 or 2 up or down..

1999
2000
2001
2002

And yes you must convert all 6 LP files again each time you do it as in step 4 above till you get the right value.

From experience I can say that 95% are "+ 1" over the divide by 3 value ie; 2000 for a 6000 meter track, so most likely 2001 records for this track.

If the track already has working AI then the records value is already set for you because it reads from the LP files already in the track folder and thats why it is so important to delete non working AI LP files because they will give a false reading in the "LP records" box.

I hope you get some cars working.

Lesson 2 when I get to it 

 

Go to Lesson 2


Originally posted by Mark Beckman on January 24th 2003 at the M4Driving.it Forum under the thread "Lesson 1"

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