Page 1 of 1

Why does sound atract enemies?

PostPosted: Saturday, 9th September 2017, 08:52
by alastair
The enemies would be making lots of sounds as they move around the dungeon, yet why is that when they hear any sound from the player they automatically know it's from an intruder?

Re: Why does sound atract enemies?

PostPosted: Saturday, 9th September 2017, 09:17
by Fingolfin
alastair wrote:The enemies would be making lots of sounds as they move around the dungeon, yet why is that when they hear any sound from the player they automatically know it's from an intruder?
It's a game mechanic. Why do wounds close between fights? Why does the character not feel pain?

Re: Why does sound atract enemies?

PostPosted: Saturday, 9th September 2017, 21:30
by charlatan
Fingolfin wrote:It's a game mechanic. Why do wounds close between fights? Why does the character not feel pain?


"The Tormentor calls upon the powers of darkness! Your body is wracked with pain!"

"You miscast Death Channel. You convulse helplessly as pain tears through your body!"

"The orc warrior hits you with its battleaxe of pain! You writhe in agony."

(I kid)

Re: Why does sound atract enemies?

PostPosted: Sunday, 10th September 2017, 11:34
by alastair
So you're just saying what I said but in different words, it's a game mechanic that doesn't make any thematic sense. Was hoping someone might be able to explain it, guess it's just too hard to defend!

Re: Why does sound atract enemies?

PostPosted: Sunday, 10th September 2017, 13:25
by mattlistener
Loud sounds are made by the clang of combat, destructive spells, screaming etc -- which aren't normal sounds in the dungeon. (It's an internally peaceful society.)

Re: Why does sound atract enemies?

PostPosted: Sunday, 10th September 2017, 13:49
by Shtopit
mattlistener wrote:Loud sounds are made by the clang of combat, destructive spells, screaming etc -- which aren't normal sounds in the dungeon. (It's an internally peaceful society.)

Dissenters are turned into slaves or hogs. :mrgreen:

Re: Why does sound atract enemies?

PostPosted: Sunday, 10th September 2017, 19:08
by duvessa
Monsters don't automatically know it's an intruder. If monster hears a noise from out of its line of sight, it will investigate the noise whether it came from the player or not, and the monster doesn't know whether it came from the player or not. In fact, there's not even anything in the code that tracks whether a noise originated from the player or not, so if you wanted to make monsters only investigate player-caused noise you'd have to do quite a bit of refactoring.

So you made up behaviour that doesn't actually exist, just so that you could complain about it.

Re: Why does sound atract enemies?

PostPosted: Sunday, 10th September 2017, 19:29
by Shtopit
So when you hear a blaring wail you can expect to find a load of monsters there? Or will the concentration dissipate fairly quickly, since they won't find any enemy there?

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 03:56
by alastair
Thanks for explaining how it works Duvessa, I was just being curious!

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 04:49
by duvessa
Shtopit wrote:So when you hear a blaring wail you can expect to find a load of monsters there? Or will the concentration dissipate fairly quickly, since they won't find any enemy there?
When you hear a blaring wail as the player there's no way of knowing where the blaring wail is, so you wouldn't know where to look for the monsters, but yes, quite a few monsters will probably go there (and then resume wandering when they don't find the player there).

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 14:46
by MainiacJoe
Noise is something that I've only gradually learned to appreciate. The noise meter helps a lot, even if only by overtly telling the player, "noise matters"! There's a reason top players call Qazlal a "bad god."

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 14:50
by VeryAngryFelid
IMHO we need a new consumable which prevents noise but still allows to cast spells to everyone. Useful for loud spells, wands of lightning, group stabbing. Scroll of silence is too precious.

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 19:26
by advil
As people have pointed out, monsters don't know who made noise, and just move towards it. They also don't usually have reason to make noise themselves in situations not triggered by the player, but one common one is when a monster steps on a noise trap; this is loud enough to hear from quite far away. If the noise trap is moderately close but still out of los, you'll often hear waking monsters shouting in response and they will move towards the trap at that point. In terms of what actions are noisy, player and monster actions are fairly consistent with each other, but most monsters just won't do the relevant things without the player in the picture, so you seldom hear them from afar.

The answer to the underlying "why" question is really about the distribution of labor between stealth and noise in dcss/crawl: noise is mostly meaningful only outside of los, and stealth is only meaningful inside los; the two don't interact (e.g. stealth doesn't make you quieter). It may help to know that a lot of things that you might expect to make noise based on it being called "noise" are absolutely silent. Some examples:

  • movement, player or monster
  • Going up and down stairs
  • berserking, playeror monster (unless a berserking actorplayer goes through a door, which is extremely loud)
  • Changing clothes
  • Opening or closing a door, player or monster (unless it creaks of course)
  • Wearing a ring of loudness (really needs to be renamed or something)

