Re-evaluating monster fleeing behaviour


Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Friday, 7th October 2011, 04:38

Re-evaluating monster fleeing behaviour

I don't like the way monsters flee when their HP is low, and I'm not the only person who feels this way. I have also seen it mentioned in ##crawl-dev that it could be worth re-thinking fleeing behaviour. Because of this, I've written a rather long wiki page which can be found here:

https://crawl.develz.org/wiki/doku.php? ... at:fleeing

What I do is analyze fleeing tactics (particularly with regards to melee characters) and then propose a few solutions to make it less tedious. My proposals are simple and fairly conservative, for the most part.

I'm not going to paste the whole thing I wrote here, but if anyone wants to talk about it without editing the wiki page, feel free to do so here.
User avatar

Swamp Slogger

Posts: 149

Joined: Friday, 17th December 2010, 15:39

Location: Thuringia

Post Friday, 7th October 2011, 06:23

Re: Re-evaluating monster fleeing behaviour

As far as I understand it, you don't like the most basic combat tactic, thast is: to manoeuvre. You want the need for it in melee effectively removed from the game.
To avoid the need for a certain tactic is to choose another strategy.
-> (g) IS the solution for your problem.

Spider Stomper

Posts: 195

Joined: Monday, 25th April 2011, 20:48

Post Friday, 7th October 2011, 06:29

Re: Re-evaluating monster fleeing behaviour

Mychaelh wrote:As far as I understand it, you don't like the most basic combat tactic, thast is: to manoeuvre. You want the need for it in melee effectively removed from the game.
To avoid the need for a certain tactic is to choose another strategy.
-> (g) IS the solution for your problem.


Maneuvering is:
A) A basic combat tactic, or
B) in the context of chasing down fleeing monsters, a fiddly thing that you have to do purely to make a tedious aspect of the game kind of less tedious.

It's B he wants to minimize, not A.
User avatar

Swamp Slogger

Posts: 149

Joined: Friday, 17th December 2010, 15:39

Location: Thuringia

Post Friday, 7th October 2011, 06:37

Re: Re-evaluating monster fleeing behaviour

It is also A) of monsters with the intention to avoid harm through making things B) for the player.
To avoid B) he want's to minimize A.

For this message the author Mychaelh has received thanks:
TehDruid

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Friday, 7th October 2011, 06:45

Re: Re-evaluating monster fleeing behaviour

Mychaelh wrote:As far as I understand it, you don't like the most basic combat tactic, thast is: to manoeuvre. You want the need for it in melee effectively removed from the game.
To avoid the need for a certain tactic is to choose another strategy.
-> (g) IS the solution for your problem.

The type of manoeuvring I argue against has very little value. Chasing an enemy into a corner does not make the game significantly more interesting, but it does make the game more boring. This is my point.

I do not mind other types of movement (eg positioning yourself into a corridor, or backing away from ranged attackers), and to say that I have a problem with those is to wildly misconstrue my argument. Besides that, most enemies don't even flee.

I could stop playing melee characters, it's true. I would rather just stop playing crawl, though.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Friday, 7th October 2011, 06:50

Re: Re-evaluating monster fleeing behaviour

Mychaelh wrote:It is also A) of monsters with the intention to avoid harm through making things B) for the player.
To avoid B) he want's to minimize A.

what does this even mean

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Friday, 7th October 2011, 06:57

Re: Re-evaluating monster fleeing behaviour

I think, as a melee character, you need some kind of range anyway. And slings with some skill investment (8-10 levels) can pick out fleeing elephants and death yaks just fine. I'm not even talking about stuff like crossbows, javelins, large rocks or decent rods, since they're much less common. And as a melee character, you have some xp to spare for Invo, Throwing, Slings or stuff like that. And it's not like you'll be levelling those secondary skills just for that as you implied. Softening tough enemies like hydras, dealing with packs of blink frogs without excessive stair dancing, etc. it just makes life much easier.

Making fleeing less common might be a good idea. However, using ranged weapons, wands and rods doesn't mean not playing melee.

For this message the author thenewflesh has received thanks: 2
Mychaelh, TehDruid
User avatar

Swamp Slogger

Posts: 149

Joined: Friday, 17th December 2010, 15:39

Location: Thuringia

Post Friday, 7th October 2011, 07:03

