PDA

View Full Version : Determining rankings in racing games



alexmiller
August 4th, 2008, 02:21 PM
This is not a specific programming question, I'm just curious if anyone knows the general answer.

I've been playing a lot of Mario Kart recently, and I've been puzzling over the way the game determines the rankings. In racing games, how do you determine when one player is ahead of another player, when the course is so non-linear? And how do you tell when a player has completed a full lap?

I'm not even building a racing game, so I don't need specific code or anything. But if anyone has dealt with this before, how did you go about accomplishing it?

rrh
August 5th, 2008, 06:06 PM
I played with a racing game, the way I did it is I created a series of checkpoints along the track. As you hit each one, it would update your status. If two people are on the same checkpoint, it would use their linear distance to the next checkpoint to decide who was first.

kevin416
August 5th, 2008, 08:55 PM
The rankings are most likely determined by the player's distance from the finish line, so if you were on a different path than one of the other racers, the distance to the finish line based on the track you are racing would be the one used.

don't know for sure though

rrh
August 5th, 2008, 09:00 PM
...

Favardin
August 7th, 2008, 10:12 AM
You usually have some kind of race-track measurement, which is a mapping of the current space-coordinates to a single parameter. You could simply use the shortest distance to the curve, but that would allow cheating --- so checkpoints of some sort seem mandatory.