![]() |
#1 |
Prophet
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,023
![]() |
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... |
![]() |
![]() |
![]() |
#2 | |
Adept
Join Date: Sep 2014
Location: TX
Posts: 139
![]() |
Quote:
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). |
|
![]() |
![]() |
![]() |
#3 | |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,668
Donated: $60
![]() |
Quote:
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. |
|
![]() |
![]() |
![]() |
#4 |
Veteran
Join Date: Jun 2007
Posts: 1,372
![]() |
Don't have any detailed comments, but I think this sounds like a huge improvement.
|
![]() |
![]() |
![]() |
#5 |
Veteran
Join Date: Jun 2007
Posts: 1,372
![]() |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
behavior of unknown runes leaked | saarn | v4 | 3 | April 23, 2012 23:40 |
Odd map behavior... | dhegler | Vanilla | 2 | December 23, 2009 20:54 |
Unusual Jewelry behavior - r1321 | Jungle_Boy | Vanilla | 0 | April 9, 2009 22:53 |
3.1.0beta monster behavior and a few other things | tigen | Vanilla | 3 | January 17, 2009 08:30 |
Hound Behavior | Zero | Vanilla | 13 | February 13, 2008 00:29 |