Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / ranks (racing)

Author
Message
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 5th Mar 2004 22:38
in a racing game, can somebody explain how to calculate who's in first, second, third, etc?
the only way i can think of is making hidden plains every few feet and counting up collisions, and that would take too long for me.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 6th Mar 2004 14:44
You're gonna need to use waypoints... Don't be scared off by the fancy name, all it is is a way of checking if the object(s) have reached/passed a particular point in the game...

Ie, you store the finish position ( X and Z coords ) in a couple of variables, then check to see if each of the racers have reached/passed that spot... If they have, then you rank them according to what order they reached that spot in...

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 6th Mar 2004 15:06
if i want to know the ranking continuously through the game, do i have to put a whole lot of them spread out around the track?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 6th Mar 2004 15:35
Yep

That would be a good idea anyway, as you can check if the player is going in the wrong direction ( if they're facing the wrong checkpoint, ie, the one that is meant to be behind them ), and you can do split times for laps, and also set up AI to use those very same WayPoints so that they have to travel through them ( ie, stay on-track )...

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 6th Mar 2004 18:50
how would i make the waypoints diagonal instead of straight along the axises, i've been using if object position x(1)<100 and object position x(1)>50 etc to make a rectangular area. is there any snippet to make this easier?
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 6th Mar 2004 19:07
you might find it easier to use actual (hidden) objects and just check collision with them, then your waypoints can be any shape/size and positioned/rotated in any way i might try and get a simple racing game working, maybe i should start now...

In the beginning, the universe was created...
This made alot of people very angry and it has been widely regarded as a bad idea...
Visit http://redeye.dbspot.com
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Mar 2004 21:22
Check out the DarkGT tutorial, it's in a recent thread somewhere.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php

Login to post a reply

Server time is: 2025-06-02 06:46:05
Your offset time is: 2025-06-02 06:46:05