Frictional Games Forum (read-only)
Enemy can hear sounds from far away - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Enemy can hear sounds from far away (/thread-24393.html)



Enemy can hear sounds from far away - Efendi - 01-17-2014

Hello. I'm currently struggling with the enemies..

I have modified the servant_grunt.ent, so it doesn't disappear after the last pathnode. (ActivationDistance modified from 40 to 100)

So, that thing is working, but the problem is, when i'm in a room, far away from the enemies (I have 2 enemies patrolling), but when i was testing their behaviour, and throwed lots of objects around the room, one of the enemies was hearing the noise, and started to walk to the room, even when it was quite far away from his patrol path. Is this supposed to happen?

I'm not sure if it is the ActivationDistance that causes the issue, but I don't want them to disappear after finishing their last pathnodes.

Any help would be highly appreciated! Smile


RE: Enemy can hear sounds from far away - Romulator - 01-17-2014

It might be an idea to backup your grunt here, or if you want a deaf grunt throughout your entire Amnesia gameplay then we can do that :3

Seeing as you have the Level Editor, I'll assume you have the Model Editor too. Open your grunt in that which has the ActivationDistance at 100, and turn the HearVolume number within the User Defined Variables (Settings drop down menu up the top) down to 0 (and if this doesn't work, put it up to like, 100).

Also, if you don't want the grunt to disappear after the last pathnode (I THINK he'll just stand there though), untick AutoRemoveAtPathEnd, also in the User Defined Variables. That should keep him around as well.

In terms of Game Mechanics...
Spoiler below!

A grunt, as stupid as they may seem as holding a large drawer over your face says "Hey, I'm invisible!" and gets them to walk away, are responsive to sound and will investigate. A monster will attempt to make it's way to the source of the sound, often relying on pathnodes or sometimes simply walking towards the source.

This is one small aspect of the whole surreal atmosphere of Amnesia in being able to make it tougher. Seeing as enemies have the intelligence to spot you in the crowd of boxes, barrels and bricks (so long as you're a distance less than 20 (in-game metres) away), and still be able to hear you from a distance, they will come running.

The grunts however will only respond to a certain volume of sound, which is by default 0.55. Anything above this, the monster will hear and investigate. Tossing crap into the water against the Kaernk is quite loud, which is why it approaches you whenever you make a splash.




RE: Enemy can hear sounds from far away - Efendi - 01-17-2014

Thank you for your answer!

Yes, i have backed up my grunt Smile

I tried to change the HearVolume.. I first put the value to 0, nothing happened. After i put 100, they didn't hear anything, even when i throwed objects near them. Think i need to test the values.

This did solve my problem to some sort, but proper testing is needed Smile

I did add the AutoRemoveAtPathEnd, by opening the .ent file in notepad++, and added following in the UserDefinedVarables:

<Var Name="AutoRemoveAtPathEnd" Value="false" />

But is this the way to go, or should it be added somewhere in the Model Editor, because i didn't seem to find it there?

Thanks for the answer again Smile

EDIT: The AutoRemoveAtPathEnd, which i added in .ent file via notepad, seems to disappear when i do some changes to the entity in the model editor, wierd.. Any insights to this issue would also be highly appreciated.


RE: Enemy can hear sounds from far away - Romulator - 01-17-2014

Haha, well kind sir you taught me about HearVolume.

Okay, the higher it is, the louder objects or stuff have to be in order for them to grab the grunt's attention. Toy with that as much as you want, remembering that the value you set there is what the MINIMUM sound volume you'll need in order to get the attention.

And no, that code is fine! The Model Editor way is just a way to do it with a GUI, so you don't need to open the .ent file, but what you did is okay too! Smile

Edit (in response to your edit):
When editing the .ent file, a new one is created when you save, which has the values from the Model Editor in there. Just re-add it each time you make an adjustment, or check that you can't see it.

In the Model Editor's User Defined Variables for the grunt, the third or so option should be a Checkbox, which says AutoRemoveAtPathEnd or similar. Just uncheck that and you shouldn't lose your grunt Big Grin