Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 5 of 5

Thread: Determining rankings in racing games

  1. #1

    Determining rankings in racing games

    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?

  2. #2
    Registered User
    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.

  3. #3
    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

  4. #4
    Registered User

  5. #5
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012