1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Legend AI Tweak - Finding A Middle Ground Between Legend and Pro

Discussion in 'F1 2012 Mods' started by Christopher Greer, Oct 4, 2012.

  1. Download link for Excel spreadsheet:


    The Mod
    Over the last week I've been experimenting with some tweaks to the track_difficulty tables in the database file to find a middle ground between Legend and Professional difficulties. Personally, I find Legend just too hard and Pro is too easy for my tastes. Modified legend AI sets realistic race lap times and retains all the aggressiveness of regular Legend AI without the superhuman lapping speed.

    Background and Method
    I'll give some explanation on my method of modifying the difficulty below, so feel free to skip this section; this background is only to justify my method to other modders who might be interested. To bring the Legend AI down just a bit I've modified the track_difficulty values using the following algorithm:
    So for each track i we take the average difficulty between Pro and Legend, then multiply it by 1 plus some scalar multiple of the standard deviation (sigma) of the averages between Legend and Pro (mu). This method preserves the intrinsic differences in difficulties across tracks at the Pro level while bumping up the difficulty by some constant amount. Thus, the AI behave relative to their Pro difficulties, but scaled up by some factor of the variance in averages between Pro and Legend difficulties.

    Previous attempts had used a deviation between Pro and Legend as the scale factor, but that just ended up making tracks where the Pro difficulty was relatively weaker much harder and not properly preserving the relative difficulties.

    The mod

    Okay, maths over with let's get on to the mod. I've put together a spreadsheet that contains some possible difficulty levels for various levels of theta - ie. how many standard deviations to scale the difficulty up by. See the link at top to download it from RaceDepartment. The three columns at the right, coloured in blue, green, and red include the values you want to copy over to your database.bin file. Blue is 'easiest', then green, then red, corresponding to theta values of 1, 2, and 3 times the standard deviation to add.

    The values are sorted in the default track order you will find when you open the database file with RDE so there's no need to hunt around to make sure the ID's match up.

    How to add this mod to your database.bin:
    1. Open up the database.bin file with RDE
    2. Find the track_difficulty table
    3. Highlight and copy the series of difficulty values you want in the Excel spreadsheet
    4. Highlight all the values in the Legend column of track_difficulty and paste in the values from the Excel sheet
    5. Save and enjoy slightly less quick but just as aggressive Legend AI!
    Please provide any feedback on this mini-project and play with the formulae in Excel to tweak them to your tastes.
    If this gets some half-decent attention, I'll put together some database.bin files for download in the future.
    • Like Like x 5
  2. Chris Stacey

    Chris Stacey
    Ted Kravitz Appreciation Society Staff Premium Member

    wow! thanks! will try it now!

    EDIT: Just tried the "red" (most difficult) column, and it works like a charm! However, it's a little too easy, not as easy as Pro difficulty, but still a bit too easy. I think it would be a bit better if the values were increased a bit.

    And thankyou so much for your detailed work!
  3. I am looking forward to trying this out. Seems like a gross oversight for CM not to have included a difficulty that accurately reflects real-life times, much less a majority of the serious player-base ability. I will report back after I give it a go... Thanks for your work and time on this.

    **edit** First impression with Spa was great, however rain and strategy ended up outweighing actually race performance. Toro Rosso ran 9th-12th most of the race on primes, started raining on lap 8/11. putting wets on instead of inters allowed me one less stop than the AI putting me across the line in 2nd. Without that extra stop by the ai, an 8th or 9th place finish was likely. Good stuff. Will be doing more testing today with hopefully dry conditions to eliminate variables.

    It may well be that adding one more "tier" to this towards the default legend levels (one step higher than the highest you know have) will be the sweet spot for many, especially those running shorter 25% races since the AI is notoriously slow on the opening lap.
  4. Looks nice, i will try that for season 2 and maybe i go back to legend (standard) on season 3. :)by the way... i know that this is no easy task but... is it possible to change the individual AI car? Agressivity, speed, etc. Lets say, make Alonso faster and more agressive than Massa for example or Grosjean better on Qualyfing but careless on the race.
    Thanks by the mod!
  5. Hey now this IS a really fantastic idea... cannot wait to try it out !

    Thanks mate :)
  6. cant wait to try this out!

    I have been experimenting with this myself and will be interested to see what your calcualtions produce.

    well done
  7. A Very Logical and Impressive Solution
  8. Thanks, great math.
  9. RDE have a problem (failed to convert), can you upload edited database? (with red parameters)
    • Like Like x 1
  10. mydriaz

    Premium Member

    I'm impressed by your job, solution looks simple to apply.:geek:
    Gonna try it asap.
    Many thanks.:)
  11. I just won in Toro Rosso in Monza using the (3x deviation) with a bit of blocking on my part but nothing drastic. Qualified 3rd for the race as well. What I am thinking is the ai still a tad slow. They were crushing me in sector 2 but likely due to my setup package. The AI acceleration out of corners was very tough for me to match but doable in most instances.

    What I thought to do was to take the average between your 3x stdev and default legend values. (3xstdev+DefaultValue)/2

    It is simple math compared to your work but it may provide an extra tier for those that are just a tick below default legend competitiveness. I am included an amendment to your file for those interested in trying these values. Thanks so much again for crunching the numbers on this. Masterfully done!

    Here is the amended file:

    Attached Files:

    • Like Like x 1
  12. Just gorgeous ! Thanks you sooo much for sharing this!
  13. @SMeadows: Nice work, I like that idea a lot. I just checked your file and the average difficulty is about 0.97 so it should provide a very competetive challenge. I bet that with those values the AI puts in times very similar to this year's race pace.

    I'm going to redo the Excel file when I get some spare time to be a bit easier for people to use. If you don't mind I'll include your values with credit to you for the modification.

    In regards to this point, you can modify the individual drivers 'statistics' on aggressiveness, entry speed, exit speed, wet performance, etc. I haven't looked into this too much but I know that AI modders from 2011 did produce new database files that tinkered with these values.

    As for changing their behaviour in qualifying vs race I really can't say how that can be done, if it can be done at all. I created this mod mostly to help with qualifying tbh. I found that with stock legend I could keep up during races but I would just get massacred during quali.

    Thank you for the positive feedback everyone. I'll be putting some more work into cleaning up the file and releasing a set of database.bin files ready to go over the next few days.
  14. Sure thing Christopher! This seems to have been a mass oversight on the part of CM to NOT put an AI difficulty level in for the "wheelhouse" of a majority of us drivers. Glad we have folks willing to put in the effort to improve simulation. :)
  15. Now i know what you are talking about, when i opened the database to put your settings i saw the driver statistics, probably there isn't a way to change race/qualy.

    With me is the oposite, i can qualify on legend but the races aren't going so well :(
    Im always doing something stupid and then the AI catch me, with the modded database now is looking better! Thanks for the math, nice work! :)
  16. hi, i open up track difficulties but the table doesnt show up like in your excel file..... it's totally different, any help is much appreciated. I would like to lower the legend quali time laps.
  17. You want to lower the value of the "expert" column, it is not listed as Legend. The default values are all at 1 with the exception of Monza. As for changing Q times, I am unsure as to whether or not that can be done as easily, and most definitely not from the track_difficulty table. I have not delved very far into the file tables as I am mostly happy with everything. So I cannot tell you how best to change those values with regard to Q times vs. race times.

    Q times are tough for me as well. Seem to be 2-3 seconds off no matter how hard i push.

    I will say that I have noticed it quite hard to qualify well in toro rosso, have yet to make it out of Q2, but race pace and strategy have me scoring points in most races. 10th in point in week 17 and a ferrari ride secured for next season thanks to my rival Massa being terrible.

    There may be some clever modders out there that can figure out how to balance Q vs. R times to be a little more consistent but I am holding out hope that CM can make some tweaks on their end to bring things more in line. Having too many mods/edits this early on can become cumbersome when a game is still being updated almost daily.
  18. Hello, just quick question, this database modification can work for a started career or i must start a new one for it work ?
  19. thx for the info ;), also i had as a rival massa and beat him in the first season but i didnt get the ferrari position ....... maybe cause i switched to sauber mid season... idk
  20. Someone can upload the edited database? (with red options)
    • Like Like x 1