# About racing game cars place in a competition

This topic is 4496 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello every ,I am a racing game programmer ,and we are working to make an online racing game ,the question is how to judge the cars' places in a competition,we have a way to set some points on the road ,and get the distance between car and the terminal ,but you can run from different way to the same terminal ,how to judge it ? any help will be thankful. I think maybe it can be describe by a tree or a graph ,but can someone give me some advice ? can any guy have another way to resolve the quesiton ? thanks !!!!

##### Share on other sites
I use several 2d line segments that cross the track and distance-to-line checks. These can be very useful.. the obvious use is at the start/finish line but by using at least two others you can prevent cheating by making sure the player crosses them in order.

If you use enough line segments your position in the race can be determined by sorting the players according to;

Lap Number
Last line segment passed
Distance from that segment

- Matt

##### Share on other sites
Quote:
 Original post by matibeeI use several 2d line segments that cross the track and distance-to-line checks. These can be very useful.. the obvious use is at the start/finish line but by using at least two others you can prevent cheating by making sure the player crosses them in order.If you use enough line segments your position in the race can be determined by sorting the players according to;Lap NumberLast line segment passedDistance from that segment- Matt

thanks Matt........
good luck ,do you have experience of making racing game ?
and if possible can you leave me some way to contact with you ?

best wishes and good luck .

##### Share on other sites
I've played about with driving/racing games in the past -- who hasn't? :)

My most recent attempt was a simple project using Newton Dynamics (physics engine) and my game engine. It includes a simple car set up and driving model, all physics (car control, collisions etc) are done by Newton, but it does use the line intersection tests I mentioned above for lap/sector timing and preventing cheating (it stops the player just reversing over the start-finish line and driving over again to clock up laps).

I was considering working on some AI and improving the car parameters, adding torque output curves etc but I simply don't have the time to put into it.

If you want a look click this and if you want to play it (trust me it's not worth it!) click here.

You can PM me here or my email address is on the engine site but I'm no racing game expert ;)

- Matt

##### Share on other sites
An alternative to a line test is a plane, a surface, or a trigger volume placed to start at the point where you want to detect. For example, you can place a tall, shallow box that's as wide as the road, aligned with the starting line. This makes it so that you "hit" the trigger even if you happen to be jumping in the air when crossing.

##### Share on other sites
Thank you eveyone ,I know some way to resolve my problem .

god bless you all .

1. 1
Rutin
69
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633421
• Total Posts
3011797
• ### Who's Online (See full list)

There are no registered users currently online

×