aiw~thing

Discussion in 'Track Modding' started by Bink, Oct 3, 2014.

  1. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Been getting lots of pm and email requests to continue working on my AIW file creation script, "aiw~thing". After 2 years of 12 hour days, 7 days a week of learning what all that aiw data represents, how to calculate it in 3dsMax, making it user friendly, and coding it, I had 'moved on' to other projects.

    As you may have read, I had concerns about releasing it because the first line in aiw files is a copyright that is owned by ISI. So... I wrote to ISI about my legal concerns on releasing the script, and received a supprisingly positive response. Many thanks to Tim Wheatley for arranging the authorization to post this script for the community.

    I intend on spending a few months cleaning up some parts of the script, and perhaps making a video demonstration and / or .pdf before posting.

    Since I have already 'torn down' the particular workstation I developed it on and put it in storage, it will take me several days to set up a work area, download the latest rF2 build, and get my ancient self back into the AIW mindset. As usual, I'll post long, spewing progress reports and images during this pre-release development phase. Hopefully, after everyone gets going on it, some community member(s) will "adopt" it, answer new user questions, and continue it's development... so I will be able to start enjoying my retirement (again).

    The script will be completely free, NOT encrypted, no donations expected or accepted, and the source code is completly "commented".

    If all goes as planned, sometime within the next few months the community will have a new toy to play with inside 3dsMax: "aiw~thing" [visual aiw].

    Thanks again to Tim Wheatley for arranging the "go-ahead" on this.

    bink
     
    Last edited by a moderator: Oct 3, 2014
  2. Hazi

    Hazi Registered

    Joined:
    Jan 15, 2012
    Messages:
    753
    Likes Received:
    73
    Thank you - great you are back.
     
  3. Mario Morais

    Mario Morais Member

    Joined:
    Oct 26, 2010
    Messages:
    1,464
    Likes Received:
    168
    Great news
     
  4. PlickBadger

    PlickBadger Registered

    Joined:
    Jan 12, 2012
    Messages:
    534
    Likes Received:
    8
    Awesome!
     
  5. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    917
    Likes Received:
    182
    *thumbs up*
     
  6. TypicalAnalytical

    TypicalAnalytical Banned

    Joined:
    Sep 19, 2014
    Messages:
    262
    Likes Received:
    0
  7. hexagramme

    hexagramme Member

    Joined:
    May 25, 2013
    Messages:
    4,245
    Likes Received:
    194
    Man of the hour! Super cool initiative! :)
     
  8. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Nichts zu danken..
    Com todo o prazer...
    No prob, y'all...
    Eipa kesta...
    aiw != prob...
    Ikke noget saerligt..
     
  9. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    New (comfortable) desk built... plus everything set-up and running yesterday... formula ISI car in devMode... so.. ready to start coding again today.

    -- Limiting work to 8hrs / day, 5 days a week so I don't get aiw burn-out again.
    -- After reading some posts about build 860, I decided to stay on build 798 for awhile.

    List of some items that need doing:

    1. Pit box entry angle is too tight... so pit box (rear) waypoint creation needs to calculate less of an angle. Also would be nice to have a toggle for "sharp" or "shallow" box entry angle.

    2. It would be useful to actually see the paths from the pit lane --> pit boxes (same with grid spots), ...so... need to place some little splines for these when calculating the waypoint "branch" layouts. The "show / hide" rollout will need to be able to show or hide these for user.

    3. The waypoint data viewer rollout may become a "waypoint editor" rollout for some parameters. I did this on another script ("grid~thing"), and may want to transplant some of those functions over to aiw~thing.

    4. 'File Write' rollout (shows what has been done... and what still needs doing prior to aiw file write) needs to include status of the (optional) garage paths.

    5. The File Write functions presently read an existing file to get aiw text parameters. Now that ISI has authorized the posting of this script, the file write functions don't need to 'pretend to be editing' the aiw file anymore. So this will get re-written to only write a new file... and allow the OS to prompt the user about overwrites, re-naming etc.... [so .. smaller and faster].

    6. Automatic fast line generation needs to be able to detect turns that are 180 degrees (or close to that), and adjust the fast line accordingly. Chicane detection could also use some work.

    7. The script runs MUCH faster when (3dsMax) "undo-levels" = 1. So the script will need to look at this when started, and tell the user that it will be changing to undoLevels = 1 ... and then change it back to whatever the user had it at upon script close.

    8. Show / Hide rollout needs to include (optional) garage path splines & waypoints.

    9. Function to convert user's fast line into a Wet line. [Might do this after script is posted...]

    10. Function to convert user's fast line into a Blocking line. [Might do this after script is posted...]

    11. It would be nice to have a PDF for this script (Photoshop can create .pdf files... works pretty well).

    12. Need to find a good screen video app for doing a "walk through" on aiw file creation in 3dsMax. [ Any suggestions? ]

    --> If there are any other things you all can think of that would make life easier on aiw files, this thread would be a good place to post them. <--
     
  10. Hazi

    Hazi Registered

    Joined:
    Jan 15, 2012
    Messages:
    753
    Likes Received:
    73
    Read about CAMTASIA - 30 day Demo available - but never used it myself.
     
  11. mschreiner

    mschreiner Registered

    Joined:
    Oct 5, 2010
    Messages:
    331
    Likes Received:
    67
    Awesome news! I think one of the issues that might be looked at is the speed calculations. rF2 is very touchy on this and when you normalize a curve it really screws up the calculated speeds for that path. I would like to see where you could just manually set the speeds to make the AI drive properly. This is very important for OVALS as of right now it is almost impossible to make a good Patch for them.

    Cheers!
     
  12. sergioloro

    sergioloro Registered

    Joined:
    Oct 17, 2011
    Messages:
    190
    Likes Received:
    2
    great news!! i always had problems with AIW editing, sometime this frustated me and leave the track for a weeks :), i hope this tool allow me to create AIW files in a simple way.
     
  13. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @Hazi...
    Thanks... I'll check it out.
    ---------------------------------------------------
    @mschreiner...

    I've done some testing on Joesville... but not much else on ovals. At the moment, the script only does rF2 aiw files.

    In rF1 aiw files, there was a value called "wp_cheat" (maybe this is what you are referring to?)... but my script only does rF2 aiw files (so far). Were you talking about "wp_test_speed" or "wp_cheat"?

    Early on, when I read a few posts about "wp_test_speed" values in aiw, I was told that it is only calculated for finding the 'fuel usage' values (when devMode is simulating that). Other people wrote that when they enter speed values into the aiw file, that changing the value will not reliably change the aiw speed.

    That could be wrong.... but I can tell you that when I make aiw files without ANY 'wp_test_speed' values (all of them set to 0.0000), the cars can still do really fast lap times (equal to what the real cars do on the real track). That kinda confirms that they are for fuel simulation (rather than actual speed adjustment).

    Anyhow... since rF2 aiw does not have "wp_cheat" values anymore... I'll mess with "wp_test_speed" values today on the Laguna test track.... just to make sure... maybe put low (non-zero) values on the main straight to see if I can get the lap times to go down. It seems odd though, if "wp_test_speed" is really for adjusting the car's speed, that having all the wp_test_speed values in the file set at 0.0000 still allows the car to do great lap times... (?).

    I've read that some people (purposely) put little 'kinks' in the fast line if they need to slow the speed at a certain point on the track.... but other speed adjust attempts I've read about are said to have inconsistant results.

    Could you tell me which "speed" value you were talking about changing (wp_cheat OR wp_test_speed ??).... and which rF you are working with (rF1.. OR.. rF2.. ??)... and how you go about adjusting the speed?

    Maybe we are talking about 2 different things (since I'm working on rf2 aiw creation).


    EDIT: Just looked at some BTB made tracks for rF1.... Bob's puts -1.0000.. for both the wp_test_speed and for wp_cheat. As for ISI rF1 tracks, Joesville has all zeros as does Toban_Long_24.... whereas Toban_Long has various values.
    I'll do some tests to see if I can (negatively) affect lap times with wp_test_speed in rF2 today... Still curious though.... anything more you can tell me about it will be greatly appreciated.
     
    Last edited by a moderator: Oct 8, 2014
  14. Tosch

    Tosch Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,872
    Likes Received:
    51
    @Bink

    I might be wrong but to me it looks like the "wp_test_speed" is some kind of threshold speed for the yellow flag. It's around a quarter of the speed text in AIW editor.

    Another thing I figured out today is about the waypoint distance. I tried 3 (default is 5) for the main path at Nordschleife and it was horrible. It's now at 6 and much better.
     
  15. Mario Morais

    Mario Morais Member

    Joined:
    Oct 26, 2010
    Messages:
    1,464
    Likes Received:
    168
    @Tosch
    Maybe we can use a variable distance for Way points?
    If can use it, we can have a smaller distance in tighter turns for better resolution.
    I use the same structure in my SplineTrackMaker.
     
  16. Tosch

    Tosch Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,872
    Likes Received:
    51
    Might be a good idea. At slow speeds I see no problems but in fast curves there are big differences in AI speed calculation from one waypoint to the next and it is for some points not possible to correct that by moving them with "Ctrl + Alt + Cursor" because the movement is not fine-grained enough. It gets even worse when you have bumps on the track. With waypoint distance 3 the calculated speed for the GTR was 140km/h at the jump Quiddelbacher Hoehe/ Flugplatz.
     
  17. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    HI Tosch,

    I think my EDIT above and your post must have been... what's your word for that ... gleichzeitig (?). Anyhow .... yea... that (yellow flag threshold) sounds reasonable. Still like to know how mschneider (above) changes speeds... what rF version... and what aiw parameter(s).

    Pit Box & Grid spot "special" waypoint distance (2 per car spot): I think when I was coding this, I went off of what was found in rF2 Joesville... which was about 3.5825m separation. So that's the distance I have my script build them at. For the main track, pit path, and (optional) garage path waypoints, I space them at 5m.

    About main track waypoint distance: I've seen various values used. Five meters seems to be used quite a bit. It ends up being the 'resolution' that everything gets 'sampled' at (corridors width, fast line offset, formation line offsets etc...). On a go-kart track, you might want them closer... since it's small size may need greater resolution.

    I can understand that on longer tracks, people might make the wp further apart because (at least last time I tried it) devMode had CTD problems on very long tracks, and greater separation means less waypoints. So... too many waypoints = crash when saving main line.

    Originally, I learned these devMode problems while making a track that was 51km. So.. for a 51km track, the wp count is about 10,000... and devMode would crash when you tried to save the "main line" (waypoints). The only rF1 aiw file that I could make for this long track was by using "Bobs Track Builder"... (this was about 6 years ago).

    Eventually, when rF2 came out, I tried doing a small track to see if devMode worked, and there was no problem. When I tried to use devMode (rF2) to make the aiw for my 51km track, it still crashed when trying to save the waypoints.

    Since then, I have not tried this with any of the newer builds, because I wrote my own aiw creation tool. It has no problem with long tracks. I also insert zero values in the wp_test_speed and it does not seem to slow things down. Maybe wp_test_speed is a +/- value (?). There are some values that BTB used to zero-out also... Some of the values in aiw files are "in the game engine", but not used for rFactor.... maybe for other driving games.

    Anyhow.... aiw~thing presently makes aiw files that run well in devMode, so I'm thinking that what I coded must be pretty close to accurate. The only values I don't do are fuel simulation, and the 2 path info values (index 3 & 4) related to fuel simulation.. which does NOT seem to adversely affect opperation. Also not quite sure what all the values for the 'track state' variable mean, but if you look at what devMode puts there for each creation step, it's pretty clear that it's derived from a base 2 number, and probably used as bit fields for aiw build progress / status.

    Ori" (pitch, yaw, roll) angles are weird... because there are exceptions... Grid Ori Yaw uses a full radian, (always positive).... whereas Grid pitch & roll are 0 --> +/-pi (like ALL other aiw ori values).... so I use 2 different functions for ori ... one for grid.... and another for everything else.

    If you have any questions about any other aiw parameters, or how to calculate them, just ask.......
     
  18. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @Mario.... you must be a mind reader.
     
  19. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @Tosch... seem to remember someone saying that the speed calculations in aiw files are not very accurate.

    Also, instead of moving the wp in devMode, if you are trying to change the driving line, you can just type a different fast line offset for that wp into the aiw file... then the resolution of the move is whatever you type: wp_pathInfo2=(0, HERE, -1.0000, -1.0000) The fastline offset for each wp is the offset along that waypoint's wp_perp vector where the car should intersect the perp... when it passes that wp.
     
  20. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @sergioloro ... yea, it's pretty simple to use:

    The script automates the making of objects in your 3dsMax scene for each waypoint, driving line, car spot, and corridors... everything.

    It asks you to loop select strings of edges, spline knot points, or points in your max scene as it guides you through the aiw building process.

    The buttons have "Tool-tip" instructions on what you need to do, and are only enabled when the previous step is complete.

    That's a good start... being able to see the data as objects, and have the script "know"... and show you what you need to do next.

    And it's fast... you can make the main (center) line waypoints, or a basic fast line in about 10 seconds.

    Same with making all the pit boxes & garage spots.... about 10 seconds. [no driving needed]

    Don't like your pit box spacing? Pess the "Clear" (boxes) button, change the spacing spinner, press a button to re-make them.

    If there is a problem with the fast line, you can edit the fastSpline at ANY spot, and re-write the aiw file. Change one part, keep all the rest.

    So... Your fast line is something that can evolve over time... one corner at a time, if you want... as you get to know the track.
     

Share This Page