Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old October 14, 2015, 13:43   #1
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,020
fizzix is on a distinguished road
Monster behavior

If you're like me, you are probably a bit unsatisfied with the why Angband (and frankly most roguelikes that aren't Sil) handle monster movement and behavior. I've started poking around at the code and thought I'd throw up some ideas with what I've been thinking of. The current monster states are:

Asleep: The monster has a sleep counter which gets decreased according to player movement.
Awake: All awake monsters will path to the current player location if they are ble to.
Afraid: The monster runs away from the player, but occasionally casts spells/breathes etc.
Status modifiers: Confusion, stun.

Once awake a monster will always path to the player. It will also never go back to sleep accept by magical means. I recommend the following behavior.

We have two intermediate states between Asleep and the current awake state which I call "Engaged". These look like.

Asleep: Same as before

Awake: Monster is awake, it will wander around the dungeon (possibly heading to a target location). It has a counter that causes the monster to sleep again when it reaches 0.

Alert: Anything that wakes up the monster, or any stimulus while it's awake moves it into alert. Here the monster doesn't necessarily know where the player is, but is actively looking for it. This might mean tracking a known previous location, or having a "perception" chance of knowing the player's current location. An alert monster will go to engaged if the player is ever in LoS. It will slip to awake if it's gone long enough without any new information about the player.

Engaged: This is the current awake state. The monster knows where the player is (most likely it can see the player) and is going to that location, casting spells, doing melee attacks, whatever. If the player leaves LoS (or telepathy region for powerful monsters) then it immediately moves into Alert.

We could probably use a single value, the current alertness, to determine how quickly monsters move between phases. An always alert monster (hound) will never drop below alert. Other monsters will go to sleep much sooner after the player leaves.

Having wandering monsters is tricky. For solitary monsters it's fairly easy, for pack monsters it's a bit harder. I'm hoping giving all the monsters in a pack the same target will keep the pack together, but that means we need some extra information about whether the monster is in a group, and what group that is.

All I've done so far is some maintenance work renaming some poor flags... I should probably find out what Nick has planned for this area too...
fizzix is offline   Reply With Quote
Old October 15, 2015, 15:39   #2
Rowan
Adept
 
Rowan's Avatar
 
Join Date: Sep 2014
Location: TX
Posts: 139
Rowan is on a distinguished road
Quote:
Originally Posted by fizzix View Post
Alert: Anything that wakes up the monster, or any stimulus while it's awake moves it into alert. Here the monster doesn't necessarily know where the player is, but is actively looking for it.
Yeah, for a while I've thought it was a little unrealistic that every awake monster seems to have auto-ESP (and yet often can't figure out an obvious path to @).

I think it'd be kind of cool to see monsters wandering around once they wake up, or actively searching for the player, etc. I wonder, though- do you think taking away the monsters' auto-ESP might make the game too easy? E.g. if hounds didn't know to stay 1-2 steps outside line-of-sight, most would pose zero threat (sure, hounds can probably "smell" the player, but it's just an example).
Rowan is offline   Reply With Quote
Old October 15, 2015, 21:34   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,457
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by fizzix View Post
II should probably find out what Nick has planned for this area too...
Considerable similarity to what you've proposed, really. The main ingredients I have in mind are:
  • At least one state between sleep and chasing - I've been thinking of it as awake, but not aware
  • An improvement of tracking by sound and by smell, with different monsters being differently good at this. Sound should help wake monsters, and both sound and smell should attract the attention of awake monsters
  • Player stealth should relate to sound propagation
  • Maybe some monsters should track by "sensing life force", so always be aware of the player inside a given radius
  • Groups - I had a rough implementation of groups, group leaders and random targets in FA, and there is now unused code for monster targets in V

Some bits of this will be easier than others.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old October 16, 2015, 19:14   #4
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,372
AnonymousHero is on a distinguished road
Don't have any detailed comments, but I think this sounds like a huge improvement.
AnonymousHero is offline   Reply With Quote
Old October 16, 2015, 19:16   #5
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,372
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Nick View Post
[*]At least one state between sleep and chasing - I've been thinking of it as awake, but not aware
"Wary"? (I mean the monsters must sense some danger too, right?)
AnonymousHero is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
behavior of unknown runes leaked saarn v4 3 April 23, 2012 22:40
Odd map behavior... dhegler Vanilla 2 December 23, 2009 19:54
Unusual Jewelry behavior - r1321 Jungle_Boy Vanilla 0 April 9, 2009 21:53
3.1.0beta monster behavior and a few other things tigen Vanilla 3 January 17, 2009 07:30
Hound Behavior Zero Vanilla 13 February 12, 2008 23:29


All times are GMT +1. The time now is 07:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.