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 / detecting wrong way for racing games

Author
Message
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 23rd Apr 2004 22:03
hi guyS! just wana ask your ideas , suggestions or sample codes in implementing "WRONG WAY" detection for racing games. I'm using way points. THX!

phukol
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Apr 2004 02:36
I guess the simplest way is to check the distance to the next waypoint between 2 cycles...if it's getting larger, you're going the wrong way!

I would probably sample less frequently, it's not a critical function, and you'll get more consistent results.

BatVink
http://facepaint.me.uk/catalog/default.php AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 24th Apr 2004 08:39 Edited at: 24th Apr 2004 08:49
@BatVink... That's a good method, but wouldn't hold true for if the car was stationary, or was doing "doughnuts", thus going the wrong way, then going the right way, etc.

A method I would impliment would be to check the angle of rotation against the angle that is created by the line between the way points...

ie;


[EDIT]
In Code:

[EDIT]

Hope I helped
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 24th Apr 2004 09:29
I think there should also be a 1 or 2 second delay before displaying a wrong way sign, and you have to make sure that the car is really moving away from the next waypoint. I've seen some crazy GT3 drift videos and there was this one guy that could pull a 360 and get into a drift as soon as he recovers from the 360. Just watch out for the crazy things that can happen in the game because you don't want to display a wrong way sign while the driver is doing something intentionally just to show off.


"Story in a game is like story in a porn movie. It's expected to be there, but it's not that important." - John Carmack
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 24th Apr 2004 21:00
wow! Jezz is back! MUZTA JEZZ? How R u! Thx Guys! I need to finish my racing game by next month. Thank you all for replying. i''l just post what happened next time. THX

phukol
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 25th Apr 2004 20:30 Edited at: 25th Apr 2004 20:32
Quote: "MUZTA JEZZ?"


Is that language... Tagalog?

haha just wondering.


"Story in a game is like story in a porn movie. It's expected to be there, but it's not that important." - John Carmack
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Apr 2004 06:59
Quote: "MUZTA JEZZ?"


Haha, I assume you mean "Master Jess"? lol...

Anyway, thanks for the nice greeting

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 27th Apr 2004 19:39
it's actually tagalog, but ur a REAL MASter anyway, HEHE. Ive tried the code. but i'm not quite sure if this is what u mean JEZZ,

i tried to use it but i get different angle results in angleway#, it sometimes range from 0 above degrees. Shouldn't it be that the angle between two points be always 0? by the way, (spot) pertains to the current waypoint and (spot-1) to the previous. Do hope u guys will still help me!

phukol
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 27th Apr 2004 19:50
anyway heres the function. It's still based on the limit rush code and the Ai function that Jezz told me.

phukol

Login to post a reply

Server time is: 2025-05-30 13:38:41
Your offset time is: 2025-05-30 13:38:41