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 / I need AI for DBC only!!! please HELP!!!!!!!!!!!!!!!!!!!!

Author
Message
SpazDC
20
Years of Service
User Offline
Joined: 20th Oct 2004
Location: Hmm... Good question
Posted: 25th Mar 2005 06:06
I need help for a racing game i making. The problem... i need the ai to drive on the track... and move.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 25th Mar 2005 09:04
SpazDC,

I would make use of 'info. targets', which are sections of the map, that if the a.i. is within the area of a target, it's new path is given to it. As for example, let's say you have a straight road with a curve in it at it's end. Code your map, that if the a.i. is within the straight, then his bounds are the width of the road(as where it is suppose to be driving), and it's direction(objective) is the angle of the straight. In further, the a.i. should know his objective, though through the use of your in-game physics and interaction with the player, he get's pushed from it. If so be, then when able, the a.i. should try to get back within the road's bounds and begin to drive the direction it is suppose to be going.

When the a.i. gets to the curve in the straight, calculate the angle of the curve, and have the a.i.'s objective be that turn.

In conclusion, have areas set aside, at the beginning of straights and the start of turns, that when the a.i. comes within these areas, his objective(angle and speed) are recorded. Code the a.i. to try to stay within this objective at all times. I have not ever coded a racing game, so this is all theory and 'logic' talk. However, I believe that with some experimentation, good results can be achieved using this method.

+NanoBrain+
SpazDC
20
Years of Service
User Offline
Joined: 20th Oct 2004
Location: Hmm... Good question
Posted: 26th Mar 2005 01:25
i think i can just say im stuck. but i'll give your idea a try...
AlexRiva
20
Years of Service
User Offline
Joined: 29th Jan 2005
Location: Monza, Italy
Posted: 26th Mar 2005 23:18
Look at BinaryMoon's tutorial. The A.I. section could be useful to you!

link to tutorial here:
http://developer.thegamecreators.com/?f=db_tutorials
Hack Juggernaut
20
Years of Service
User Offline
Joined: 13th Mar 2005
Location: where cyberspace does exist
Posted: 29th Mar 2005 03:49
how do u look at the tutorials?
AlexRiva
20
Years of Service
User Offline
Joined: 29th Jan 2005
Location: Monza, Italy
Posted: 30th Mar 2005 07:38
On the link I posted there are two wonderful tutorials. Simply click on the BinaryMoon's one and there is an Index where you can easily find the AI section.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 30th Mar 2005 20:17
Binarymoon doesn't use tracks though..
SpazDC
20
Years of Service
User Offline
Joined: 20th Oct 2004
Location: Hmm... Good question
Posted: 2nd Apr 2005 11:09
Svens right. they use a follow the light thing. all the AI does is follow the bright light. But thanks for the try.
AlexRiva
20
Years of Service
User Offline
Joined: 29th Jan 2005
Location: Monza, Italy
Posted: 8th Apr 2005 10:16
Yes, but if you use the same concept applied to single checkpoints (making an array with many checkpoints)one by one on the track I think it could work. Just an idea
SpazDC
20
Years of Service
User Offline
Joined: 20th Oct 2004
Location: Hmm... Good question
Posted: 9th Apr 2005 12:01
thanks

give me what i want and i will go away!

Login to post a reply

Server time is: 2025-05-23 10:57:19
Your offset time is: 2025-05-23 10:57:19