Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stefu

Terrain or spline track for racing game?

This topic is 5644 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

Hi! My racing game currently has very simple terrain rendering. But now I think that for racing game it would be much better to use a track generated along spline. It would make game handling, AI and graphics rendering easier. My idea now is to create spline-based track and get height from the same heightmap I used with terrain. What do you think? I''m just wanting some opinions before crushing into changes.
RacingTREME - Linux ShipBattle

Share this post


Link to post
Share on other sites
Advertisement
It might be easy to create the spline in a modeler and import it as an .x file. You can then extract the vertices from the mesh to construct the vectors for your track. From there, you can draw triangle strips along the vectors. The vertices could also be used for culling out invisible parts.

That''s what I had in mind. If somebody knows a better technique I''ll gladly hear it.

Share this post


Link to post
Share on other sites
Ok, with the spline idea is easy to create simple track.
But to build whole track with objects, texturing and everything,
that''s the problem. Writing track editor is one choice, but is lot of extra work.
How do they do tracks in commercial games? They use 3d studio or similar? Thats pretty good, but I can''t afford one
Any ideas befor I start writing track editor?



RacingTREME - Linux ShipBattle

Share this post


Link to post
Share on other sites
One thing you might want to consider before you dive into a spline-based track is whether or not you''ll have branching and/or jumps in your game. If you do, you may still be able to use splines in some form, but it might start to become a lot more complicated.

Now, if you''re just doing straight away tracks then it might be a good way to go. But you''re right, you''d still need to supplement it with surrounding geometry and stuff. So, if that''s the case then an editor might be a good way to go. Unless of course, you can use something cheap/free like Milkshape.

-John

Share this post


Link to post
Share on other sites
Hei thanks for sharing your thought.
I found Need For speed track editor and it was pretty simple.
I have now some ideas for the editor (I don''t think milkshape is suitable to build big tracks )

It''s very hard to build tracks with thousands of polygons by hand, so track-tool is for that:
Set some points that form the track, the tool connects them with catmull-rom spline. When track is formed, hit enter and it will build track of (for example) 6 quads width along the spline.

Then it is possible to add several spline tracks, make crossings, etc.
Quad tool can be used to add single quads to add buildings, connect spline tracks, etc.
Point tool can be used to move single points.
Magnetic point tool would be useful to raise hills, make bumps, etc.
Maybe simple extrude tool too.
And of course texturing tool.

I think I''m long way there with these



RacingTREME - Linux ShipBattle

Share this post


Link to post
Share on other sites
Cool. Just another piece of advice. Think about how the texturing will fit into everything early on.

It''ll be easiest if the texture coordinates get generated along with the splines you lay down for your tracks. However, you''ll have to come up with some solution for where you make forks in the road to blend those two paths together. Also, you may need something to tweak textures out if you start moving vertices, quads, etc around by hand.

Good luck man!

-John

Share this post


Link to post
Share on other sites
Thanks.
My idea is not to edit texture coordinates at all. Just select which texture to each quad and orientation (0..8) (propably texture can be divided into 1x1, 2x2, 4x4, 8x8, etc. sub quads)
Then the track loader in game tries to create as much continuous texture coordinates (to reuse vertices) as possible.
This should keep editing fairly easy, and loader should also be reasonamble quick.
If track quads have all textures 1x1 and same orientation, it should not duplicate any vertex in that area.
I hope it works this way.




RacingTREME - Linux ShipBattle

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!