January 23, 2018, 07:48:30 AM
bigger smaller reset 800px Wide width Full width Reset * *


Welcome, Guest. Please login or register.

Login with username, password and session length
« previous next »
Pages: [1] Go Down Print
Author Topic: How To Develop ai (a SHORT COURSE)  (Read 4643 times)
Sr. Member
Posts: 188

« on: April 27, 2012, 04:05:41 PM »

How To Develop ai  (a SHORT COURSE)

Whether you're starting on a new track, or re-doing an existing track, this is the progression that will yield the best results the quickest.
All values suggested are merely a guideline. Using slightly higher or lower values depends on the track (track type, configuration such
    as width, banking, etc.), series (cup, gns, cts, pta, gtp), basic track.ini [ track ] settings, and the way you want the cars to
    run (from easy to a handful).
If you're making ai for public release, I suggest the 100% "Opponent Strength" produce ai laptimes that a "VERY GOOD" Player is
    capable of running. If you're pushing "alien" status, I'd tone down the ai a bit. Likewise, if you're an "average" (or less) driver,
    I'd step up the ai's ability a little. {If you can get some results of a good league that runs the type(s) of track(s) and series that
    you're working on, that'll give you some indication of where you stand. You may have to do some extrapolation from one series
    in order to determine what's probable in another series. Once you've established your base, you develop the top ai to run 97%,
    or 100%, or 104% (or whatever it is) of your laptimes.}
     Successful ai are made up of a gazillion properly executed little details rather than some bright
     idea demon tweak or radical notion that's going to turn the whole simworld upside down and
     set fire to it in the bargain.
 (Or maybe set it on fire first and then turn it upside down.)        
     [...with apology to BS Levy.]

      ***************         ***************          ***************
   If you have any comments or questions, please start a new topic in the General Discussion forum.

      ***************         ***************          ***************

[ track ]
1. Set racing surface grip values (asphalt, concrete, paint).
     Start with low vaues, 1.00 - 1.03 for all series, except gtp (1.05). Higher grip values (1.1 - ? ? ?) just makes it harder to loosen the setup
     for fast laptimes.
     [Owr, using pta.exe, is another world and requires special consideration for the placement of surface types and grip values for those
       surfaces. Just substituting a high grip value will lessen the open wheel experience.]
2. Tire wear values:
     track_tire_wear (how prone the tires are to deterioration)
     track_tire_wear_loss (how bad they deteriorate)
     track_tire_wear_exp (the way they deteriorate over time).
        Testing has shown:
        1. The performance loss starts within the first few laps and the lost time per lap continues progressively throughout the run.
        2. The higher the value, the less the total impact on performance there is throughout the entire run.      
     {The easiest way to determine what these values might be is to use the values from a similar type track, especially if you like the results
        they provide. After some track time by both you and the ai, you can adjust the values to suit the particular track and the action you're
        looking for. These values affect both the Player and the ai, while [ ai_track ]/ai_tire_wear_left(right) or
        [ ai_track_(series) ]/ai_tire_wear_left(right) only affect the ai.}
3. Determine tire heat needed:
      You're going to want to be able to drive a lap as as quickly and consistently as you can. This is going to take (at least) half of the overall
         time it takes to develop ai. While you're learning to be quick, this is when you need to work on a setup that'll allow you to do that. After  
         a couple of laps, watch the tire temps for an entire lap. You'll want the tire temp to be 200 - 210F* the maximum amount of time during
         a lap. Long, fast straights raise tire temps dramatically, so it's okay if the temp exceeds 220 as long as it drops back to 210 or less fairly
         quickly (or at least before you really need the tires to work at full capacity).
* The tire heat range for track_type=5 (RC). Each track type has it's own optimal tire temperature range. The high value for the average
      hot/optimal temperature range should be about 5-10 degrees below the temp value where the "white" number turns to "yellow". This allows
      for some leeway to run a tire hotter at more demanding sections of the track without exceeding the optimal tire temperature range.

Once you know the racing line and you're proficient on the track, create a race.lp
     {See: HOW TO MAKE A RACE.LP}.
     Make a copy of the race.lp and rename it raceline.lp; you can then run laps with this line enabled,
     (Options/Controls/DrivingAids/ShowIdealRacingLine) or (keystroke 'r'), so you can see how the ai react with the race.lp. With no other lp's,
     the ai will follow this line closely, only varying from it when the physics allow them to shorten the path or use more track to better maintain
     speed and momentum.

Next, make the minrace.lp and maxrace.lp. These are the extreme right and left distances of the racing surfaces that the ai are allowed to
    run (they'll run beyond the line as long as two tires maintain contact with the lp line). {min_ is always on the right, max_ is always on the left
    in the foward direction of travel.} These two lp's should (normally) be located no wider than  it takes to contain the ai to bonafide secondary
    racing lines. On long straights these two lp's may be farther apart to allow for extra passing, but they should be brought back within secondary
    racing line position before the next turn to avoid collisions. If the minrace and maxrace lp's are too far from the race.lp, the ai will try and use the
    extra space even if it's not beneficial to a passing attempt. This will put the ai out of position to make the turn and will cause them to
    unnecessarily lose momemntum and fall off pace.

