Is a more consistent AI possible?

Discussion in 'General Discussion' started by Racefreak1976, May 18, 2015.

  1. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    Hi,

    I really have no idea about how the AI in rFactor works but I noticed that without changing the percentage they are driving very differently on different tracks. I know this has to do with AIW somehow.
    Since the AIW is mostly done by the guys who make the tracks it is a possible restriction to the AIs full potential.
    Is there a way or possibility to let the AI decide their own line with only the apexes as orientation markers for them or is this impossible or too much effort with too little gain?

    If there is somebody out there who knows how AI is coded and how it generally works. Please take the time to enlighten us! :cool:


    Racefreak
     
  2. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    you can create different AI Lines for different AI drivers but it takes a lot of work, if you have the time it's probably worth it. Other than that the AI Learning options kinda give them a bit more variation but nothing majorly different.
     
  3. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    I thought maybe giving them only the minimum needed information about a track would make them more varied. Like safest braking point, latest braking point, apex coordinates and earliest acceleration point and possibly the angle of the turn. It's not so much about variation in driving behavior, the AI in rF2 is already outstanding but what I'm really interested in is having them be consistently difficult to compete with on any track.
    I don't know if there is anything else needed since I have no clue about how AI works really.
     
  4. matf1

    matf1 Registered

    Joined:
    Dec 27, 2011
    Messages:
    671
    Likes Received:
    2
    *I do believe ISI has something in the pipeline for this, just what I've gleaned from tidbits here and there. It wouldn't surprise me if it works like you say.

    When you create AIW paths, you start with a central line, then add a fast path and left and right paths are calculated from this.
    You can modify these if you wish but I've found it works best in most cases to leave it(better transitions between paths)

    So this fast path is the key to it all. Some modders can't drive, simple as that. Whether it be a technical or other reasons, I've seen some shocking paths where it's clear the modder did not read the instructions and by the looks of it, gave up after 2 attempts.

    rFactor 1 conversions generally need the AI paths redone and block paths added but this is rarely done.

    You need devmode and notepad.
    You can use tools such as Noel's MAS file extractor rfcmp Installer to add the track to devmode(with a gentle massage)
    Load the track, jump in a car, click on AIW in the menu, go into path sub menu.
    You can see each path and re-record them at will.

    Get devmode here: http://rfactor.net/web/rf2/devscorner/
    And see here for info Track Modding

    Yes you will need to research a small bit
    Yes some things will go wrong and you might swear
    Yes you can learn it all in an hour
    Yes you can fix the AI on all your favourite tracks
    :D

    Seriously, don't be intimidated. If you can change some settings in json, you can do this!
     
  5. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    Thanks for all that. To be honest I don't even know what json is! :( Guess, I'll do some research on that.
    Thanks matf1!
     
  6. Spinelli

    Spinelli Banned

    Joined:
    Jan 28, 2012
    Messages:
    5,290
    Likes Received:
    32
    Json is the text file for your player file, etc. It used to end in ".plr" therefore ppl called it the plr file (and still is with pre-RF2 ISI engined games like SCE, FT, RF1, etc.). In RF2 - as of a year or two ago - it became the json file because it now ends with ".json" instead of ".plr". The entire filename is called "player.json".

    In the player.json file you can change many things like some graphical vibration/movement settings, setting a max-framerate limit, temporarily saving replays to your RAM rather than to your main drive during the session (the full session's replay then get's transferred - once the session is over -to your main drive for permanent storage if you have saving replays enabled), some A.I. settings, etc.
     
  7. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    Aaah! Thanks Spinelli. That helped me a lot. Of course I know plr files. But I wasn't aware they had changed the filenames. :)
     
  8. Spinelli

    Spinelli Banned

    Joined:
    Jan 28, 2012
    Messages:
    5,290
    Likes Received:
    32
    No worries, man :)
     
  9. peterchen

    peterchen Registered

    Joined:
    Oct 25, 2011
    Messages:
    2,099
    Likes Received:
    287
    With certain settings in .AIW-file and good differing Talent-settings, you can maximise the "individual" learning-effect
    of AI, so that they can end up in having all (or most of them) different lines (after training and/or creation of .wis-file)!!
    But they don´t have such a good "RADAR" to know how to drive fast without AI-waypoints.
    Without AIW it would probably end with a very loooooooong learning-cycles for each car, eating up CPU-performance...
     
  10. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    Ok, would it be possible to let the AI "see" the lines at the edge of the asphalt? So they know where it is relatively save to drive. Then they would need to know how far away the next corner or braking point would be. The rest is just math. Right?
     
  11. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,035
    Likes Received:
    1,654
    AIW already knows the edge of the driveable surface. That's called "corridors" in rF speak.

    Braking point, however, is different for different cars. The AI calculate their braking point off the AIW line, which is why a single AIW works, but multiple AIWs work better. It is possible to set special braking points, but that's usually intended for situations like entering the pits or corners where the AI just keeps plowing into themselves.
     
  12. peterchen

    peterchen Registered

    Joined:
    Oct 25, 2011
    Messages:
    2,099
    Likes Received:
    287
    Racefreak:
    I understand what you think/mean.
    I had that ideas too in the past and I agree that the AI-learning, or the math how they interpret a track or AIW-line
    should be more "open-minded" from an AI standpoint.
    But believe me, this completely "AI finds the way on theire own"- way, is not reasonable nowadays.
     
  13. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    yeah it's way too complex to work how you want it too Racefreak, going back to my earlier point about individual driving lines for AI - what you can do is (for example) create 3 different Lines and assign 7 AI to each one. That way you save a bit of time as opposed to giving each individual AI their own Line and you still get a sense of AI choosing different lines.
    It's a lot of effort and IMO not really worth it unless you really want it and have the time, plus if your Race is gonna be a long one that helps, absolutely no point going through all that effort for a Sprint race!
     
  14. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    Marc,

    my point is not having AI choosing different lines. I'm happy with it as is. What I really want to find out is if they can be consistent according to set difficulty on any given racetrack. Mainly because I use "invisible" AI cars in my practice sessions and compare my times against theirs. Only to know how I am doing. The thing is, without changing the difficulty they appear to me as superhumanly fast on one (well, they are AI after all but still) and on other tracks they drive worse than my grandmother and she has never had a drivers license (not literally of course but in terms of laptimes ;)).

    In short, the laptimes of AI can't be trusted sometimes. I just want the TIMES to be somewhat reliable on every track.
     
    Last edited by a moderator: May 19, 2015
  15. peterchen

    peterchen Registered

    Joined:
    Oct 25, 2011
    Messages:
    2,099
    Likes Received:
    287
    No way to achieve this, other doing new lines on bad tracks and repack them.....
     
  16. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    So it all come down to AIW in the end, I see. There should be a better way to handle this. Too bad I have absolutely no clue about AI coding and such. My logical abilities are somewhat ...not present. ;)
    Speaking of AI, has anybody seen Ex Machina? Crazy flick! The ending is kinda stupid though.
     
  17. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    yep therein lies the problem, ISI *could* achieve something standard across all their tracks but then different mods act differently with AIW so it's all up in the air.....then you have the community tracks AIW and well not all of them are "good" to start with.
    Afraid to say there's too many variables for it to work simply enough, that's what you get with a complex game, for the shortfalls however the AI is still one of if not the best of any Sim right now.

    The only answer is to change the Strength until the AI lap times suit yours.
     
  18. Racefreak1976

    Racefreak1976 Registered

    Joined:
    Apr 16, 2012
    Messages:
    1,085
    Likes Received:
    63
    Last night I did a 1.5 hrs practice session at Macau in an Audi R8 LMS. At the end I was almost 10 secs behind AI with a fastest lap of 2:30 mins. AI was in the 2:20s! I couldn't go any faster if I wanted to, so where are those ten seconds?
     
  19. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    That's what I mean, you need to fiddle with the Strength setting until the AI get closer to your time. The fact they are 10seconds faster is neither here nor there, they run on different Physics and behave differently from you or I. If you're trying to compare lap times to the AI then I'll suggest you stop that and pop online against fellow racers, that is a much better way of comparing lap times and of course much more "realistic" than the AI could ever be.
     
  20. peterchen

    peterchen Registered

    Joined:
    Oct 25, 2011
    Messages:
    2,099
    Likes Received:
    287
    Yes, that´s the other thing to look at:
    How is AI-strengh of given mod compared to what is possible for humans....
    Many mods are not correctly calibrated.
     

Share This Page