PDA

View Full Version : Track construction in a sci-fi racing game


PeterT
08-Oct-2002, 14:19
I'm currently planning on doing a sci-fi racing game with the ODE physics engine, but I'm stuck devising a method for track construction. I don't want to write an entire level-editor (that would probably be more code than the game itself ;)) so I thought about specifying a spline/NURBS curve and then have the engine generating a track that runs along it.
The problem with that approach is that the tracks should contain loops, jumps etc. so it is very hard to detect where the UP vector for the track geometry should point to on different parts of the track. I thought about specifying it by hand on some key points, but I'm sure some of you have a better idea 8).

ERP
08-Oct-2002, 17:56
The simplest way to do it is as polygons.

If you want to use curved surfaces (our racing title did though not nurbs) you will complicate things dramatically and you will increase the physics CPU cost dramatically. Basically you write a collision function that converts xyz into uv on the curve and then recompute the normal at that point.

Personally if I were doing it again, I'd probably use polygons, they have to be very small if you want your loops to be smooth, but collision is a no brainer.

As for an editor, use MAX or MAYA, if you want the final thing to look good, you have to provide artists with the tools to do it.

3dcgi
09-Oct-2002, 04:31
Artists could draw splines like you describe in 3dsmax and then loft shapes along the splines to create tunnels or tracks. The lofts can then be converted to polygons and easily exported through a script.

PeterT
09-Oct-2002, 17:23
Artists could draw splines like you describe in 3dsmax and then loft shapes along the splines to create tunnels or tracks. The lofts can then be converted to polygons and easily exported through a script.

That was my first idea as well, and I already built a testing track that way. After your advice (thanks guys!), I'll probably just stick to polys, although I sorta liked the concept of curved surfaces.

(btw, just to clarify some things: Artists := { me }, Coders := { me } ;))

fresh
11-Oct-2002, 21:07
That was my first idea as well, and I already built a testing track that way. After your advice (thanks guys!), I'll probably just stick to polys, although I sorta liked the concept of curved surfaces.

(btw, just to clarify some things: Artists := { me }, Coders := { me } ;))

Programmer art rocks :)