Re: Re-evaluating monster fleeing behaviour

The type of manoeuvring I argue against has very little value. Chasing an enemy into a corner does not make the game significantly more interesting, but it does make the game more boring. This is my point.

I do not mind other types of movement (eg positioning yourself into a corridor, or backing away from ranged attackers), and to say that I have a problem with those is to wildly misconstrue my argument. Besides that, most enemies don't even flee.

I could stop playing melee characters, it's true. I would rather just stop playing crawl, though.


I understand this, but I see 'fleeing' not as boring and tedious. I see it as realistic, challenging and fair. Making a monster flee has removed the danger for the player, but to gain the exp-points he has eventually to chease the monster, maybe even getting in new danger while doing it.
To trivialise fleeing, also trivialises ranged weapons.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Friday, 7th October 2011, 07:10

Re: Re-evaluating monster fleeing behaviour

thenewflesh wrote:I think, as a melee character, you need some kind of range anyway. And slings with some skill investment (8-10 levels) can pick out fleeing elephants and death yaks just fine. I'm not even talking about stuff like crossbows, javelins, large rocks or decent rods, since they're much less common. And as a melee character, you have some xp to spare for Invo, Throwing, Slings or stuff like that. And it's not like you'll be levelling those secondary skills just for that as you implied. Softening tough enemies like hydras, dealing with packs of blink frogs without excessive stair dancing, etc. it just makes life much easier.

Making fleeing less common might be a good idea. However, using ranged weapons, wands and rods doesn't mean not playing melee.

Yes, this is fairly true. There are a few things that make ranged a non-ideal solution when facing packs of enemies though. When fighting say, a group of yaks, you'll probably want to get into a corridor so you're not fighting multiple at a time. Unfortunately, this means that if the one you're fighting starts to flee, it will slip behind one of the non-fleeing ones, making it impossible to hit (except for smite targeting attacks, which you probably don't have).

If you're fighting multiple enemies in the open, you're more able to pick off fleeing enemies. This can be sub-optimal though. It's better to keep fighting the ones that are a threat to you, and only start to pick off enemies once the last one starts to flee. At this point, you will probably have to chase down some of the others. Also, using a bow or crossbow is out of the question for some characters (if you are a shield user). I find the best options are throwing (javelins, but also for poison needles) and wands. Slings can work but I think throwing is better.

Ranged attacks (if you choose to use them) tend to work best on single enemies that flee, I find. But for some reason, most of these guys appear in packs. The ones that appear by themselves tend to be strong enough to be worth wand charges, though.

This is why I've proposed making it so enemies flee at lower HP (rather than 25%), and why I also proposed a way for ranged attacks to make enemies turn hostile again, and various other things like that. This way, it still exists, but it is less of a chore to deal with.
Last edited by evilmike on Friday, 7th October 2011, 07:15, edited 1 time in total.
User avatar

Tomb Titivator

Posts: 832

Joined: Saturday, 30th July 2011, 00:58

Post Friday, 7th October 2011, 07:15

Re: Re-evaluating monster fleeing behaviour

I like the proposals and would most like to see solutions 1 or 3 implemented. 2 just doesn't seem like it wouldn't be enough, but I guess it could help alleviate the issue without having a ton of gameplay impact.

Swamp is hands down the worst offender for this behavior and its extremely annoying - So much so that I've considered just diving for the rune instead of clearing most of the levels. Its one thing to want to dive for a run/treasure because of threat level, but its another if you want to dive because fighting the monsters is annoying.

And I think the guy saying "play casters" misses the whole point. Sure, I don't care about flee behavior on a Mummy Haunter because they just aren't going to get away, but casters add their own level of tedium to the game. Swamp hydra without a flaming brand are a perfect example, they can move 4 or 5 squares in 1 turn so I usually get exactly 1 chance to hit them with wand/sling/javelin before they go out of range. There is only so much positioning that can be done to alleviate this due to level layout (proximity of water tiles to land tiles), monster closing speed, and possible monster damage when in range to maneuver. Sure I could carry a flaming brand just for hydra, but if I can easily "kill" them without it then its just adding tedium - The problem comes when I have to "kill" them 4 or 5 times before I finally get the exp.

