garage path

Discussion in 'Track Modding' started by Bink, May 22, 2014.

  1. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
  2. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,010
    Likes Received:
    1,071
    Is that your own set of tools? They look interesting.
     
  3. Radar

    Radar Registered

    Joined:
    Oct 20, 2010
    Messages:
    687
    Likes Received:
    60
    Looking good Bink, can't wait to try.
     
  4. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Nice post bink.
    welcome back ;)
     
  5. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @Woodee.. yea.. I started this because I've never been able to generate an aiw file for a 50km 'track' (using rF1 or rF2... CTD if wp > ~8k)..... always had to use BTB, which was nice, but it would take a couple minutes to crunch the spline offsets when you made files for long tracks. Excruciating.

    I was hoping it would only take a year (which went by last Feb), but I spent a couple months speeding up spline measurement (fastSpline, corridors, etc.. offsets to waypoints). Ended up implementing some projective geometry stuff that I think Mobius (as in "Mobius Strip") originally came up with. It's much faster now... for the fastSpline (the purple one), it can update the waypoint fast offsets for a 50km circuit in about 8 seconds (~10k wp... at about 3mm resolution). Much more precise than entering data with a G25 wheel in-game. You can edit any specific corner you don't like... later.. without having to do the whole driving line again.

    Garage Path (pit lane extensions.. in rF speak) is the last rollout in the script. Just finished coding the building (max objs) part last night... so I have not tried garage path "in game" yet. All the other rollouts make ai data that runs in rF2, though, so tomorrow I'll do a little function to include the garage path waypoint data in the file. From what I have seen in Lime Rock Park and Brianza aiw files, garage path waypoints are at the end of the file [waypoint order: mainTrack, pitLane, grid, box, garPath1, garPath2, etc...]. so we'll see how things go with this new bit tomorrow.

    On a regular track (~ 3km ...with garages along pit lane), working through the rollouts and making an aiw file takes about 5 minutes. Much of it depends on how nice the track builder made everything. Ethone's Suzuka was easy & fast to work with. Toban was not. The images above are Mario's (as yet, unfinished) Laguna Seca which I have been testing code on for the past several months..... it's been a good test track.
     
  6. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @Radar... thanks... the trick will be getting ISI to write something saying it's ok to post the script here.... AIW files have their copyright at the top. Now... aiw files work just fine in rF2 without that notice... but removing it without permission would be... well, you know....
    Technically, the script reads in the whole top header, tokens, and wp header from an existing rF2 ver aiw file that the user picks, and uses that text with numerical data calculated for the objects you see in the 3dsmax screen shots. I just don't want to have to explain that with any sentences starting with "Your Honor,... " ---- I'm NOT looking to monetize it... I just want to give it away, once it's finished.

    @Mario... I was only down at the beach.
     
  7. gagipro

    gagipro Registered

    Joined:
    Feb 26, 2013
    Messages:
    473
    Likes Received:
    7
    wow sounds great !!!
     
  8. A13

    A13 Registered

    Joined:
    Jul 31, 2012
    Messages:
    123
    Likes Received:
    29
    Hello Bink, great to see you back active :)

    Looks like everything is still evolving :)
     
  9. Radar

    Radar Registered

    Joined:
    Oct 20, 2010
    Messages:
    687
    Likes Received:
    60
    Lets hope ISI are reading this post and can advise, would certainly make life easier and hey, I'd be happy to throw you some dollars / coins your way for the work you have done.
     
  10. gagipro

    gagipro Registered

    Joined:
    Feb 26, 2013
    Messages:
    473
    Likes Received:
    7
    Same here, it's toi complicated to make an aiw through dev mode.
    Don't understand why this is not in max exporter!!!
     
  11. MarcG

    MarcG Registered

    Joined:
    Oct 4, 2010
    Messages:
    6,854
    Likes Received:
    2,234
    it really really is'nt, if you follow the ISI tutorial you can do a medium sized track from start to finish in a few hours. Once you do it a few times (practice makes perfect afterall) then you get quicker and quicker. If Binks (cool looking) tool makes it easier & quicker then that's good obviously, speaking of which bink how are you approaching FASTEST paths? one main gripe of the AIW creation at the minute is having to create these for each individual style of car, would your tool allow quicker creation of these? (not actually sure who your tool works at all so apologies in advance!)
     
  12. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Hello MarkG,

    I have been reading your (difinitive ai) posts for many months... thanks for the info in them. It's been a big help.

    In the script, waypoints are instances of waypoint structures.... so the main track is represented by an array of these waypoint struct instances.... twpSt.wpStArr.. (track wp structure, array of wp struct instances) so if you want to get a matrix transform from one of the wp icons that the script builds in max, it would be twpSt.wpStArr.icon.transform. That result can get passed to another function that returns the "wp_oriantation" [sic] as an array of pitch, yaw and roll. Aside from most of what you see in the aiw file, my wp structures also include a couple extra variables that are script specific. So, there are arrays of wp structures for main track, pit lane, grid special wp, box special wp.... and now, up to 4 garage paths.

    Re: Fastest paths.. The largest part of the script (~4000 lines) are some groups of functions that reduce to 3 buttons in the Fast rollout called Learn, Plot, Build. Eventually (probably next month) I'll split the fastSt into into 3 data structures of functions/members.... to make it easier to modify/maintain.

    'Learn' starts out by finding the apices around the track.... based off of the main track center-line that the user selects (via 'edge' selection in max). Another of the 'learn' functions then classifies each section of road as 'straight', 'loose', or 'tight'. Other functions further collect data about how many consecutive waypoints there are for each of these track sections. Next, vectors from the apices are extended along the apex 'path' to find intersections with the appropriate corridor, so we can find the 3d points near where the (eventual) fastSpline "in" and "out" vector handles will be for that corner. This gives the fastSpline the proper curve fitting for each corner's geometry (see images below). Around this time, an array of "curve" structure instances is made for the track... so that each corner & straight has it's own curve structure.... which is used by:

    'Plot' (button) then runs a number of functions to further clasify the corners and straights, based on radius, track width, and corner/straight length, so as to find the 3d points that will be the fastSpline knots (verts) between the apices found above. This gets complex, as where the spline needs to go differs depending on the type of corner, chicane, or straight it is navigating.... and also based on consecutive corners (tight->loose.... loose->tight etc...), and how long any straight sections between them are. About this time, the in and out vector lengths, and directions are calculated for all of the non apex spline knots.

    'Build' takes all of the 3d points made by 'learn' & 'plot', and makes the fastSpline.... putting the spline knots on those points.

    For an average track of 3 to 5 km, the entire process of calculating the fastSpline takes a few seconds. I wrote that code about 8 months ago, and still need to further develop it .... to account for a couple different types of corner combinations that presently don't come out just right.

    It will never be perfect for every type of combination that modders will come up with... but the goal is to provide a fast line -- in a couple seconds -- that the user can adjust in a few minutes (with the script's Spline Editor Rollout)... so as to make the fast line, which the user can adjust and refine as they "get to know" the track. For these things, it works pretty well at the moment, although I intend on getting back to it soon... so as to change a few things that could be done better when the script detects chicanes, and / or corners that are 180 degrees (or close to that).

    I have included some (many months old) illustrations I made to help me think about what and how I needed to do all this. In the case of the image about editing splines.... that has all been moved out of the fast rollout.... and is now in it's own spline editor rollout... so that you can edit track / pit / garage path corridor splines, track cut corner splines, track collision splines, fast, wet and block splines..... as well manually adjusting the the pit lane path, and garage paths PRIOR to making waypoints along them.

    If you, or anyone else reading this, has any aiw files for 'open ended' rally style tracks, I would appreciate your posting them here... I would like the script to be able to make non closed circuts too.

    View attachment 12869
    View attachment 12870
    View attachment 12871
    View attachment 12872
    View attachment 12873
    View attachment 12874
    View attachment 12875
    View attachment 12876
     
  13. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Hey A13. Good to see your smiling face(s) again. Yep... that's how it goes, as i devolve, the script evolves. What I'm really looking forward to is hearing what 22 leaf blowers sound like echoing off the casinos this weekend in Monaco. What a rush.

    @gagipro.. It becomes less complicated when you can "see" the data as max objects. So... if there is a kink in your driving line, or pit entry... you'll see it. Aiw still needs to be done in a specific order. The scipt makes it easier by only opening rollouts and enabling buttons when you have completed the steps prior to that. [a state machine] All buttons and ui controls have long spewing "toolTips" so you know what (if anything) you need to do... and what it's going to do. A guided build.

    MarkG was asking about different lines for different cars... or different lines for a certain track: That's another nice thing about doing it in max. You can clone your fastSpline (or any of the splines) in max... and make any other line from it. At the moment, it looks for a spline named .. for instance, "fastSpline". If it's not hidden, it's probably the one that the user wants to use. So, after you adjust a spline (fast, formation, corridor, etc...), there is a button in the 'Spline Editor' rollout that measures the offsets from the spline, to every waypoint, on a perpendicular vector, and saves the values away for the next time you update the aiw file. If you know how to clone and re-name objects in max, then you already know how to make alternate driving lines.

    Radar.. no coin necessary... (besides... i brought home some of your dollars and coins last time i was there.... waay better looking than ours... got 'em in drawer somewhere.)
     
  14. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
  15. A13

    A13 Registered

    Joined:
    Jul 31, 2012
    Messages:
    123
    Likes Received:
    29
  16. Bink

    Bink Registered

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

Share This Page