Metric Dev – Ship AI

Getting AI’s Running in Metric Racer. RT gives a quick snap shot of all of it over at his dev blog.

rtdev2

The extent of any AI I’ve ever written is mashing together macro’s in excel to streamline complicated tasks.

So when it came to developing an AI for Metric, I decided the best foot forward was too keep it simple and build on that.

Follow the Bread Crumbs

I set it up that each track will need a set of ‘nodes’, the green tennis balls in the image below. The node’s are no different than any other track/sandbox item, and can be added, edited and deleted in the same fashion as the rest of the track parts.

Once the track nodes were initialized, it was as simple passing the list of nodes as a ‘List’ collection and have each ship individually chase after the nearest node. Once it reached a certain threshold of minimum distance, it would increment up the list to the next ‘Node’. You can see the first iteration…

View original post 75 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s