I think these are all things that could plausibly make noise, and (except for berserking maybe) would probably be noise that's not audible outside of los. Noise that's not audible outside los is fairly unimpactful for most situations (except that it can wake nearby monsters), and especially before noise was visually cued there would just be no point to it except to make balancing stabbing harder. The work that you might imagine for "noise" in-los is done by stealth, instead. For example, berserking sets your stealth to 0, meaning that any monster in your los will see you immediately, but because berserking is also silent they will have to enter los for this to happen -- berserking alone won't pull them. (Berserking can indirectly cause noise though: it'll wake monsters who will shout, as well as increase noise from damage a bit. Plus the door thing.)

I could imagine some refactoring that would merge the two mechanics to make something cleaner and more intuitive, but it would be a bigger overhaul than it might seem and take a lot of balancing, because this division of labor is very deeply embedded in dcss going back (I think) pre-dcss; even the current noise attenuation mechanics are very old. After adding the noise meter I briefly considered trying to have some of these commonplace actions make a little noise just for consistency purposes, and quickly decided that it creates many more problems than it solves without doing a bigger overhaul. If I were designing a stealth system from scratch I definitely wouldn't do things this way, but such is life in crawlcode.

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 20:08
by njvack
I thought berserking monsters yelled sometimes?

Somewhat relatedly: how does wandering monster behavior work? Do they endlessly autoexplore and then forget the level, or something else?

Re: Why does sound atract enemies?

PostPosted: Monday, 11th September 2017, 20:10
by severen
Its because the monstes in crawl are mostly wusses. Everyone know truly manly tough things don't cry out when struck and simply grunt and bear and go mano a mano. But crawls are wusses who cry for help, like frat boys getting into a fight.

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 01:56
by advil
njvack wrote:I thought berserking monsters yelled sometimes?


Yeah, sorry, that was completely wrong -- berserking monsters make continuous (yellow) noise in fact.

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 04:18
by syringe
advil wrote: If the noise trap is moderately close but still out of los, you'll often hear waking monsters shouting in response


Are you sure about that?

Monsters may move toward a noise, but you won't hear them shouting unless you are close to the noise, something like 3 tiles away or closer.

Noise within LOS is really important. It is why an ultra stealthy character can go unnoticed for many turns in full view of a big pack, then in 1 turn, everything suddenly knows where you are.

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 11:24
by crawlnoob
syringe wrote:
advil wrote: If the noise trap is moderately close but still out of los, you'll often hear waking monsters shouting in response


Are you sure about that?

Monsters may move toward a noise, but you won't hear them shouting unless you are close to the noise, something like 3 tiles away or closer.


I know this is wrong, because I can stand three steps away from the end of a corridor, or a corner, or whatever, and shout, and I will often hear all kinds of things out of LoS shouting (or hissing or barking or whatnot) in response. This is a good tactic btw, because the monster that shouts in response attracts other monsters (who may not have heard your shout) to its position, not to yours. And then it starts wandering towards your position. Ultimately you get all the out of LoS baddies to wander around the room, and some of them will come down your killidor I mean corridor, but not all of them at least not all at once. Compare to poking your head out, one monster sees you and shouts, the rest wake up, and at least half the room if not all of them see you and start moving en-masse to your position.

Just make sure you backtrack a good 10 or so tiles before engaging the first monster if you can't one shot it, or the sounds of your struggle will bring the others in faster.

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 12:34
by syringe
crawlnoob wrote:I can stand three steps away from the end of a corridor, or a corner, or whatever, and shout, and I will often hear all kinds of things out of LoS shouting

