Jump to content
  • Advertisement
Sign in to follow this  
nethackpro

AI for a roguelike game

This topic is 4631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am developing a roguelike game from scratch, and Im having difficulty with getting the AI to find and walk through doorways while also, at the same time, seek out the players. Any help?

Share this post


Link to post
Share on other sites
Advertisement
Two ways spring to mind:
1) Have the monsters "cheat" by always knowing the direction that player is in and have them move towards that point.

2) Give each monster a line of sight (to save time, perhaps do this within a certain distance of the player) and have them move toward anything interesting they see.

Doing 2) is extremely tricky in practice I've found, especially when dealing with doors. What I came up with to "solve" it was complete hack that will only work for simple "rogue-likes" but it is very fast. In truth it doesn't make for more or less interesting behaviour unless you put a lot of effort in to make it use the LOS information.

Hope that helps,
Cam

Share this post


Link to post
Share on other sites
Here is another idea:

Let the player leave an undisplayed "trace" or "smell" when it walks around. Let it fade a bit each turn. When a monster "smells" the track of the player, make it move toward the strongest smelling point, effectivelly tracking the player.

For the actual pathfinding in rogue-like games... good old A* should do the trick.

When a monster doesnt smell anything, let it explore rooms around. Perhaps explore "doorways" instead of rooms. For the monster, each room is just something it have to cross in order to explore another doorway ;)

Steadtler

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!