Where's the groove in the AIW file?

Discussion in 'Track Modding' started by R Soul, Jan 3, 2016.

  1. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    I'm currently working on a Python script for Blender to generate a simple mesh from the racing line. The reason is to make it easier to ensure the realroad texture is mapped properly.

    I've been able to generate a mesh for the centreline (wp_pos) but I can't see anything that looks like the race groove.

    For rF1 the xyz values for the groove are wp_pos + wp_groove_lat * wp_perp, but in the AIW file for Joesville (rF2) I don't see anything that looks like an offset. For each waypoint I can see three wp_pathinfo2 values, which may be for multiple lines, but I don't know what I'm looking at (blocking line, wet line, etc) because the numbers don't make sense to me.

    Any ideas?
     
  2. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    This may not be what your after

    There is no race groove in the AIW in rF2. It gets dynamically made using the racegroove texture as the cars drive over the road. You want to map the race groove to the fast line of the AIW.
     
  3. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    I know. I'm trying to create a mesh that follows the fast line so I can use it as a guide for mapping the groove texture. It'll be useful for difficult corners (e.g. a chicane with a sudden change in gradient) where the best line is most easily found by driving.
     
  4. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Im probably not understanding you correctly. BUT instead of a mesh how about creating a spline from the fast line then use the spline to map the race groove
     
  5. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    That is correct ;)

    Because I don't know which numbers in the AIW file represent the fast path.

    Blender doesn't support spline mapping, and generating a spline is harder than generating a mesh.

    I extracted a couple of AIWs from other ISI tracks and started at them. The wp_pathinfo2 entries are probably related to the fast path, but there are several of them. Joesville has 3 per point. Monaco 66 has 6 of them. Example: wp_pathinfo2=(0,-4.7678,0.1278,32.0835).

    The first number is probably an ID (the others start with 1, 2, etc). The second value could be an offset but I don't know the meaning of the other two. And what are the other wp_pathinfo2 lines for? Fast dry, Fast wet, block.... or something else?
     
  6. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    My take on wp_pathinfo2=(0,-4.7678,0.1278,32.0835)

    0 = Fast Path 1 = Left Path 2 = Right Path 3 = Block Path.....extra numbers like you had at Monaco 66 will be specific car paths.

    -4.7678 = X offset from wp_pos
    0.127 8 = Y (height) offset from wp_pos
    32.0835 = Z offset from wp_pos

    If you can speak with Mario Morais he should be able to help more as he wrote a script for 3ds max to import fast or centre line. If you send him an email he is usually fairly quick to reply. Find his details http://www.mj-multimedia.net/contacts/
     
  7. andreaglass

    andreaglass Registered

    Joined:
    Jan 4, 2013
    Messages:
    59
    Likes Received:
    15
    Don't you think 32 meters is too much for an offset from wp_pos?

    To define a path relative to a wp_pos, you only need 2 axis, you don't need to define height. The last number is about speed, as it was in rF1.

    First wp_pathinfo2 is Fastest Path, second is Left Path, third is Right Path. You can see the order in the first lines of an aiw file generated by the aiw editor and the first number of every wp_patinfo2 shows if is a Fastest (0), Left (1) or Right (2). And if you don't define Left and Right, Left will be (1,0.0000,-1.0000,-1.0000) in every waypoint, and Right will be (2,0.0000,-1.0000,-1.0000) in every waypoint.
     
  8. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    You only need the offset from pathID= 0

    If open Joesville AIW file you can see in TOP
    Code:
    definepath=FASTEST
    For first definepath the Id is 0

    In [Waypoint] section:
    Code:
    wp_pos=(11.5677,1.1730,1.6910)
    wp_perp=(-0.0112,0.1736,0.9847)
    wp_normal=(0.0000,0.9848,-0.1736)
    wp_pathinfo2=(0,5.1993,-1.0000,-1.0000)
    wp_oriantation=(0,-0.1735,1.5512,-3.1347)
    wp_pathflags=(0,0)
    
    What I know is:
    wp_pos: Position of WayPoint
    wp_perp: Perpendicular to the tangent vector
    wp_normal: Normal vector (Perpendicular to the wp_perp)
    wp_pathinfo2: (ID, OFFSET, B, C)
    ID: PathID define in top of AIW
    OFFSET: Offset value to apply to wp_perp vetor:
    B and C: unknown so far. Maybe Bink can help here..
    wp_oriantation: Another unknown ?. Why path point need orientation?? Another bink call.. :)


    So to get the FastPoint Position

    Code:
    FastPointPos =  wp_pos + (wp_perp* wp_pathinfo2_offset )
    I hope this helps
     
  9. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    Thanks for the tip, although he posted here before I had the chance.

    Thanks. I can ignore those numbers.

    I see the pattern now. I already knew there was a blocking path, and that there could be different paths for different cars, but I couldn't see how the game knew which path to use.

    It does, thank you. I already knew the basic formula (see first post), but not which numbers to read.

    Here's the imported fastpath for Joesville:
    fastpath.jpg
     
    Last edited by a moderator: Jan 4, 2016
  10. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    The last 2 posts (MM's & R Soul's) look correct, as is the fastPointPos formula above.

    I seem to remember reading somewhere that wp_pathinfo2[3] and wpPathinfo2[4] were something like 'time since last wp' and 'time in this sector (so far)'.... something like that anyhow.

    The wp_pathinfo elements 3 and 4 don't seem to change the racing when they are changed. They are probably test parameters that ISI use to calculate something else (perhaps fuel usage, lap times, (?)).

    ISI are (understandably) reluctant to discuss certain parts of their proprietary technology, which, ironically, means it can take quite a while to develop alternative tools to help with using their product.

    There are a couple different flavors of ori. Been awhile since I researched ori, but I remember that if you converted an rF1 track to rF2, you got a different type (180 degrees out of phase) than you did with a 'normal' rF2 devMode build. Forget just now what it was, but I remember having to compensate for it in aiw~thing.

    Ori is pitch, yaw, and roll (in radians), and the grid ori (at the top of the file) uses a different format than the others (something like a full radian for yaw, rather than +/- pi like drive line ori uses).

    If I remember correctly... the unwanted side-effect to getting the orientation values wrong was that the on car cameras would show an upside-down image, or not be pointing where the driver should be looking..... so while all the ori pitch/yaw/roll values could easily be derived from the other available vectors in the aiw file, my guess is that it is calculated in devMode so that it does NOT need to be done within the context of the simulation (where it would be 'expensive' wrt real-time execution).

    I worked with some former Department of Defense and VFX people on IndyCar & NASCAR simulators in 'Vegas some years ago... so if I had to venture a guess, I'd say that DOD or some type of flight simulation project was what some of the original rF developers were doing before they decided to split and do something more fun. Hence, ori as pitch/yaw/roll.

    So... calculating ori in devMode (and indeed, calculating the entire aiw file in devMode) is kind of like pre-production work for a film; much less expensive to do it before you are renting the cameras, full crew, "talent" and so forth.

    edit: The camera issues were during 'aiw cam' development where the ori was being used for camera positioning in Max. Not sure what ISI use ori for. In aiw~thing, the ori generated is the same variety that rF2/devMode makes for Joesville.
     
    Last edited by a moderator: Jan 5, 2016
  11. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I know this is very old thread. The last number is a 'speed' calculation adjustment for the waypoint in the given path. You can lower the speed target to make the AI enter a corner with more control OR adjust the number UP to prevent slowdowns due to small large angles in a curve (but too much might make the AI lose the corner, so needs trial and error).
     

Share This Page