The noise of your shouting originates from you, which is not more than a few spaces from you, so it corroborates what I said. You will hear monsters shouting in response to noises coming from you, as well as noises so close to you (like a monster fireballing you) that they might as well be yours.

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 13:41
by advil
syringe wrote:
advil wrote: If the noise trap is moderately close but still out of los, you'll often hear waking monsters shouting in response


Are you sure about that?

Monsters may move toward a noise, but you won't hear them shouting unless you are close to the noise, something like 3 tiles away or closer.


Monster shouts are audible between 1-2 LOSs from their position, depending on the monster, the layout (worse on an open level), and other random factors. To give people a sense of this, here's the result of detonating a fireball in debug mode in vaults:5 after clearing everything in los of the vaults entrance; the player is at (38,34) and so LOS is [31,45] in the x dimension, [27,41] in the y dimension:

  Code:
The fireball explodes!
 explosion at (42, 34) : g=247 c=4 f=3 hit=40 dam=3d14 r=1
 Noise 15 (orig: 15; ambient: 0) at pos(42,34)
 Noise 5 (orig: 5; ambient: 0) at pos(38,34)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(46,34)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(43,43)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(31,31)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(31,44)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(31,26)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(51,24)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(52,38)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(52,28)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(53,31)
 You hear a deafening roar!
 Noise 12 (orig: 12; ambient: 0) at pos(36,21)
 You hear an angry hiss.
 Noise 4 (orig: 4; ambient: 0) at pos(33,49)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(55,27)
 You hear a deafening roar!
 Noise 12 (orig: 12; ambient: 0) at pos(33,50)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(55,22)
 You hear two shouts!
 Noise 8 (orig: 8; ambient: 0) at pos(56,29)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(22,41)
 You hear a deafening roar!
 Noise 12 (orig: 12; ambient: 0) at pos(26,19)
 You hear a shout!
 Noise 8 (orig: 8; ambient: 0) at pos(22,19)
 You hear a shout!
_Noise 8 (orig: 8; ambient: 0) at pos(43,55)


Noise within LOS is really important. It is why an ultra stealthy character can go unnoticed for many turns in full view of a big pack, then in 1 turn, everything suddenly knows where you are.


Well, if there's a pack and you fail the stealth check for one monster it will wake, and make noise that wakes the others; they'll then immediately detect you. But the initial trigger usually has nothing to do with noise.

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 21:32
by syringe
The player is at (38,34) and the explosion is at (42, 34). That is very close together. Shoot the fireball a bit farther and you won't hear those shouts. This is why I question that you could ever hear monsters shouting in response to a noise trap "moderately close but still out of los".

Re: Why does sound atract enemies?

PostPosted: Tuesday, 12th September 2017, 23:19
by advil
syringe wrote:The player is at (38,34) and the explosion is at (42, 34). That is very close together. Shoot the fireball a bit farther and you won't hear those shouts. This is why I question that you could ever hear monsters shouting in response to a noise trap "moderately close but still out of los".


I think you're misunderstanding something about what I was saying and/or what the scenario is. All of the resulting shouts were from outside LOS, because I cleared LOS with `&Glos`, and the furthest away shouts were 10-11 spaces outside of player LOS; they are perfectly audible to the player. The point of the fireball itself (which is, incidentally, quieter than an alarm trap) is just to cause monsters that can hear it to shout.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 01:40
by syringe
You could have used fireball or noise trap, but you wouldn't hear monsters shout if it's activated sufficiently far from you, like near the edge of your LOS.

I suspect that the monsters actually don't shout, but can't be sure. You definitely can't hear them shout.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 05:13
by advil
syringe wrote:You could have used fireball or noise trap, but you wouldn't hear monsters shout if it's activated sufficiently far from you, like near the edge of your LOS.

I suspect that the monsters actually don't shout, but can't be sure. You definitely can't hear them shout.


This seems very confused. Monsters shout outside of your LOS, and can be audible from many squares away from the edge of LOS, as the above debug log shows. The position of the fireball or noise trap doesn't matter for this point except that it won't wake monsters who don't hear it, but any woken monster will shout (and the chain reaction will wake whole groups -- further away monsters will hear the shouts that you hear and react, even if you don't hear the further ones). Whether you hear a sound is determined basically by how loud it is (plus some mechanics for attenuating noise near walls), so detonating a fireball near the edge of your los will definitely cause audible shouts if monsters are in the right position. It's easy to test.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 05:26
by Siegurt
syringe wrote:You could have used fireball or noise trap, but you wouldn't hear monsters shout if it's activated sufficiently far from you, like near the edge of your LOS.

