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 / Waypoint ai?

Author
Message
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 20th Mar 2007 13:39
Hello all again, i hope you're all doing well. Anyway, i was looking through posts about racing ai and came upon a method using waypoints, i read through it all but it still has not clicked in the old noggin. I was wondering if anybody could just outline the waypoint system. Thank you.

"You can't expect to wield supreme executive power just because some watery tart throws a sword at you..."
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Mar 2007 17:59
In very simple terms:

Your car at any point in the game has an X,Y,Z position in 3D space.

You create 'waypoints' at regular intervals on your track which are simply sets of more X,Y,Z co-ordinates. (Or X,Z co-ords if you prefer if the track is flat).

As your car moves around, it 'aims' for the first waypoint co-ordinate. When it reaches it, it turns towards the next waypoint and heads for it. And so on.

The method works best with lots of waypoints and they are stored in arrays.

TDK_Man

Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 20th Mar 2007 20:53
Thanks TDK, I appreciate your advice.

"You can't expect to wield supreme executive power just because some watery tart throws a sword at you..."

Login to post a reply

Server time is: 2026-07-11 11:22:22
Your offset time is: 2026-07-11 11:22:22