[WIP] Chapman Track Creator

Discussion in 'Track Modding' started by TChapman500, Dec 10, 2013.

  1. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    @machine: Well, that pretty much describes an Euler Spiral. Though I think that the actual implementation may produce a slightly more aggressive tightening to the target radius.

    ----------------------------------------------------------------

    Small update on the progress of my track editor: I finally figured out how I'm going to implement the mesh generator (I think). I found that I need to do a little bit more optimization of some of the code so that it can handle the mesh generator more efficiently. I have absolutely no clue if my camera implementation is set up correctly and I won't know until a mesh is generated. And, I'm having trouble setting up the Track Editor's website (and the single webpage on the main sight is now down because of it, but the blog is still up).
     
  2. machine

    machine Registered

    Joined:
    Jan 31, 2011
    Messages:
    399
    Likes Received:
    295
    From what I see here, it is probably exactly what is needed.
    See the transition from straight line to circle some way down.
    When you hit the red section, the radius starts to get tighter. On an oval track, the banking also gets steeper. Until it reaches full banking at the same time you merge to the circle.
    https://en.wikipedia.org/wiki/Euler_spiral

    Great work, keep on it!
     
  3. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    That is the same page that I got most of my information about the spiral from. And the Java Script implementation that they give translates nicely into C++.

    -----------------------------------------------------------------------------------------------

    Anyways, the mesh generator is proving to be more difficult than I had though it would be. Because a segment can have multiple paths (eg: to create a branch-off area for a secondary course on a multiple-course track), I need to be able to translate section positions between different paths on the same segment. Otherwise, the surface mesh will be a mess and could create issues where the car falls through the track. Looks like my estimate of two months has turned out to be quite wrong. Not only do I not have any screenshots to give, but I really haven't even started working on the open beta management system. And in addition to that, my implementation of the path created a severe limitation that has forced me to reimplement it almost from scratch.
     
  4. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    re: variable radius corners...

    My x y ended up being something like the involute of a secondary spline. After writing it, I researched a bunch of wiki articles trying to find it, but couldn't find anything matching it.

    Since most of this kind of math is (at least) hundreds of years old, I'm 99% sure someone must have done it before... I just haven't found who did it yet.

    My goal on the test track generator was that the user (moi) could define the x y curve portion of the track with 3 controls:

    Start Radius,
    End Radius,
    Total Degrees Traversed..

    ... another 3 controls for z:

    Start Radius banking
    End Radius banking
    End Elevation

    About re-writes... I also 'paint myself into a corner' occasionally, and find out that I've forgotten some capability (variable radius corners, etc..).

    First impulse is usually to modify... which tends to get messy.. and then eventually realize it's better to go back and augment infrastructure to support a new set of functions.

    Kind of a pisser... having to tear-up working code.. but ultimately worth it (so the spaghetti code doesn't come back to bite you later).
     
  5. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    I understood that very last bit perfectly, but could you clarify exactly the rest of what you're getting at?
     
  6. Bink

    Bink Registered

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

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    Thanks.

    ----------------------------------------------------------------------------------------

    Progress report: The mesh generator has caused the project to explode in terms of level of complexity.
     
  8. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    New blog post. There's been a change in plans in some of the planned features (please read entire article before criticizing).
     
  9. Euskotracks

    Euskotracks Registered

    Joined:
    Nov 29, 2013
    Messages:
    1,092
    Likes Received:
    191
    Hi Timothy,

    I am not sure about the type of feedback that you are looking for in this thread. Looking at your posts It would seem that you are interested in feedback coming from IT people instead of from potential software users (customers).

    I barely understand your latest blog entry. Probably I haven't paid the required attention since I am not actually interested in coding issues.

    According to your first post in the thread it seems that you also build tracks. I agree with you about what you say of not having a complete software to create tracks. I disagree about the debugging issues being one of the important things. I have no problems getting a working track with BTB. I have severe problems though to make a quality track with it due to its own feature limitations. Especially regarding the terrain (track+surroundings).

    Solving those issues, implementing new shaders and updated export options to meet new available sims would have made BTB a complete software.

    However, now we have to incomplete projects trying to replace BTB which is still the best option to create tracks easily.

    - RTB: This software is still very immature lacking basic features as undo/redo. Seems like Brendon never tried to actually create anything but nice landscape pictures to show off the Google import feature. Trying to create a track with this program is an oddissey atm.

    - Chapman Track Creator: not much to say yet. Very difficult to judge at the current state of development. I am afraid that the lack of user oriented approach will make this project fail.

    Sorry to be so pessimistic about the future of these type of tools. There is a lot of potential in these type of tools. Whoever correctly fills this gap will probably get his deserved prize in terms of sales. However it does not seem to be an easy project to be carried over by a single person in his free time. A more powerful background is required IMO to achieve the expected result.

    Brendon, Timothy, Bink, Mario.
    You are all very knowledgeable but working independently I simply cannot see any bright future for track modding community.

    I sincerely encourage you guys to collaborate. I am afraid it will be useless but at least I tried.

    Enviado desde mi ONE A2001 mediante Tapatalk
     
  10. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    One of the things I like (or liked, since I haven't used it for ages) about BTB is that with a few clicks we can have a fully functional track for rFactor (1) and RBR (the latter requires a plugin to handle... something).

    That means we can just try things. We don't even have to know much about how things work behind the scenes. The ability to import our own objects/textures was also essential. That encouraged me to understand how things really worked.
     
  11. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    @TChapman..
    re: blog post.. yea... you are right to reduce as much complexity as possible. As Euskotracks suggested, usability is King. If the average user can't understand and enjoy the process, then it's a tough sell.

    On my last 'massive re-write', I started by designing an easy to use GUI & process ... and then re-wrote the functions to fit the GUI. The functions were more complex that way, but the GUI and state machine shielded the user from that complexity.

    re: floating point issues.. yea.. error trap and correct any result that could drop below the fp res... Test for infinity after measuring angles... etc.. Much better if you find these things before the users do.

    @Euskotracks... Nice, clean web site you've got there. I pretty much agree with what you wrote above. Engineers excel at creating breathtakingly user hostile software. Only after getting hammered a few times, do we start paying more attention to GUI & process.

    re: Collaboration... I've never been a fan of the saying, "Nothing great is ever produced in isolation". Because--> Dali, Tesla, etc... etc..

    We have different goals. I'm writing aiw~thing for sh*ts & giggles. The others are (presumably) attempting to augment their income with their projects. The point about "free time" doesn't apply in my case... I have no obligations whatsoever.. but a couple of the other guys have jobs.

    You (I'm guessing) enjoy designing your own tracks or cars because there's something special about executing your own creativity. I don't know our friend TChapman, but having emailed with Brendon & Mario, they seemed to enjoy the challenge of designing 'their own thing' like you & me.

    There's also the issue of (coding) language... Mario & I are writing in maxScript, TChapman in C++, and (last I heard) Brendon was writing in C#. While I've written in each of those languages, those guys are looking for a payback on their investments... so taking the time to port to another language probably wouldn't be very attractive to them.

    As with my previous post, I am willing to help, though... because it's not coming out of my wallet. But if I was one of the other guys, it wouldn't be a good business plan to do so.
     
  12. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    Thanks for the feedback. My target audience are the people who would potentially be using the track editor to build race tracks, but I thought it would be good to give you an idea at what's going on behind the scenes that will make the editor easy to use. It's also the case that much of the terminology that I use is actually terminology that would be used for the Sandbox track editor for NR2003. And CTC is based heavily on Sandbox, but with many improvements and new features.

    Collaboration would be nice. Especially on the DX11 shaders and helping to write the exporters/importers.
     
  13. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    Hit another road block. Here's a blog post describing it in detail. Any help would be greatly appreciated.
     
  14. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    862
    Likes Received:
    485
    It's been over a decade since I've worked on any code like this. However, a quick thought is... For straight segments, scale the length of a given mesh line to between 0.0 and 1.0. Divide 1.0 by the mesh density number. Then do a loop from 0.0 to 1.0 by the step value. Plug that value into the equation to calculate the height at a given point along the line. Curved segments would be the same, except you'd divide the degrees of the arc by mesh density.
     
  15. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    Interesting.
     
  16. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    I think I have a starting point on how I'm going to model the track elevation profile.

    I'll start by making the following assumptions:
    1. The elevation profile is defined by a Bezier Curve.
    2. The control points to the curve are at 1/3 and 2/3 of the length of the segment.
    3. The length of the curve does not scale with the lateral positions of the X Section.
    4. The height of the control points do scale with the lateral positions of the X Section based on the slope at their respective end of the segment.
    5. With assumptions 3 and 4, I will assume that the length of the curve is dependent only on (a) the length of the segment and (b) the height of the control points and end points.

    From these assumptions, I will do the following:
    1. Find the "straight length" of the curve by finding the length of the segment and adding the distances between all of the control points on the curve.
    2. Find the fraction of the curve that the vertex lands on when a line is drawn straight up/down through the lines drawn between the control points.
    3. Draw a single point along the curve according to how bezier curves are drawn and see where that point lands, and compare it to where it's supposed to land.

    Hopefully that will solve my problem and allow me to finally implement that mesh generator.
     
  17. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    New blog post. The elevation profile isn't going to be as much of a block as I first thought it would be.
     
  18. TChapman500

    TChapman500 Registered

    Joined:
    Nov 6, 2010
    Messages:
    226
    Likes Received:
    110
    How important is it to you guys that the Euler Spiral be implemented before the start of the open beta?
     
  19. machine

    machine Registered

    Joined:
    Jan 31, 2011
    Messages:
    399
    Likes Received:
    295
    As far as track making goes, I will only be doing ovals. There probably is not a great market for ovals, but they do have some unique requirements.
    Without a euler spiral, It would not be worth beta testing oval configurations. More so steeper banked ovals.
    Also, banking transitions need euler spiral also.
     
  20. machine

    machine Registered

    Joined:
    Jan 31, 2011
    Messages:
    399
    Likes Received:
    295
    Here is a pic demonstrating banking changes.
    See how on the left the banking goes down, then drops constantly, then flattens. On the right banking changes sort of in a sine curve. Most oval tracks tend to have their banking change as in the left pic. Bob's Track Builder has it's banking transitions as in the right pic. It's not much, but you notice it when you drive the tracks. It makes a massive difference to the experts when done right. For the image, banking transition is on a straight section to see it's effect.
    View attachment 20538
    Having said that, we need euler spiral for the radius changes. But keep in mind some way to control banking changes.
     

Share This Page