• Advertisement
Sign in to follow this  

Race Track Data

This topic is 3032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering what would be the best form to encode a race track? Would you rather create a number of predefined blocks and link them together? or encode a race track in the form of Bezier curves? Or use another solution?

Share this post


Link to post
Share on other sites
Advertisement
You can define the track using a set of control points, which would be refined and smoothed using a smoothing algorithm, such as Catmull-Rom.

Share this post


Link to post
Share on other sites
So you would rather use a bezier (or other curve) type path, which would define the track? In this case would you generate all the track vertices at load time or rather when needed (for LOD optimization?). Generating the whole track might consume a large amount of memory I think.

Share this post


Link to post
Share on other sites
We generate all of our data up front from models created in 3DS MAX but a previous title I worked on created everything using custom curved surface editing tools.

Typically we pick a budget for the tracks, in the case of our current title that's just under 100MB for the track + stands + scenery etc. PS3 and X360 are both quite capable of handling much more than that. Its also worth remembering that +90% is just textures. the actual track geometry is a really small part of your memory budget.

Finally, what kind of track is it? Does it have run-off areas like gravel traps? Does it need to self intersect or does it branch? Does it have fly-overs or bridges or tunnels?

All these need to be taken into account.

If the track is going to be random or laid across procedurally generated terrain for example, then you will need to create it in realtime. If it's a re-creation of a track from the real world then you're probably best creating it in a modelling application where you can work on the details and "bake" the final product so that you only need to load the final version into the game without doing any processing too it.

Andy

Share this post


Link to post
Share on other sites
Coincidentally, I'm working on a race track application at the moment (DirectX graphics, Open Dynamics Engine - ODE - collision/physics ).

As most tracks that I'm interested in simulating are relatively straight-foreward ( straights and fixed-radius curves ), Bezier is overkill for my purpose. I use a track description (easily obtained on the Web) of straight lengths/widths and curve radii and elevations. In that sense, it's similar to megatron242's "control points."

If you're interested in more complicated tracks with variable radii curves, etc., Bezier can be used.

I generate the track in the application from lateral profile specifications (a slice through the track - track+berm+walls) and the individual track data. If you find that generating the entire track uses too much memory, you'll have to decide how to handle that, depending on your restrictions. If the entire track is not loaded in memory, you'll have to either generate new sections on the fly or load them from disk on the fly.

I haven't gotten to the LOD portion of the race track application yet but, in a previous flight simulator, I used a combination of LOD index buffers (rather than LOD vertex buffers) and generation of vertex buffers on the fly.

EDIT: As NineYearCycle mentions, I've yet to run into memory problems storing just the geometry. With respect to textures, the roadway itself is relatively cheap and repetitive.

Share this post


Link to post
Share on other sites
Ok thank you very much. I think I'll go with a Bezier path because the track will probably a substantial amount of curve (albeit "straight" curves). Seeing as there should not be any memory problems i'll probably generate the track at load time (or even bake it at compile time as NineYearCycle suggests).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement