1. Hello Guest,

    We wanted to let you know that the NXS17 templates and viewers have been released!

    Grab them HERE
  2. Hello Guest,

    We wanted to let you know that besides the NXS17 templates and viewers, now we have released the NXS17 Mod as well!

    Grab the latest files HERE
  3. Hello Guest,

    We wanted to let you know that we are trying out a new feature at SRD. Your feedback is needed!

    Read more about the chatbox HERE
  4. Hello Guest,

    We are gauging interest in starting an online racing league.

    Please take a moment and give your vote HERE. Thanks!

Sandbox 2

Discussion in 'NR2003 General Discussion' started by TChapman500, Aug 4, 2018.

?

Grip Level Support

  1. All configurations have same grip levels.

    3 vote(s)
    20.0%
  2. Per-configuration grip levels.

    12 vote(s)
    80.0%
  1. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    All that work to make sure that my code is correct only to realize that I didn't implement it as intended. So now I have to rework the segment code. I'm going to use "nodes" to determine segment position rather than storing segment positions on the segments themselves. Same with sections. Their positions will be stored in nodes rather than on the sections themselves. That'll make it easier for me to implement things like node snapping later on. I completely forgot about that when I finished implementing the segments and now I have to redo most of the segment and section implementation that I have. That was a huge waste of time!
     
  2. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    I'm considering changing my mind about the bare minimum milestone. Previously, I said that the editor would support decals at the bare minimum milestone, but decals can be simulated by splitting segments. So I think I want to wait until after the bare minimum milestone to implement decal support.
     
    Mystical likes this.
  3. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Well, I successfully decoded the F Sections (theoretically). Something tells me that I'm going to run into trouble when it comes to FSections with light maps. The W Sections basically messed-up everything I thought I knew about a specific sub-structure dealing with the texture coordinate mappings.
     
    Mystical likes this.
  4. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Just for the fun of it, I just figured out the entire SBX file structure. Of course, Sandbox 2 is going to save the projects using the SBX extension. I'll just add something to make sure that a user can't crash the program by opening an original Sandbox SBX file. Oh, and the only purpose of the SBX file is to display a single background image. It's ignored by the simulator.
     
  5. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Anything Sandbox can do, I can do better! I'm just tampering with the texture coords of the track surface decals to see what will happen. I'll put it on the bucket list for the "feature complete" milestone to implement UV adjustment of track surface decals. Oh, and longitudinal skewing of section textures. We'll have tracks that simply cannot be recreated in the original Sandbox by the time I'm done with this thing!
     
    J.R.Franklin, Rufio2031 and Mystical like this.
  6. Rufio2031

    Rufio2031 BBMC Tracks

    Messages:
    187
    Likes Received:
    591
    Is adding texture segments to F sections like you can with W sections a possibility or is that an engine limitation?
     
    J.R.Franklin likes this.
  7. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    It appears to be an engine limitation. There's nothing in the F Section data structure that suggests that we can add multiple texture segments to an F Section.
     
  8. J.R.Franklin

    J.R.Franklin Well-Known Member

    Messages:
    833
    Likes Received:
    1,942
    Ah... too bad. :(
     
  9. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    My library to read 3do/ptf files can now read a PTF file correctly up to the point where it encounters track segments. I have not implemented the read code for segments yet. Nor have I implemented the write code for anything. Note that even though I'll probably implement write code for decals and TSOs, the editor won't be able to put them in until after the bare minimum milestone. Just track segments and sections.
     
  10. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Looks like I'll have a complete PTF reader by the end of the week. There is one problem though: Bump Map names are encoded for some reason and I have no clue what the algorithm is.
     
  11. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    PTF read code is complete. I still don't have a clue about the bump map names though. I know that they are (a) stored as a 128-bit encrypted value and (b) can be easily decrypted.
     
    WarMaKin likes this.
  12. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Decided to implement the grid lines as a single shader instead of as two shaders. So that's a total of 2 draw calls for the entire grid (lines + origin marker) instead of 3. Plus it reduces the amount of initialization code that needs to run. I'm currently trying to implement the wireframe rendering system for segment sections. I've decided against implementing any 3D segment wireframe rendering for now. It'll probably come after this project reaches the Sandbox Complete milestone, but before it reaches the Feature Complete milestone.
     
    Mystical likes this.
  13. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    I've decided that wireframe rendering will only be done in 2D views (to simplify the shaders and reduce GPU load), and only for the sections which are visible. Mesh generation will be done on the CPU side instead of the GPU side. And will only be done if something about the segment has changed instead of every frame. Again this is to reduce GPU load and shader complexity. The mesh generation of the curved fences will be incredibly complex and I believe it's better to have these things generated using the CPU instead of the GPU.
     
    dsmi155 likes this.
  14. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Guess it's time for another update. I've been busy with a lot of other things, so I haven't been working on the track editor for about the past month. Though some of what I've been working on is somewhat related to the editor (like tweaking the PTF read code which now crashes the test app for some reason). Anyways, I implemented some basic segment rendering code only to discover that I never implemented code to create the track to be worked on. For some reason, I can't render what doesn't exist. So I'm implementing that now.
     
    mtblillie and Mystical like this.
  15. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    I got the segment creation working. We can now create 10-meter-long straight segments wherever we want. Now I'm working on implementing the default X Sections that are to be created with the segment. I'll use these to create a selection box for said segment (which will also serve as a way to test segment visibility). Next, I'll implement the ability to add curved segments followed by the ability to select and delete segments. Then I'll add the ability to click and drag segment nodes around and to change the segment type. Screenshots will be coming soon.

    Once all that is completed, I'll implement the ability to add, modify, remove, snap, and unsnap sections; followed by the ability to append, split, merge, attach, and detach segments (and change the lead segment). The attaching part is probably going to be the hardest, especially when it comes to attaching curved segments to other curved segments. Once that's done, I'll add the ability to add, move, rotate, and remove decals. After all of that is done, I'll add the ability to export the track to NR2003 (complete with export warnings/errors and an experimental mode) and publish the editor on Steam. This will be the "bare minimum" stage (INI, LP, CAM, SIM, and ACD files will need to be added manually at this point).

    Of course, there's a lot of detail that I simply don't know yet or have left out to keep this post "brief". I still need to implement code to read MIP files and write PTF files. And I need to debug the code I wrote to read PTF files.

    EDIT: Code debugged. PTF files do not follow structure alignment rules.
     
    Last edited: Apr 28, 2020
    Mystical and J.R.Franklin like this.
  16. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    So, testing my PTF read code on Tereana City got it most of the way there. There was just one tiny little detail: Because Tereana City is a work in progress, it wasn't using all of the features available to the PTF file. So when I tested the read code on Talladega, which does use all of the features, I ran into problems. But they seem to be sorted out now. Decided to also take a stab at those MIP files. And the only clue that I have on the MIP file structure is from a guide on the GPL mips, which means my info is a bit outdated. Fortunately, it seems that Papyrus didn't break backwards compatibility that much.

    EDIT: Well, the MIP and STP files seem to be surprisingly simple. Too simple for me to have figured it out already.
     
    Last edited: Apr 29, 2020
    Mystical and dsmi155 like this.
  17. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    Got the segments in. Can't do anything with them once they're in place so I just spammed them all around the origin. This needed to be put in place first so that there would be a selection area. If the cursor is within the segment bounds when the left mouse button is clicked, then the segment is selected. Otherwise, it is not selected.
    Segment Spam.png
     
    Mystical likes this.
  18. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    This is starting to look and behave just like the original sandbox.
     
    J.R.Franklin and Mystical like this.
  19. riviera71

    riviera71 Well-Known Member

    Messages:
    852
    Likes Received:
    534
    Question I just thought of (and I'm afraid I know the answer lol). If I remember correctly nr2k3 doesn't like segments that are unattached to the "main loop". To explain https://www.google.com/maps/place/H...bf95f5216eb177!8m2!3d41.9341987!4d-91.6810588
    , in that case it'd be great if you could make one loop for the biggest oval + pits and then 2 smaller not closed loops for the inner ovals.
    Now that I think about it, I have (accidentally lol) tried one segment entirely unattached to the rest of the track which gave me a weird graphical artefact from that segment to the center of the track but I've never tried a second closed loop.
     
    J.R.Franklin likes this.
  20. TChapman500

    TChapman500 Well-Known Member

    Messages:
    244
    Likes Received:
    407
    I once tried to load a track with orphaned segments. The game refused to load it. If you want all three configurations, that will be three separate tracks on the simulator's side. Once everything is said and done, this track editor will make it easier to make such tracks.
     
    Harry Nurpplez and J.R.Franklin like this.

Share This Page