• Advertisement
Sign in to follow this  

AI for a roguelike game

This topic is 4482 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
Quote:
Original post by Balaam
Here's a useful set of posts:

http://h-world.simugraph.com/pmwiki/pmwiki.php?n=Library.BearAI1A


Interesting reading... However, it doesnt seem to cover finding pathways through tunnels and doorways and such. Also, I was hoping to incorperate the monsters intelligence into its ability to track down the player

Share this post


Link to post
Share on other sites
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