I suspect that the monsters actually don't shout, but can't be sure. You definitely can't hear them shout.


The implication being that you would need to be within 3 tiles of the source of a noise to *also* be within the range of a creature that could shout as a result?

This is obviously wrong on the face of it. If a monster is 11 tiles away and you could hear it shout, you could hear it shout regardless of where the noise that wakes it up originated, as long as it was close enough to the *monster* to wake *it* up. A fireball 7 tiles away at the edge of your LOS could easily be closer to the same monster than one 3 tiles away, and a monster that you can hear that shouts at 11 tiles away, is just as hearable no matter whether the source of noise is closer to you or to it.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 05:39
by syringe
advil wrote:detonating a fireball near the edge of your los will definitely cause audible shouts if monsters are in the right position.


This is easy to test, why don't you try it? Sorcerers are red, high priests are blue, monster reactions to faraway sounds are inaudible to you.

Just because my observations are unintuitive or contrary to duvessa does not make them untrue.
Siegurt wrote:If a monster is 11 tiles away and you could hear it shout, you could hear it shout regardless of where the noise that wakes it up originated
why?

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 08:30
by 4Hooves2Appendages
syringe wrote:
Siegurt wrote:If a monster is 11 tiles away and you could hear it shout, you could hear it shout regardless of where the noise that wakes it up originated
why?

Because that's the way the game works.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 10:26
by Shtopit
Why do monsters sometimes shout, but then they don't come into los?

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 12:46
by 4Hooves2Appendages
It partly depends on what they shouted in response too. If it was noise from a location away from you, then they will move that way, say an alarm trap.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 12:49
by Shtopit
OK, but I sometimes shout to lure enemies, I hear a nice load of shouts, but then no one or very few come. Can it be that they go towards the other shouts, those of the monsters?

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 13:53
by Siegurt
syringe wrote:
Siegurt wrote:If a monster is 11 tiles away and you could hear it shout, you could hear it shout regardless of where the noise that wakes it up originated
why?

