AI Question

For artificial intelligence in my developing roguelike, Space Mercs, I am currently using an adapted version of the Dijkstra Maps as outlined by Brian Walker, maker of the outstanding (and quick-to-play) roguelike Brogue. The way it works is simple enough: you set a zero point somewhere on the map, and all walkable tiles adjacent to that point take on a value of 1, with tiles adjacent to them becoming 2, and so on.

22222
21112
21012
21112
22222

In the above example, the hero (or whatever the NPC’s objective happened to be) would be at the 0. The NPC then ‘rolls’ down the slope from highest to smallest number, eventually reaching 0 regardless of obstacles. This seems to take longer than A* pathfinding, but it has the nice advantage of being infinitely scalable–it takes nearly the same amount of processing power to have 1 enemy tracking your PC as it does for a horde of 15 enemies. When the Space Mercs are being tracked by a horde of xenos, you don’t want lag getting in the way.

If you have done any game development, what systems do you use for AI?

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: