Racing genre

Point to point movement is a method that can be applied to practically any game genre and it has been extensively used over the years. Our next example is a racing game, where the AI drivers use point to point movement to compete against the player. To create this, we would need a road and a driver and then we'll place the waypoints on the road and tell our AI driver to follow that path. It's very similar to what we have done before but with some behavior differences in our character because we don't want it to look rigid when he is turning and also there will be other drivers on the same map and they cannot overlap one on top of another.

Without further ado let's start, first we need to establish the map, which in this case ...

Get Practical Game AI Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.