Make minpanic and maxpanic lp's. {You can copy the minrace.lp and maxrace.lp at the beginning. Once you have a better feel for where trouble
    occurs, you can make specific lp's.} These lp's are for collision avoidance only. If the ai cannot stop fast enough, they will go as wide as these
    lp's to keep from running into another car. The location of these lp's are not particularly critical, just allow some extra room at known trouble spots.

Make pit lp's.
    {See: Pitroad, Pitstalls, and Pit lp's  "HOW TO"}
    At least two lanes (pit lp's), far enough apart to allow side by side travel, are required to keep pit accidents to a minimum. One lp (either minpit0.lp
    or maxpit.lp depending on which side of the track pitroad is located) is placed just outside of the pitboxes, and the second lp (pit0.lp) is then
    placed at least one lane closer to the track.

Before proceeding with the [ track_ai ] values, have a roster of ai opponents (2 - 6), for which you can predict their capabilities (laptimes and driving
    ability) on known tracks. That's a track(s) where you know what YOU can do, and what the ai can do.
Ideally, you'll want 1 or 2 ai that run laptimes equivalent to yours on a known track. This will give you an idea of where the [ track_ai ] values are
    because you know how you're running. It's best to keep the min/max ai ratings to a differential of no more than 10 for these "top" guys, with
    minimums no lower than 75 or 80 and maximums of 95 or less. {Your abilty is going to be the determining factor on how high they can be.}
    The other ai can be something not as high, but you don't want them to be to inconsistent (you're looking for predictable behavior) so
    min/max ratings shouldn't be more than 15. While it's not a major factor, I rate all ai 80min/80max for "Qualifying", it generally puts the fast cars
    in order, makes qualifying consistent, and once you're done with all the ai racing parameters it provides a good benchmark for establishing
I include an ai that has 100 ratings (min and max). This provides a quick read to see the effects of changes you make. A bonus, so to speak,
    if you're as fast or faster than the 100 guy, you obviously need some major track.ini changes. (The "PitCrew" ratings don't need to be 100 ***,
    you're only interested in on-track performance. Only use 99 or 98 for PitCrew/Strategy, at 100, they often out think themselves, figuring they're
    good enough to stretch a fuel run, but coming up short.) {*** The Player should set "PitCrew" ratings at 100%. "PitCrew" ratings are the only
    ratings section that applies to the Player, the "Driver" and "Vehicle" ratings have no affect on the Player's car.}

Establish a fast.(series).sim setup.
This may be a setup from another (similar) track or a copy of the setup you've developed for the track. Sometimes one is appreciabely faster than the
    other. Trying the ai with different setups and then comparing the resulting laptimes is the only way to determine the best "fast" setup.
The ai don't always react positively to a "real" setup. The ai tend to work best with a "generic" setup, tending toward medium to soft springs and mild
    bar stiffness. Degrees of wing doesn't seem to have as much of a grip influence for the ai as it does for the Player, but it does have a substantial
    effect on the ai's top speed.
Gearing should be the same as the Player, or a little higher. If the ai are a little quicker getting up to speed than the Player, it's easier to equalize the
    baseline ai and the Player with (setup) gearing before adjusting the "[ ai_track_(series) ] ai_accel_modifier and ai_drag_modifier" parameters.

Tweaking the top ai to match the Player.
All adjustments are in the [ ai_track ]/[ ai_track_(series) ] sections.
1. Set top speed (not in the draft) by adjusting "ai_drag_modifier".
2. Set ai laptimes by adjusting "ai_grip_modifier". This value is relative to the race.lp. If the race.lp is changed, the "ai_grip_modifier" may need to be
        re-adjusted. [Anytime the ai are too fast (or slow) overall, assuming it's not the ai ratings, this is the parameter to adjust.]
3. Set "ai_accel_modifier" to match the Player accelerating out of a corner. [This value has little, if any, affect on starts/re-starts.]
    Set "ai_decel_modifier" to match the Player decelerating into a corner.
4. Set "ai_inverse_slipcurve_k". Reduce the value until the ai break loose as easily when you bump them as you get loose when the ai bump you.
        This has the added benefit that the ai won't have a superior cornering ability over the player (assuming the player has some cornering skill).

This will get the ai "in the ballpark".
From here, it's a matter of fine tuning. Redo the race.lp, minrace.lp, and maxrace.lp if necessary to improve the racing line and secondary racing lines.
Adjust the [ ai_track ]/[ ai_track_(series) ] parameters to reduce accidents, encourage passing, and pit at the appropiate times.

More detailed information:
ai Ratings Tutorial / Make a Custom Roster
N2003 LP Files
ai Development Tutorial / ai_adjustments

Pitroad, Pitstalls, and Pit lp's HOW TO
Reflap (NR2003 lp Creation Tool) "How To"
Grip level value for NR2003
« Last Edit: May 07, 2014, 07:10:25 PM by fortine_oo » Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by SMF 1.1.15 | SMF © 2006-2008, Simple Machines
Leviathan design by Bloc | XHTML | CSS