Archived

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

Track data in a racing game...

This topic is 5086 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! We''re just planning our new game. It''s a car racing game. Just to avoid re-inventing the wheel... how do you store track data? Do you divide it in tiles? How do you "label" different parts of the track like borders, pavement... ? I''m not speaking about physics... but just data structures. Thx for the help! Bye! Marco

Share this post


Link to post
Share on other sites
The data structures you should use are heavily influenced by the game style. If you want it to be tile based... then make it in tiles, and have a mask for each tile, representing the track region (one option). If you want a more freeform environment, you could use a spline/polygonal definition. In fact, the way you store it is not only influenced by how it looks, but also by how you would like vehicles to interact with it. If you give a few more specifics of the sort of thing you envisage.. I''m sure someone will be able to offer you a little more help.

Share this post


Link to post
Share on other sites
that''s for 2D? tiles are simple.

I''d say, use a ''surface property'' mask on the tile. Surface properties would be a char index to a type of surface at the pixel, like walls, grass, tarmac, ect...

if you don''t use tiles, but a huge bitmap, the same principle can apply.

Share this post


Link to post
Share on other sites
Thank you for your help and sorry for my lack in information.
I forgot to say some important things

The game is in full 3D, it should be a funny racing game with deformed objects, unrealistic physic and toon rendering.

I was thinking about tiles anyway, because it could be easier to develop a simple track editor and design tracks as well.

But this is my first attempt to a car game so I''m not pretty sure.
My main worries are: using tiles or not, how to distinguish between different parts of the track in a single tile (pavement, border, grass...), how to find out car''s position against other cars...

We''re gonna use ODE for the physic even if we''ll set wierd parameters to get a "cartoon" behaviour.

What do you think?

Thx!

Bye Bye
Marco

Share this post


Link to post
Share on other sites
I think a good example of the sort of track you are thinking of is trackmania. Full 3D.. but a tile based track definition. If you need to make sure the user follows the tracks, have checkpoints... each checkpoint, activates the next one. The user must cross one, before the system detects him crossing the next. The more freedom you want the user to have.. the further apart you put these checkpoints. The times are compared by when the user crosses each checkpoint. If you need to.. you can have several meshes per tile.. one mesh for track... one for "off track" and then objects to insert for scenery. That way... you can let the physics change as the users goes on/off the track... and it should be pretty easy to let them interact.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i''m working ona track based racing game, it uses what i''ve termed track segments, each segment has an associated mesh/texture for the ground itself, and a quadtree for the objects inside it.

using segments is nice because it allows a very fast culling mechanism if you calculate/guesstimate a PVS for each segment against all the other segments. it also allows textures to be decently detailed and paged in/out of memory as they are needed

james

Share this post


Link to post
Share on other sites