Pack behavior is bad as well. I don't think that current fleeing mechanics prevent corridor fighting as you'd still just be wasting turns chasing a fleeing monster while others beat on you so you're better off just switching to a new target if out in the open. This usually isn't a problem for my casters because I've either got Meph, Ice Cloud, Bolt of Foo, or Haunt by the time I reach relevant packs of fleeing monsters. Could I just roll casters all the time? Sure I could do that. Like I said before though, changing background due to high threat is one thing, but changing background because of annoying behavior is another.
KoboldLord wrote:I'm also morbidly curious now as to how Shatter is abusable for 'stealth tricks'. It's about as stealthy as the Kool-Aid Man smashing through the walls and running through the room

For this message the author bobross419 has received thanks:
thenewflesh
User avatar

Tomb Titivator

Posts: 832

Joined: Saturday, 30th July 2011, 00:58

Post Friday, 7th October 2011, 07:16

Re: Re-evaluating monster fleeing behaviour

@mychaelh - I agree that fleeing behavior does add a sense of realism and challenge, but I would hope that the annoyance/tedium can be reduced a bit. Lowering fleeing health % might just be the best of both worlds. I'd still have to deal with the annoying behavior but not as much as I do now.
KoboldLord wrote:I'm also morbidly curious now as to how Shatter is abusable for 'stealth tricks'. It's about as stealthy as the Kool-Aid Man smashing through the walls and running through the room

For this message the author bobross419 has received thanks:
Mychaelh

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Friday, 7th October 2011, 07:45

Re: Re-evaluating monster fleeing behaviour

If fleeing was invented to prevent fighting in corridors, then it doesn't serve its purpose. By the time I can take on pack of yaks in the open without dying in the process, I can usually kill then before they could flee.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Friday, 7th October 2011, 07:49

Re: Re-evaluating monster fleeing behaviour

thenewflesh wrote:If fleeing was invented to prevent fighting in corridors, then it doesn't serve its purpose. By the time I can take on pack of yaks in the open without dying in the process, I can usually kill then before they could flee.

Besides that, I (and other people) can think of other, better ways to discourage fighting in corridors. I think they're for another thread though.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 7th October 2011, 08:11

Re: Re-evaluating monster fleeing behaviour

evilmike: thanks for the analysis.
I think one of the problem with fleeing is that it's too predictable. Thus, I think we can apply 1 and 2 with chances. Monsters have a low chance of fleeing when at 1/4 health and the chance increases as HP gets lower. Same for breaking fleeing, chance can start at 1/3 health, and scale until guaranteed at 1/2 health.
When randomizing behaviour, keep in mind that the behaviour is evaluated twice per monster action (before and after), so you need to adapt the numbers.
Solution 3 overlaps with the upcoming constriction ability, so I won't consider it for now.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Friday, 7th October 2011, 08:18

Re: Re-evaluating monster fleeing behaviour

galehar wrote:Solution 3 overlaps with the upcoming constriction ability, so I won't consider it for now.


Is constriction a player's mesmerise? Where can I read more about it?
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 7th October 2011, 08:40

Re: Re-evaluating monster fleeing behaviour

thenewflesh wrote:
galehar wrote:Solution 3 overlaps with the upcoming constriction ability, so I won't consider it for now.


Is constriction a player's mesmerise? Where can I read more about it?

Not only, it also deals damage. Here is the wiki page.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks:
thenewflesh

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 7th October 2011, 16:20

Re: Re-evaluating monster fleeing behaviour

Awesome work, many thanks evilmike!

I agree that fleeing is a problem (the analysis is good, everyone should read it). Will comment later on the wiki, just some quick ones here:

a) Submerging is a version of fleeing, and as bad. (As b0rsuk keeps pointing out.)

b) Fleeing is okay if a few monsters do it (like a hydra or dragon), those who can be a threat when they're whole again and ready to attack you.

c) Fleeing is no fun is if killing them ranged is only work, no threat. (Like with jackals.)

