3
$\begingroup$

I am making a racing game and I need to make an AI for my opponent racers, but I have no idea how to.

The idea is that there will be opponent cars that:

  1. Use the vehicle wrapper
  2. Drive on the road and turn automatically to stay on the road
  3. Can dynamically dodge obstacles and other cars that try to move in front of or into it from the side

I have already implemented the vehicle wrapper to the car. For the AI, I have tried to use radar and ray sensors to detect invisible walls and steer based off that, but it apparently doesn't work with sharp corners very well, of which my game has a lot. I also tried a steering actuator using the seek and pathfinding options and a navmesh, but they won't let the car steer around obstacles.

Any help is appreciated. Thank you.

$\endgroup$
  • 1
    $\begingroup$ Would it be possible to add the obstacles to the navmesh? Just a thought... $\endgroup$ – christai Feb 6 '17 at 7:24
  • 1
    $\begingroup$ No, because the obstacles are supposed to be dynamic (ex. rocks falling onto the track, walking npcs, other cars, etc...) $\endgroup$ – JakoNintenCraft Feb 9 '17 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.