Because the noise that the monster makes when it shouts is the same no matter what caused it to make that noise, or where that thing was.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 14:12
by syringe
Learndb:
5.If a perceived noise is 3 grid distance or less from you, it makes the monster Seek, possibly shout and know your location. Otherwise the monster is made Wandering and walks towards the perceived noise, otherwise unaware of you. (If a noise bends around corners, the 'perceived' location is randomly fudged between the true origin and the monster's location. Otherwise it is correct.)
6.A small monster alertness/noise/stealth spoiler: viewtopic.php?p=182656#p182656

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 14:37
by Siegurt
syringe wrote:
advil wrote:detonating a fireball near the edge of your los will definitely cause audible shouts if monsters are in the right position.


This is easy to test, why don't you try it? Sorcerers are red, high priests are blue, monster reactions to faraway sounds are inaudible to you.

Just because my observations are unintuitive or contrary to duvessa does not make them untrue.
Siegurt wrote:If a monster is 11 tiles away and you could hear it shout, you could hear it shout regardless of where the noise that wakes it up originated
why?

Ok, so more investigation (with the hint from the above learnDB entry) leads to a (IMHO broken) discovery of "if the source of noise is far from you, it can't actually cause monsters to shout and start seeking you *unless the source of noise is a noise trap*".

A fireball or LRD that isn't close to you can wake up an out of LOS critter, but it *can't* shout, and therefore you wouldn't hear it (and it wanders, rather than seeking you, specifically) If a monster out of LOS is made to shout for any reason, regardless of the source you *can* hear it if you are close enough to the critter, but an explosion noise *can't* cause a critter to shout if the source of that explosion isn't close to you. (I don't know the "location" of for example, Qaz's storms, does each cloud generate it's own noise, or do you just emit noise from your location, if it's the former, it might explain why Qaz never seems as bad as I expect.)

So the problem wasn't with your evidence, it was with the way you stated your conclusion, it's not that creatures's shouts are inaudible, it's that they actually aren't made to shout at all if the apparent source of the sound isn't very near the player. You did mention that you didn't think that critters didn't shout earlier, but I'd elided that into an assumption about not hearing them.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 14:58
by advil
Siegurt wrote:
syringe wrote:
advil wrote:detonating a fireball near the edge of your los will definitely cause audible shouts if monsters are in the right position.


This is easy to test, why don't you try it? Sorcerers are red, high priests are blue, monster reactions to faraway sounds are inaudible to you.

Just because my observations are unintuitive or contrary to duvessa does not make them untrue.
Siegurt wrote:If a monster is 11 tiles away and you could hear it shout, you could hear it shout regardless of where the noise that wakes it up originated
why?

Ok, so more investigation (with the hint from the above learnDB entry) leads to a (IMHO broken) discovery of "if the source of noise is far from you, it can't actually cause monsters to shout and start seeking you *unless the source of noise is a noise trap*".

A fireball or LRD that isn't close to you can wake up an out of LOS critter, but it *can't* shout, and therefore you wouldn't hear it (and it wanders, rather than seeking you, specifically) If a monster out of LOS is made to shout for any reason, regardless of the source you *can* hear it if you are close enough to the critter, but an explosion noise *can't* cause a critter to shout if the source of that explosion isn't close to you. (I don't know the "location" of for example, Qaz's storms, does each cloud generate it's own noise, or do you just emit noise from your location, if it's the former, it might explain why Qaz never seems as bad as I expect.)

So the problem wasn't with your evidence, it was with the way you stated your conclusion, it's not that creatures's shouts are inaudible, it's that they actually aren't made to shout at all if the apparent source of the sound isn't very near the player. You did mention that you didn't think that critters didn't shout earlier, but I'd elided that into an assumption about not hearing them.


Yes, I've been looking into this some more and the current behavior is extremely weird (and not what anyone in here thought, really). Monsters only shout if you are their foe, and on loud noises only set you as their foe if their fuzzed perception of the noise source is within a few tiles of your actual location (which they somehow know), otherwise foe stays as MHITNOT. I'm going to change this somehow I think, though it's not obvious how to do it and avoid some balance issues.

(For the qaz question, the radius is large enough -- 3 squares grid distance -- that there'll still be a ton of noise coming from your perceived location.)

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 15:12
by Siegurt
advil wrote:Yes, I've been looking into this some more and the current behavior is extremely weird (and not what anyone in here thought, really). Monsters only shout if you are their foe, and on loud noises only set you as their foe if their fuzzed perception of the noise source is within a few tiles of your actual location (which they somehow know), otherwise foe stays as MHITNOT. I'm going to change this somehow I think, though it's not obvious how to do it and avoid some balance issues.

(For the qaz question, the radius is large enough -- 3 squares grid distance -- that there'll still be a ton of noise coming from your perceived location.)


I'd suggest making noise decreasingly likely to set you as their foe depending on distance from you (100% at you, something like 10% at LOS) with the other possibility being the current wandering/MHITNOT behavior, maybe something slightly less harsh than that if we don't want to overly perturb the current balance of how many things get attracted to your location.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 15:45
by advil
Siegurt wrote:
advil wrote:Yes, I've been looking into this some more and the current behavior is extremely weird (and not what anyone in here thought, really). Monsters only shout if you are their foe, and on loud noises only set you as their foe if their fuzzed perception of the noise source is within a few tiles of your actual location (which they somehow know), otherwise foe stays as MHITNOT. I'm going to change this somehow I think, though it's not obvious how to do it and avoid some balance issues.

(For the qaz question, the radius is large enough -- 3 squares grid distance -- that there'll still be a ton of noise coming from your perceived location.)


I'd suggest making noise decreasingly likely to set you as their foe depending on distance from you (100% at you, something like 10% at LOS) with the other possibility being the current wandering/MHITNOT behavior, maybe something slightly less harsh than that if we don't want to overly perturb the current balance of how many things get attracted to your location.


Yeah, I agree that removing the secret 3-space breakpoint is something that needs to happen; probably whatever I do will unavoidably be a nerf to fireball and related spells but I'll have to play with the numbers.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 16:48
by duvessa
syringe wrote:Just because my observations are unintuitive or contrary to duvessa does not make them untrue.
Hey now, your observations aren't contrary to anything I said. Blame advil and Siegurt instead.

The reason it works the way it does is to prevent shouts from causing a chain reaction across the entire level. It's unintuitive but probably necessary if monster shouting is going to exist. Imagine what would happen on Vaults:5 without it, for example.

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 22:16
by syringe
Siegurt wrote:So the problem wasn't with your evidence, it was with the way you stated your conclusion

Yes, it is all my fault.

Be diligent about changing how noise works, it is a Pandora's box that has been open for 10+ years.

You could change the arbitrary radius of 3 to the meaningful radius of LOS, or min(noise,LOS). This would be a player nerf, mostly.

For a player mostly-buff, consider making monsters withhold shouting until they enter your LOS and notice you (or "foe" - player's ally?).

Consider removing or generalizing the fuzzing mechanic. Why are corners special, anyway?

You can have noise affect the stealth rating if you get to messing with that deep embedding you talked about.

And I don't understand the insistence that you hear all noise that reaches you, and only that noise- you hear a whisper from 15 tiles away:
  Code:
 You hear an angry hiss.
 Noise 4 (orig: 4; ambient: 0) at pos(33,49)

Re: Why does sound atract enemies?

PostPosted: Wednesday, 13th September 2017, 23:33
by duvessa
I preferred it when noise wasn't affected by walls at all tbh.

Re: Why does sound atract enemies?

PostPosted: Thursday, 14th September 2017, 07:08
by alastair
Yay!

Re: Why does sound atract enemies?

PostPosted: Thursday, 14th September 2017, 17:23
by syringe
duvessa wrote:In fact, there's not even anything in the code that tracks whether a noise originated from the player or not, so if you wanted to make monsters only investigate player-caused noise you'd have to do quite a bit of refactoring.

shout.cc wrote:1385 // If the noise came from the character, any nearby monster
1386 // will be jumping on top of them.

Re: Why does sound atract enemies?

PostPosted: Thursday, 14th September 2017, 17:36
by advil
syringe wrote:
duvessa wrote:In fact, there's not even anything in the code that tracks whether a noise originated from the player or not, so if you wanted to make monsters only investigate player-caused noise you'd have to do quite a bit of refactoring.

shout.cc wrote:1385 // If the noise came from the character, any nearby monster
1386 // will be jumping on top of them.


To be clear duvessa was technically right (and this comment inaccurate) because the following code doesn't really check whether the noise came from the character, just whether the noise came from nearby the character, so it gets a superset of the noise that came from the character. (That is, if a monster shouts next to the character, it would get chalked up to the character most likely.) But it is correct that the decision of whether to alert vs disturb during noise propagation depends on the player's actual position. That comment persisted from the pre-noise-propagation version, where it was correct -- that version only checked whether noise came from exactly the character's position. The noise propagation code added the <=3 part for some reason, I suspect because of the fuzzing. In any case I started with a small change along the lines of Siegurt's suggestion here, that also fixed that comment.

Re: Why does sound atract enemies?

PostPosted: Thursday, 14th September 2017, 18:13
by syringe
Since when is source = cause? Anyway if there were no <=3 part, then a monster shouting right next to you would not be able to alert other monsters to your position. They would have to continue to wander until they beat your stealth check, or until they blindly bumped into you. Doubtful this existed. There must have been some other way monsters made each other notice you. How did it work? "The old noise propagation system alerted all monsters within `loudness' radius of the noise source, ignoring obstacles between the observer and the noise source." - ?

Is this new chance to alert rolled once per noise, for all monsters? Or separately for each monster that hears the noise?

Re: Why does sound atract enemies?

PostPosted: Thursday, 14th September 2017, 18:32
by advil
syringe wrote:Since when is source = cause? Anyway if there were no <=3 part, then a monster shouting right next to you would not be able to alert other monsters to your position. They would have to continue to wander until they beat your stealth check, or until they blindly bumped into you. Doubtful this existed. There must have been some other way monsters made each other notice you. How did it work? "The old noise propagation system alerted all monsters within `loudness' radius of the noise source, ignoring obstacles between the observer and the noise source." - ?

Is this new chance to alert rolled once per noise, for all monsters? Or separately for each monster that hears the noise?


I'm not entirely sure how (or if) it worked, but here's where that comment came from.

Edit: in the new version the roll is once per monster at the point in the code where the monster hears the noise; really everything is the same as before except I changed a step function with a breakpoint at 4 to a linear function.