So outstanding monsters fleeing is good, for them we can keep everything as is. For the large rest, short of abolishing fleeing, we should at least try to make it more interesting (for example by having the other monsters in a pack flee once the first monster flees) and/or reduce it (as per evilmike's suggestions).
User avatar

Tomb Titivator

Posts: 832

Joined: Saturday, 30th July 2011, 00:58

Post Friday, 7th October 2011, 16:27

Re: Re-evaluating monster fleeing behaviour

I was actually thinking of a stampede mechanic. It would still be annoying, but at least it would be flavorful and interesting.
KoboldLord wrote:I'm also morbidly curious now as to how Shatter is abusable for 'stealth tricks'. It's about as stealthy as the Kool-Aid Man smashing through the walls and running through the room

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Saturday, 8th October 2011, 00:35

Re: Re-evaluating monster fleeing behaviour

dpeg wrote:So outstanding monsters fleeing is good, for them we can keep everything as is. For the large rest, short of abolishing fleeing, we should at least try to make it more interesting (for example by having the other monsters in a pack flee once the first monster flees) and/or reduce it (as per evilmike's suggestions).

Hmm, I can't say I like the sound of an entire pack fleeing once one of its members starts to flee. This would be annoying in its own way, but it would also make packs of enemies too easy (cause one to flee, suddenly you're safe).

I think if you want pack behaviour to factor into fleeing, it should work like this: the more enemies that are alive in the pack, the lower chance of fleeing. The last enemy alive can have a normal chance, but when all of them are alive, the chance should be greatly reduced (their numbers boost their confidence, or something). In some ways this is the opposite of what you are suggesting, but I think it would work better.

Another version of this would be killing the leader reduces morale. This won't work for most animals though... eg a yak band has no clear leader.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Saturday, 8th October 2011, 00:41

Re: Re-evaluating monster fleeing behaviour

It would help a lot if monsters mostly spawned where no tunnels are. In this case, pack fleeing suddently makes a lot more sense: First, the pack is awake. Second, even if you found a chokepoint, the pack won't diligently line up to be mashed there.

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Saturday, 8th October 2011, 01:30

Re: Re-evaluating monster fleeing behaviour

Sorry for OT, but the whole preventing fighting in the corridors angle will simply make pure melee backgrounds irrelevant. It's impossible to survive fighting more then 2-3 relatively beefy mobs at a time. And melee characters have no other tools to deal with packs, but choke points, except, maybe, stairdancing (super fun). The reason is simple: melee characters in DCSS have no crowd control. I think it's bad and all the tactics you don't like are emerged from the need to compensate for that.

Ziggurat Zagger

Posts: 3037

Joined: Sunday, 2nd January 2011, 02:06

Post Saturday, 8th October 2011, 03:32

Re: Re-evaluating monster fleeing behaviour

I think the main problem is pack behavior. I don't have any real sympathy for somebody who refuses to train throwing or other ranged attacks at all, such that every fleeing hound or snake has to be run into a corner individually, but pack monsters are an entirely different experience. It's essentially impossible for an appropriately-leveled melee character to kill elephant or death yak packs in mid-Lair unless they have a way to damage runners through a meat shield, or unless they stair-dance members of the pack tediously upstairs.

Perhaps it would be best to handle pack morale as a group, instead of as individuals. It makes sense realistically, since pack animals in real life gather in those groups specifically for protection against predators, and an injured or panicked member should seek to stay as close as possible to the other pack members. Leaving the pack is not an idea that should even occur to their simplistic animal minds, even if those other monsters on the level are actually and inexplicably only hungry for the player's blood.

That leaves corridors. Perhaps packs should try to avoid going down corridors? They can't get the benefit of numbers there, after all. That would require some AI to deal with the player sniping from unfavorable terrain, but having them skitter off to the side to get under cover would also be an interesting behavior. They'd need to fan out while approaching the player, in order to keep the player from simply running back to that corridor. Hopefully driving the player into a corner. I suppose they might even need to recognize corridors, so they can devote extra pack members to cutting that escape route off.

For this message the author KoboldLord has received thanks:
Mychaelh

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Saturday, 8th October 2011, 03:50

Re: Re-evaluating monster fleeing behaviour

KoboldLord wrote:That leaves corridors. Perhaps packs should try to avoid going down corridors? They can't get the benefit of numbers there, after all. That would require some AI to deal with the player sniping from unfavorable terrain, but having them skitter off to the side to get under cover would also be an interesting behavior. They'd need to fan out while approaching the player, in order to keep the player from simply running back to that corridor. Hopefully driving the player into a corner. I suppose they might even need to recognize corridors, so they can devote extra pack members to cutting that escape route off.


And how do you deal with that? That leaves stair dancing as the only viable tactic against packs. Of course, if you're at least a bit stealthy, you can pick them out in small groups, but that's not the case for heavy armour characters. If you can't find/dig a choke point, you have to either stairdance or get surrounded and just bash away which doesn't work very well for level-appropriate packs. Having some range is obligatory, of course, but that won't solve the problem.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Saturday, 8th October 2011, 03:54

Re: Re-evaluating monster fleeing behaviour

KoboldLord wrote:That leaves corridors. Perhaps packs should try to avoid going down corridors? They can't get the benefit of numbers there, after all. That would require some AI to deal with the player sniping from unfavorable terrain, but having them skitter off to the side to get under cover would also be an interesting behavior. They'd need to fan out while approaching the player, in order to keep the player from simply running back to that corridor. Hopefully driving the player into a corner. I suppose they might even need to recognize corridors, so they can devote extra pack members to cutting that escape route off.

Perhaps. I consider AI improvements like this to be non-ideal (on account of complexity and indirectness) solutions to the annoyance of fleeing, though. The proposals I made on the wiki page (well, the first two proposals) are specifically meant to attack the problem of fleeing directly, in the most simple and easy to implement way I could think of. The third proposal I made is more complex, but it's more of an afterthought.

Other, more advanced modifications to the monster AI could be made elsewhere, but I believe that the problems I've described on the wiki page can be addressed (though not solved) by some very simple changes. I believe it would be best to start with simple things, and then work towards more complex solutions once the easy stuff is out of the way.

Ziggurat Zagger

Posts: 3037

Joined: Sunday, 2nd January 2011, 02:06

Post Saturday, 8th October 2011, 04:01

Re: Re-evaluating monster fleeing behaviour

thenewflesh wrote:And how do you deal with that? That leaves stair dancing as the only viable tactic against packs. Of course, if you're at least a bit stealthy, you can pick them out in small groups, but that's not the case for heavy armour characters. If you can't find/dig a choke point, you have to either stairdance or get surrounded and just bash away which doesn't work very well for level-appropriate packs. Having some range is obligatory, of course, but that won't solve the problem.


If casters start being afraid of packs because the pack will fan out to try to drive them into a corner, rather than lining up so penetrating bolt spells hit them all at once, it is no longer a problem that heavy armor characters can't handle Lair packs either. With good enough pack AI, perhaps the Lair could even be a reasonably threatening branch, rather than multiple levels of free xp.

And really, most of the time you could just shoot at the pack from cover and they'd skitter off, not to bother you again. Herbivores don't really need to be belligerent all the time, you know? Sometimes, though, they'd see an opening to wipe out a predator and they'd take it.

But yes, stair-dancing would still be a problem. Packs should probably use Dowan/Duvessa tactics against stair-dancing, and refuse to follow unless the whole pack can follow. Abandoning the herd is the scariest thing you can think of, if you're a yak.

evilmike wrote:Perhaps. I consider AI improvements like this to be non-ideal (on account of complexity and indirectness) solutions to the annoyance of fleeing, though. The proposals I made on the wiki page (well, the first two proposals) are specifically meant to attack the problem of fleeing directly, in the most simple and easy to implement way I could think of. The third proposal I made is more complex, but it's more of an afterthought.

Other, more advanced modifications to the monster AI could be made elsewhere, but I believe that the problems I've described on the wiki page can be addressed (though not solved) by some very simple changes. I believe it would be best to start with simple things, and then work towards more complex solutions once the easy stuff is out of the way.


The trouble is, I don't actually like the idea that fleeing should be essentially expunged from the game except as the specific gimmick of a few uniques and/or uncommon monsters. If playing elephant relay isn't fun, perhaps elephant packs would be better off not being in the game at all, rather than funneling themselves directly onto your sword while you hang out in a corridor. The tendency of yak and elephant monsters to flee behind the other pack members when injured is essentially their only point of interest. If that gets taken away, they need a different point of interest to justify their existence at all.

For this message the author KoboldLord has received thanks: 2
Mychaelh, thenewflesh

Swamp Slogger

Posts: 131

Joined: Monday, 29th August 2011, 22:55

Post Saturday, 8th October 2011, 04:13

Re: Re-evaluating monster fleeing behaviour

KoboldLord wrote:
And really, most of the time you could just shoot at the pack from cover and they'd skitter off, not to bother you again. Herbivores don't really need to be belligerent all the time, you know? Sometimes, though, they'd see an opening to wipe out a predator and they'd take it.

But yes, stair-dancing would still be a problem. Packs should probably use Dowan/Duvessa tactics against stair-dancing, and refuse to follow unless the whole pack can follow. Abandoning the herd is the scariest thing you can think of, if you're a yak.


Sounds reasonable. So far, there are only neutral, friendly and hostile monster. The idea that herbivores should be neutral most of the time, but can turn hostile at some point, is pretty cool. As for fleeing it would also be nice if they could damage monsters if they're on the way.

Don't forget, though, that most casters have crowd control (cloud spells, summons, etc.), so I'm not sure that your proposed changes would make them much more threatening to magic users. Again, most scummy / unfun / meta-game-ey strategies emerge from the lack of proper tools at player's disposal.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Saturday, 8th October 2011, 04:45

Re: Re-evaluating monster fleeing behaviour

KoboldLord wrote:The trouble is, I don't actually like the idea that fleeing should be essentially expunged from the game except as the specific gimmick of a few uniques and/or uncommon monsters. If playing elephant relay isn't fun, perhaps elephant packs would be better off not being in the game at all, rather than funneling themselves directly onto your sword while you hang out in a corridor.

But this is not at all what I have suggested (perhaps I was unclear). I mentioned on the wiki page that I like the idea of removing fleeing, but there is a reason why I did not argue for it, and did not seriously propose it. In fact I listed this under a section where I describe things I think don't/won't work.

What I do argue for is primarily making the threshold for fleeing ("hurt" status, defined in in the source) be lower, and also making it so the "healed" status be a lower number so monsters will not wait all the way until 50% healed to stop fleeing. galehar expanded on this idea by adding a random factor, which I think is a good idea. Fleeing will still occur under this proposal, it would just be significantly less of a nuisance to deal with.

I have mentioned other ideas in this thread, but nothing concrete. I still stand by what I wrote in the wiki page, along with galehar's improvements on it.

I think it's important to make this clear. I do not want fleeing expunged, I only want it to be less tedious. I think this can be worked towards via simple changes.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Saturday, 8th October 2011, 08:22

Re: Re-evaluating monster fleeing behaviour

In addition to the changes already discussed, I believe a simple tweak can be done for packs. If another member of the pack is currently in melee range, then no fleeing. So this should preserve the fleeing in corridor. Preventing packs from going in corridors seems too complicated and it would be hard to prevent degenerate behaviours.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

o_O

Snake Sneak

Posts: 100

Joined: Friday, 30th September 2011, 07:08

Post Saturday, 8th October 2011, 10:08

Re: Re-evaluating monster fleeing behaviour

Some ideas:

(1) odds of fleeing and flee HP thresholds depend on overall pack health and/or remaining pack members. The idea would be that some or most of a pack would fight to the death, but you would still have to chase down or ranged attack a few of them, heavily weighted toward the last few.

(2) fleeing creatures emit noise. They might wake up a hydra that comes and saves them or find a new herd of creatures to hang out with so there is some point in retreat other then annoying you. With 1, fleeing pack creatures would regain their courage and turn on you with a vengeance if they could find another pack of their own kind.

(3) severely injured pack animals in corridors could have a behavior where they sometimes rotate to the back of the pack and let a healthy animal fight without outright fleeing. A melee char fighting them in a corridor means having to deal more damage overall because some of the injured ones are healing in the back. If you fight them in the open, there is nowhere for them to fall back too. So the creatures exploit corridors to their advantage just like you. This might be incredibly annoying or it might be neat, I'm not sure.

Your ideas would be a much simpler way to deal with the problem though.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Saturday, 8th October 2011, 12:59

Re: Re-evaluating monster fleeing behaviour

I believe something can be done with AI.

But before that, I'd maintain once more than fleeing of trivial critters is pointless (Lair has too many pointless monsters anyway).

We have pursued one approach to a more interesting pack monsters with slime creatures (thanks to Amorphous for the idea). There is no way we will reuse that, but further ideas do come to mind:
(a) Certain Lair pack monsters could be of the defensive type: they would move away from you if you disturb them. They only attack if you're close, and if doing so, they're faster than normal. This works best in Lair as that is quite open. A thematic monster of this type would be yaks (herbivores). (Not elephants, as their trampling is interesting the way it is.)
(b) I believe having symbiotic behaviour could help a lot. Think of yak / boring beetle groups (one or two beetles would suffice).

To the ever-prominent comment: "This would make melee fighters unplayable." That is a static mode of thinking. First, even without further changes melee fighters would adapt by actually using a ranged attack. Second, we can change other rules as well.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Saturday, 8th October 2011, 13:12

Re: Re-evaluating monster fleeing behaviour

I tried experimenting with fleeing being a bit random, starting at a very low chance at 25% hp and increasing as it approaches 0. Note that the formula I used was just one I came up with in the span of 1 minute... it's not really worth using, but it was sufficient for seeing how something like this would play.

While the changes I made work in making fleeing less tedious to deal with (monsters are easier to kill while fleeing, and you'll kill them more often before they start to flee), it also adds a weird and somewhat annoying effect. Once a monster drops below the 25% treshold, it basically has a chance of entering fleeing every turn (I'm simplifying a bit here). Because of this, you can encounter weird situations where a monster will spontaneously enter fleeing after making a melee attack, or even when it is chasing you. I think this is bad.

Therefore, if fleeing is to be given a random factor, I think it should be triggered only when a monster takes damage (while it appears as if it already works this way from the perspective of the player, this isn't how it actually works on the technical side).

I'm going to try experimenting more over the weekend, but I don't think I'll have anything approaching a usable patch (we'll see though). I'm not the best coder and still don't know the crawl source very well.

Another thing I'd like to add: the more I experiment, the less I feel just using a percentage is a good thing. 1/4 works fine for low HP monsters, but it does not work well for high HP ones. Back when bone dragons used to flee, they could start fleeing at 68 hp. It was awful. I don't think there are any monsters with quite that much HP able to flee any more, but there are still some with pretty large numbers.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Saturday, 8th October 2011, 16:57

Re: Re-evaluating monster fleeing behaviour

You already need an idea for how to deal with slime creatures. I believe that extending that flexibility (not the mechanic is good).
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Saturday, 8th October 2011, 20:55

Re: Re-evaluating monster fleeing behaviour

evilmike wrote:Therefore, if fleeing is to be given a random factor, I think it should be triggered only when a monster takes damage (while it appears as if it already works this way from the perspective of the player, this isn't how it actually works on the technical side).

Good point, but that's easy to do. Move the code to behaviour_event (ME_WHACK).

evilmike wrote:I'm going to try experimenting more over the weekend, but I don't think I'll have anything approaching a usable patch (we'll see though). I'm not the best coder and still don't know the crawl source very well.

Well, even if you have a some partially working ugly code, don't hesitate to submit it. We can clean it up and fix it, it's still less work for us than starting from scratch.

evilmike wrote:Another thing I'd like to add: the more I experiment, the less I feel just using a percentage is a good thing. 1/4 works fine for low HP monsters, but it does not work well for high HP ones.

Well, we can use something like min(max_hp / 4, 20) for the threshold. Then the chance would be x_chance_in_y(threshold - hp, threshold).
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Sunday, 9th October 2011, 01:46

Re: Re-evaluating monster fleeing behaviour

galehar wrote:
evilmike wrote:Therefore, if fleeing is to be given a random factor, I think it should be triggered only when a monster takes damage (while it appears as if it already works this way from the perspective of the player, this isn't how it actually works on the technical side).

Good point, but that's easy to do. Move the code to behaviour_event (ME_WHACK).

Yeah, it seems fairly simple. That reminds me of something funny I noticed, by the way.

Melee attacks (not ranged!) can cause monsters to stop fleeing. This is usually seen when a monster is fleeing and between 25% and 50% hp. I think it can also happen if you use cause fear, but I haven't tested. Seems pretty normal...

...except when fleeing is made random. With this change, suddenly a monster below 25% will stop fleeing if you melee it. Except, only for a turn or two, then it will start fleeing again (or sometimes it will continue fleeing... but from what I can tell, what is really happening is the monster stops fleeing and then starts again immediately). I thought this was pretty funny. As far as I can tell it even works like this without making fleeing random, it's just that it's fairly invisible to the player and happens 100% of the time, so you'll never see a weird case like what I'm talking about.

Fixing this is quite simple from what I can tell, but it's a rather interesting side effect of making fleeing randomly triggered in the crude way I did it.

galehar wrote:Well, we can use something like min(max_hp / 4, 20) for the threshold. Then the chance would be x_chance_in_y(threshold - hp, threshold).

Yeah, I was thinking something along those lines too (and that 20 would be a good number to use for this).

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Sunday, 9th October 2011, 05:31

Re: Re-evaluating monster fleeing behaviour

thenewflesh wrote:Okay, this is going off topic, fast. I'm sorry. Maybe, discussing current state and future of ranged characters deserve its own topic?

Please do so. This thread isn't meant to be about the general viability of pure ranged vs pure melee. The topic might be worth discussing but I don't want to see this thread dragged off course.

Dungeon Master

Posts: 553

Joined: Wednesday, 22nd December 2010, 10:12

Post Sunday, 9th October 2011, 12:21

Re: Re-evaluating monster fleeing behaviour

galehar wrote:Well, even if you have a some partially working ugly code, don't hesitate to submit it. We can clean it up and fix it, it's still less work for us than starting from scratch.

I've made a rudimentary patch that deals with the conditions for triggering fleeing, by making it random. I'm not going to upload it to mantis, because there are some problems with it (it's at the bottom of this post).

It works for melee and other normal sources of damage (ranged attacks, most spells, etc). Unfortunately, a bunch of sources of damage are left out... including torment, poison, and damage from clouds (this is something I just noticed btw...). Because I've changed fleeing to trigger when a monster is hit, monsters simply will not flee when dying of poison, or tormented to 3 hp, or when freezing in a cloud.

I don't know of a good way to work around this though. Making fleeing just happen whenever a monster is at low hp doesn't work, for reasons I've mentioned in this thread already.

I'm just going to put this here in case anyone wants to try it, or knows of a way to get this to work properly.

http://pastebin.com/7BUU5LQM
User avatar

Dungeon Master

Posts: 182

Joined: Saturday, 18th December 2010, 10:26

Location: Germany

Post Sunday, 9th October 2011, 12:42

Re: Re-evaluating monster fleeing behaviour

evilmike wrote:It works for melee and other normal sources of damage (ranged attacks, most spells, etc). Unfortunately, a bunch of sources of damage are left out... including torment, poison, and damage from clouds (this is something I just noticed btw...). Because I've changed fleeing to trigger when a monster is hit, monsters simply will not flee when dying of poison, or tormented to 3 hp, or when freezing in a cloud.

I don't know of a good way to work around this though. Making fleeing just happen whenever a monster is at low hp doesn't work, for reasons I've mentioned in this thread already.


Couldn't you move the check to when a monster takes damage rather than when it is hit? My memory of the code is a bit hazy, so if damage dealt (hp loss) isn't handled in a wrapper method of its own, that would be a good change in any case.

Of course, seeing how monsters can take damage without the player's influence (traps, natural clouds) they might have nothing to flee *from*, in which case the situation is probably better described as "panic". I think they could be safely treated as fleeing anyway in that they will be wary of any potential danger.
Please report bugs to Crawl's bug tracker, and leave feedback on the development wiki. Thank you!
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Sunday, 9th October 2011, 20:17

Re: Re-evaluating monster fleeing behaviour

evilmike wrote:
thenewflesh wrote:Okay, this is going off topic, fast. I'm sorry. Maybe, discussing current state and future of ranged characters deserve its own topic?

Please do so. This thread isn't meant to be about the general viability of pure ranged vs pure melee. The topic might be worth discussing but I don't want to see this thread dragged off course.

I've move the melee vs ranged discussion to its own topic.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Tomb Titivator

Posts: 832

Joined: Saturday, 30th July 2011, 00:58

Post Sunday, 9th October 2011, 23:05

Re: Re-evaluating monster fleeing behaviour

Strange, I keep trying to post in the other thread and its posting here...
KoboldLord wrote:I'm also morbidly curious now as to how Shatter is abusable for 'stealth tricks'. It's about as stealthy as the Kool-Aid Man smashing through the walls and running through the room
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 20th October 2011, 17:01

Re: Re-evaluating monster fleeing behaviour

I've fixed the trigger to handle all sources of damage and pushed the patch.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Return to Game Design Discussion

Who is online

Users browsing this forum: No registered users and 64 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.