Car chase

I’M hopefully going to start on my first game, a chase game soon and just need to know what is needed to programme cpu cars in blender I think I’ve run into something similar before but have forgotten.
How would u go about making cpu cars chase after u and actually use different methods of aproach to get to u.

Advanced AI is a difficult thing to do. For the car chasing you, you can make the car always moving forward, and just track it to the car that it is chasing. This is very simple and probably not very effective, but it works. I would learn some python or advanced logic bricks haha :wink:

I would start with making the AI cars stay on the road using some kind of checkpoint. Like put an empty on every corner of your track to make the car follow the course. Then put in ray sensors to detect road sides, cars in front of it and just have it set up with logic bricks: if front sensor is true, brake; if right sensor is true, turn left; etc. I would have an integer property for steering, where 0 is left, 1 is straight, and 2 is right. This would be more realistic then using the Track To actuator. Finally, and this is the hardest part, you need to figure out where the player is on the track, make the AI car navigate to that point, and then do something when he reaches the player. Personally, I would make every track a closed course so that the car just needs to go forward on the track. I wouldn’t even know where to begin if you wanted it to be free-roam like Need For Speed. Then I would just use a Near Sensor to detect the player, and then (bum, bum, bum): STATE ENGINE to change from following the course to trying to hit the player. You won’t need to worry about him staying on the track, because he’ll just follow you until he’s too far away, then go back to following the track. And yes, it is very much as difficult as it sounds.

Or animated different tracks with empties, have him randomly choose one empty to follow each time he gets to an intersection (ALWAYS ANIMATED TO THE EMPTIES ARE PERFECTLY ON TOP OF EACH OTHER AT EACH INTERSECTION! This allows him to seamlessly follow tracks.) Open my profile and look at threads started by me, click on city pursuit. My old game I used this system.