AIW: some Q's about some entries

Discussion in 'Track Modding' started by Kev, Dec 7, 2012.

  1. Kev

    Kev Registered

    Joined:
    Oct 28, 2010
    Messages:
    156
    Likes Received:
    0
    I'm writing my own AIW editor.
    I've found some entries in AIW that i don't know what they mean and what to do with them.
    So i hope on help from community and dev's.
    Let's take for example Malaysia_NLoop. Thats what we have in it's AIW:
    wp_pathinfo2=(4,-4.6143,0.1165,42.2623)
    wp_oriantation=(4,0.0086,1.5775,-0.0234)
    wp_pathrecrad=(4,-0.0025)
    wp_pathflags=(4,1)
    Ok, main parameter, path offset, i found in 2nd number of wp_pathinfo2 (-4.6143). Number of path described specified at 1st parameter in each entry. Last two parameters of wp_pathinfo2 is unknown. Well, if 42.2623 is probably something like calculated speed or recorded speed, 0.1165 is total mystery for me...
    wp_oriantation is probably shows direction to the next path point but i'm not sure. Did not experiment with them yet.
    And i don't know what wp_recrad and wp_pathflags could mean...
    So i will appreciate any information on them.
    Thanks.
     
  2. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Hi Kev,

    Pretty sure that (poster) Mario Morais has written AIW scripts on this forum. He should be pretty dialed-in on this, so you could start by reading his posts.

    It is also very searchable...(I wrote a c++ rF1 plug-in involving G's to USB port about 4 years ago).... but it's been a while so this reply will be thin on info.... as I am away from THAT computer at the moment.

    "wp" is waypoint. After the path number looks like a 'point3' of the position.... You should check, but Y is probably Up/Down, X side to side, and Z is fore and aft.... Seem to remember that.. rF does it this way. The 3 floats after the path number in orientation are probably also a point3 value.

    Look on youtube for Bob's Track Builder AIW..... It has a Spline to rf1 AIW text file functionality. An Australian named Brendon wrote it in C#, and it's very well done. The only thing is speed of processing.... For a ~50km circuit, it was a bit sluggish. ... but it was NOT multi-core (dotNet 3 or 3.5 ... I think it was).

    Loooong spline, and lot's of controllers to 'pin' it to the track.... which could be tough with maxScript's limited memory & core (singular)... ... not sure what you're writing in.... but Bob's had some very heavy lifting to do. For an average sized track it was perfect though.

    You could try making a tiny 100 meter track.... straight, where you know exactly where and what your X, Z, and Y positions and orientations are.... (make them all unique values... so you can tell which is which) then do your AIW in rF2, rF1, or Bob's, and see what the waypoint values are in the eventual AIW file... that should tell you a bunch.

    Unless someone prints it all out here for you... you should google it... lots out there. I remember collecting quite a lot of posts on this some time ago.... spelling out all the values (some of the values were no longer used).

    If no one posts anything, I should be able to find something more for you tomorrow...
    bink
     
  3. Kev

    Kev Registered

    Joined:
    Oct 28, 2010
    Messages:
    156
    Likes Received:
    0
    Well, thanks.
    But what i can tell pretty confident is that in rF1 there was no parameter like orientation. wp_vect - yes, it was vector to the next waypoint, but in rF2 it doesn't exist anymore and i can't find anything like that.
    Just want to clarify: these entries (wp_pathinfo2, wp_oriantation and wp_pathrecrad) almost totaly new in rFactor2.

    Also i can tell that BTB isn't any good at AIW construction at all. It places waypoint in non-linear manner, which can end up in total mess when you try to do serious paths for AI to be competitive.

    I took a look at cool Mario's scripts and found that they use only path offset when importing paths, other fields are ignored.
    Then i tried to draw oriantation vectors and that threw me in total... deadlock(?). It isn't vector to next path point in global coordinates, thats for sure.
    That what i got (T1 and T2 of Malaysia NLoop):
    View attachment 5056

    So i'm still in wait for information. Hope developers will write few words on these...

    edit: Ok, a bit of in-depth experimentation showed what wp_pathinfo2 parameters means: Path Id, Path Lateral offset, Recorded Time (shows time offset from previous path point) and Recorded Speed (in m/s).
     
    Last edited by a moderator: Dec 8, 2012
  4. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    I only use AIW to draw main path and fast path. The only info i get is from old rf1 AIW.

    To import AIW rf2 i skip the new parameters.

    Will be good a official documentation.


    I have the idea of ​​defining the position of the garage at max and then export to AIW. This avoids the location (0,0,0) of the car.
     
    Last edited by a moderator: Dec 8, 2012
  5. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Sorry... I didn't realize it had changed. As you find the rest of it, please post it here.

    Re: BTB AIW editor... One handy feature of the BTB AIW editor is that it did NOT crash and require ctrl-alt-del after you had surpassed ~10,000 waypoints... as you'd get with rF1's editor on long tracks. [figuratively unusable > literally unusable]

    About your findings... seems like recording specific times would make it pretty vehicle specific (?). Speaking of non-linear... how would you write a a function to interpolate this timing between ... say... a Prius and a McLaren MPwhatever (or any other two car classes)?
     
  6. Kev

    Kev Registered

    Joined:
    Oct 28, 2010
    Messages:
    156
    Likes Received:
    0
    lol, yep. I think it used for new fast path recording rather than for AI driving.

    edit: Ok, i figured out what oriantation means. Well, it means... orientation! :))) But not in vector (because vector cannot show roll i suspect). It's vehicle's pitch, yaw and roll angles (in radians) from world axises like specified in HDV comment: +x = left, +y = up, +z = rear. Also, seams like these are not used yet, i didn't spot any changes in AI behavior after changing it's values.
    So, what's remains... wp_recrad and wp_flags. Most of the time these are zeros. So i ignore them and all works fine.
     
    Last edited by a moderator: Dec 9, 2012
  7. ethone

    ethone Registered

    Joined:
    Nov 30, 2011
    Messages:
    1,153
    Likes Received:
    37
    Just a wild guess: wp_recrad might be "recovery radian", i.e. the direction in which the AI would go if they were off the track or spun near that waypoint.
     
  8. Kknorpp001

    Kknorpp001 Banned

    Joined:
    May 5, 2012
    Messages:
    1,928
    Likes Received:
    21
    Could this be why skippys can drive in wrong direction?
     
  9. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    One way to find out is to start setting bunches of them to absurdly large and small values.... Just because your fingers are in your ears, doesn't mean it's not science.
     
  10. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I don't think so. wp_pathrecrad is only set if the AIW creator has adjusted the calculated speed of a path at a specific waypoint. What is not clear is what the value means. I have experimented and see that at one track when the value is a low positive number, the speed value becomes MAX which is 366.33 MPH. At this same track, a large value (around 7-9.xxxx) is a VERY low speed value at almost zero MPH. I can't get the number to be negative. However, at Montreal, I have lowered the speed into the hairpin turn to avoid rear ending and the value is negative (-0.0104 is about 90 MPH). So what exactly the number is, I don' t know.
     
  11. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I did some experimentation and the following are some values based on that. wp_pathrecrad value and then speed in MPH.
    Two things seem to be evident. First, negative or positive values have minimal effect on the speed value now calculated. Second, the value is not linear. Speed adjusts very quickly with very small changes at the higher speeds and then gets very small changes as the number gets large (by some definition or large). So the math is definitely some non-linear value that seems to adjust DOWNWARD from the max calculated speed of 266.33.

    -0.0015 = 262.07 0.0015 = 251.55
    -0.0020 = 218.23
    -0.0030 = 171.89
    -0.0040 = 145.82
    -0.0050 = 126.96 0.0050 = 125.51
    -0.0060 = 116.76
    -0.0070 = 107.44
    -0.0080 = 100.07
    -0.0090 = 94.03
    -0.0100 = 88.94 0.0100 = 88.74
    -0.0120 = 80.85
    -0.0200 = 61.98
    -0.0300 = 50.22 0.0300 = 49.04
    -0.0500 - 38.45 0.0500 = 37.54
     
  12. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I have also determined through experimentation that the same value doesn't necessarily yield the same speed value at a different waypoint. So it is safe to say the algorithm is dependent on other values or specific properties of a waypoint or perhaps where it is in a path. Only real hit I find just searching for the name is an algorithm that doesn't appear to relate to speed.

    RECRAD calculates right ascension RA, declination DEC and distance from center RANGE for a point given by its rectangular coordinates RECTAN. SUBROUTINE RECRAD ( RECTAN, RANGE, RA, DEC ) DOUBLE PRECISION RECTAN (3) DOUBLE PRECISION RANGE DOUBLE PRECISION RA DOUBLE PRECISION DEC
     
  13. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    @dosequis56 Did you notice, that the last Post of this Thread is from 2012?
     
  14. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Yes. Just found it while searching for RECRAD meaning. No idea if anything on the thread applies to how things work today. I am writing a tool to make PATH modifications and also annotating the AIW file to make it easier to search and modify. So I decided to research some of the more mystical values.
     
    Emery likes this.
  15. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    Ah, OK, if you are working at creating a Tool for AIW Editing, it makes Sense, to find out, what some Values are good for.
    I was just wondering, because i make AIWs since the almost Beginning of rFactor 1 and i have to say that i never edited any Speed related Values manually, because it never was necessary.
    Happy new Year :)
     
  16. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    ... and i forgot... in a new created rF2 AIW there is no wp_pathrecrad Entry anymore.
     
  17. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I agree. I am just annotating the file when I write it back out. Makes it easier for minor adjustments that the MOD MODE editor can't handle. Current command is one to split waypoint paths to extend pit lines.
     
  18. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Right. Only after you adjust the speed value. By default, it is calculated.
     

Share This Page