LP Editing

LP editing is the modifying or creation of new lp files for Papyrus racing sims. What the .lp files do (they are found in each track directory) are tell the AI cars how fast to go on each part of the track, as well as what line to take. They also govern where the racing surface ends and where the wall is to the AI cars. Here's a breakdown of all the .lp files found in the different sims, and what they do. This guide governs NASCAR Racing sims 1-3, GPL, Indycar, and NASCAR Legends. First we'll discuss what you'll need and each .lp file. For GPL AI please see notes at bottom.

What you'll need...

  • Nigel Pattinson's RpyToLP
  • Robert Szikszo's LP editor

    The AI files (click on the links to see an example)

  • race.lp - this file governs what an AI car does when it's in the racing groove, at racing speed, with no other cars around
  • pass1/pass2.lp - these files govern what the AI cars do when they are with other cars, thereby giving 3 distinct race lines.
  • pit.lp - this file governs what the cars do when they pit for fuel or damage
  • pace.lp - this file governs what happens when the field is under the pace or safety car (not found in GPL)
  • spot1.lp - this governs spotter calls around the track
  • max/minrace.lp - These two files govern the outside limits of the racing surface. maxrace governs the left side of the track (from the driver's perspective) and minrace governs the right.
  • max/minpanic.lp - these files govern the outer limits of ANY vehicular travel...in other words, from the center line out to where the walls are (not found in GPL).

    Creating new lp files using rpytolp and lpedit.

    1) First go to the track that you want to create the AI from. Get familiar with it. Run enough laps where you feel that you are comfortable with the track. Run ALL the different lines, as if you want to create a full set of .lp files, you are going to want to insure that all the lines are as realistic as possible.

    2) Now start your replays. Keep running laps, and then you can cut and pick the one that you like the most. Be aware of when the tires begin to fall off, as you will start losing speed and grip. The laps that you want for your racing lines (race.lp, pass1.lp, pass2.lp)needs to be *smooth*, *quick*, and with racing lines that are realistic. You DO NOT need to get the fastest hotlap that you can for an replay, you want a GOOD lap that is *smooth* and *quick*. There, have I stressed that enough? ;] Note, if you want your AI to clip curbs, drop a tire in the grass, then do the same thing on your race laps...but be aware. If the AI get a wheel off, and they are outside the max/minrace.lp files, they are likely to do wierd things. You may have to move the max/minrace.lp line out a bit.

    If you are creating ALL the racing .lp files, you will need to capture 3 separate laps. One using a line more to the lefthand side of the track (pass1), one using a line more the the RH side of the track (pass2), and of course, the actual racing line that is the most optimum (race). Be aware, on some roadcourses there is only ONE line through some corners...you cannot change physics. So, all the cars will have to funnel through that section of the course, which is realistic.

    3) When you have decided on the laps that you want to use, use the rpytolp tool and convert them to the desired .lp files. Insure that you back up the old ones first. Now, run LPEdit and take a look at the new files you created. You are most likely going to have to adjust a few things using the LPEdit tool (we won't explain how to use it here, read the documentation with it)...because you most likely didn't travel over the exact same spot when you finished your replay lap as when you started it. So you'll need to adjust those so they match up, and the AI cars won't make a sudden jerk coming across the S/F line. Also, you may have to adjust the speed if that was slightly mismatched at the S/F line. Last, but not least, if you find any little inconsistencies (where the dots designating the speed or position do not flow smoothly with the rest of the file) you may want to edit those out.

    If you are creating files for a roadcourse, we've found that it's best to copy the speed from the race.lp file to both pass1 and pass2.lp files (for NASCAR racing, has not been tried on GPL). This give the AI car a decent advantage to hold the corner while being passed or passing, and makes the racing much more realistic.

    Pit.lp Next for the pit.lp file. This is fairly easy to do. First start your lap off in the pits...then race around the track and come back into the pits. Keep doing this until you like the laps from the point you cross the S/F line until you come back into the pits and cross the S/F line again. You do NOT have to stop the car, just drive through the pits using a realistic line. Now save that replay, and use the above steps to finish it off. Be aware, if creating files for tracks with a pit road speed limit, you can adjust the speed to be exactly what you want when you enter pit road. View the maxpanic.lp file to try to judge where pitroad starts and stops.

    pace.lp Another easy one...just drive around the track at a constant speed as if you were the pace car (center of the track). Keep in mind that on road courses the pace car may slow down and speed up. You do NOT need to come into the pits as if you were the pace car, that is governed by the trackname.txt as well as the .lp files. Just constant speed, center of the track from S/F line to S/F line.

    max/minrace.lp These files are a bit more difficult. You have to drive around the track in a position that is at the MAXIMUM limits of where you want the AI cars to race...for example, at Talladega, you would want to create the maxrace file by driving right on the bottom, straddling the apron and track. At the top (for the minrace), you would want to be right out next to the wall, but not TOUCHING the wall (if you do scrape it a few times, that doesn't hurt). The speed does not matter, but it matters that you capture the outermost limits of the racing groove. Save the lap that you are satisfied with (one for the max, one for the min) and then repeat the steps above. See note above for when the racing line crosses outside of the max/minrace.

    max/minpanic.lp These files give the outermost driving area that is possible. Cars do not race on much of this surface, as it covers the track centerline all the way out to the wall...basically anything between both walls is what is covered by the max/minpanic. The way to create these two files is to drive around the track with the car scraping the wall (LH side for max, RH side for min). At times, you may find it difficult to make strange angles and corners, but you can adjust them out with LPEdit later. A good example of what max/minpanic governs was the Watglen chiquane removal by Tim M, where the maxpanic still showed the wall bowing out into the middle of the now-cleared chiquane. AI cars that got slammed into from the rear going into the chiquane would bounce off the invisible wall defined by the maxpanic. The fix was to remove this 'wall', allowing cars to slide all the way through the chiquane.

    spot.lp This file can be created from scratch using LPEdit, and will not be discussed here as it only effects spotter calls.

    Final adjustments and the trackname.txt file Now for your final adjustments. First, get a carset with values that you want for people to learn on. Use the Default carset installed from the game if you want, for the TPTCC series the AI is boosted quite a bit and give a difficult battle. Set the competition at 100%. Go into the race, and check the qual speeds. These are adjusted using the BLAPS value in the trackname.txt file (this file is found in every track directory, and trackname refers to the track...i.e. bristol would have a bristol.txt file). If you are running using the Craftsman Truck Patch...you'll need to adjust the BLAPST. Now, go into the actual race, and either sit in the pits, or run a few laps. Let at least 6-7 laps go by, then check the speeds of the leaders. If the speeds are too high, adjust the RELS (or RELST for trucks) line down. For the full features of what is found in the trackname.txt file, use Tim McArthur's guide here.

    Notes for GPL The GPL AI can't be opened with Robert's LPEdit, so there are a few things that you need to be aware of when creating AI for GPL. First, since you cannot hand edit the AI files, you'll need to be much more careful when creating AI files for GPL. When crossing the S/F line, for example, try to cross at EXACTLY the same point that you crossed it when you started the lap. Second, if you veer of the course too far, and pass the max/minrace lines, you are very likely to confuse the AI. You have two choices if you think this is the problem, either move the AI back towards the center of the track (so that they no longer cross the max/minrace lines) or else create new max/minrace.lp files. GPL also does not have max/minpanic.lp files. This is because the layout of GPL tracks is much more forgiving in terms of having long run-off areas before getting to a wall, therefore the game reads the .trk file for values to find when the car contacts an object.

    When you are done, you will find that the AI probably do not match the speed that you want them to go. Now you will need to find the track.ini file (in the track directory). Open it up, and find these values...

    dlong_speed_adj_coeff =
    dlong_speed_maximum =

    The first value is the same as the RELS in NASCAR Racing. The higher the number, the faster the cars go. The second value is the maximum speed that the AI will progress to. If after a bit of practice they seem to be TOO fast, move the maximum value down if you are happy with their initial performance values.

    Jan Kohl