• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
FanLemon

How to design race game track data

5 posts in this topic

I am big fan for race game. Now I try to build a 3d race game by myself.

I know a little about scene graph principle. But I just do not know how to design the track data? And how to organize these data in OpenGL?

 

Any ideas? Thanks.

0

Share this post


Link to post
Share on other sites

Typically the process is that the track surface is modeled and textured in a 3d modeling package and saved to a common 3d file format. The 3d file format is then processed and the data is loaded into your game. The whole loading the 3d model data aspect is where layers above OpenGL can come in handy. The Open Asset Import Library should be able to help you though: http://assimp.sourceforge.net/

 

Other elements of the track can also be modeled such as tires and billboards. In some games a 3d level editor is used/created for the purpose of placing the 3d assets in a level. One example is Leadwerks http://www.leadwerks.com/werkspace/page/editor?showbanner=0

 

In this case you would have a "level" file that would control the position, orientation, and scale of various 3d models as well as other level properties.

0

Share this post


Link to post
Share on other sites

For the track itself: A long time ago, I generated mesh (triangle) data from specifications for NASCAR racetracks. There used to be really precise dimensions, banking degrees, etc., but I can't find them now. This link is similar to what I used. I really liked using data from actual tracks.

 

Anyway, from the charts I made up a simple general spec for a track -

 

straightaway: ## of feet;

turn: elevation 13 degrees, radius, arc;

straightaway ## of feet;

turn elevation...

.. and so on.

 

I wrote a program to take those specs and generate mesh data based on a "track slice."

 

trackslice.png

One function generated a slice with input data such as x,y,z for inner left corner, turn radius, width, super-elevation angle, etc. I just "stitched" those together, and dumped the data to a file for loading. The loader read the file and generated a VBO for the track.

 

I was also using ODE (physics/collision engine) at the time and used the same data to create planes* for the collision engine. The first car I tried consisted of just a box and 4 spheres for tires, with something similar for the graphics car. Eventually I added suspension and steering, etc. You can make the suspension physics as simple or complex as you like. Designing the graphics for a car mesh is pretty satisfying, also.

 

*That pretty much sucked as the seams between slices caused bumps in the collision engine for some reason. So I eventually set up an algorithm to calculate tire elevation using the track specs.

 

I "stole" an engine sound from somewhere and that made the experience a lot better. Eventually I set the sound up to increase in frequency based on gear and accelerator position.

 

In any case, if you love racing, you're off on a really fun adventure!

 

EDIT: spelling and grammar corrections. Should not post after 1AM.

Edited by Buckeye
2

Share this post


Link to post
Share on other sites

I worked on a race game a long time ago.  The track and scenary was modelled in 3ds Max and exported as a custom mesh format.  Then also in 3ds Max we created the Race lines and overtaking lines which are used by the AI cars. 

These were just invisible objects that were spaced along the length of the track that contained information such as the optimal speed that an AI car should be at that particular node.  We exported them seperatly using a max script and then they wee read into the engine and used by the AI.

1

Share this post


Link to post
Share on other sites

There are some open source racing games about.  Look at http://www.speed-dreams.org/

 

All of the ones I have looked at have two sets of data. 

 

The track is defined as a bunch of meshes so you can view frustrum cull as many as possible 

 

For the physics you usually have a seperate file. The most common format I have come across defines the track as left , right turns ans straight. 

 

So you would have something like

typedef struct Left
{
       float angle;   // number of degrees the turn passes through
       float length;  // length of the arc
       float bank;    // bank angle
       float pitch;    // height change
};

You use a track editor to match the course to the 3D mesh

0

Share this post


Link to post
Share on other sites

Actually I had a quick look

 

Speed dreams seems to use a bicubic patch for each track segment. They store 16 edge points for each track segment and interpolate between the points for the physics system.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0