Jump to content


Photo

Spawning an AI alarm


33 replies to this topic

#1 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 05 March 2011 - 04:36 PM

I'd like to trigger a sound that would alert AI, like an alarm.

I know how to make sounds that propagate to AI, but it seems to only work when there is a "snd_X" spawnarg on the entity. snd_voice, snd_open, snd_bounce...all of these can be made to propogate to AI. But it's not obvious to me how to trigger those things, without actually having a door, or an object impact, which I don't want.

Speakers don't have a "snd_X" property. Is there a way to propagate speaker sounds to AI? Or fx sounds? Could this be done with stim/response?
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#2 Fidcal

Fidcal

    Master Mapper

  • Development Role
  • PipPipPipPipPip
  • 16686 posts

Posted 05 March 2011 - 04:44 PM

This is something I wanted too. http://bugs.angua.at/view.php?id=2209

#3 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 05 March 2011 - 05:09 PM

Ok, here are some entities that use "snd_X" properties...I'll play around with these:

"speaker" "snd_demonic"

"func_explosion" "snd_explode"

"func_earthquake" "snd_quake"

"atdm:entity_base" "snd_respawn"

"func_splat" "snd_splat"

"atdm:trigger_voice" "snd_say"
(this last one sounds promising:
This entity is defined in: def/tdm_voice.def and if will be displayed in the editor under: Sound)
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#4 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 05 March 2011 - 05:28 PM

Ok, here are some entities that use "snd_X" properties...I'll play around with these:
"atdm:trigger_voice" "snd_say"
(this last one sounds promising:
This entity is defined in: def/tdm_voice.def and if will be displayed in the editor under: Sound)


No, this one is just one that triggers the "voice script" object. It plays voices like "player voice" (e.g. the "hm") or the speaker from off (voice over I think is the correct term). It can be used to trigger voices in certain places, but these are not heard by AI. The spawnarg is just name "snd_say" because I thought that was the most logical name.

The volume of these two voices was controlled by menu, but the setting has since been removed, there are two cvars, tho.

/* A script object for atdm:voice, which can play voices (or any other sounds) so
   they appear to come from the player. Can be used for voice overs and speaker-from-off
   effects. Both effects use the volume in two different CVARs, so their volume can
   be controlled form the menu sep.

   How to use:

        * Place atdm:voice in your map (location does not matter, and you need only one)
        * Place atdm:voice_trigger in your map, and give it the following spawnargs:
                "snd_say"                       "sound_you_want_to_play"                        // generic, male or female
                "as_player"                     "1"                                                                     // if the player should say things
                "as_player"                     "0"                                                                     // if the speaker-from-off should say things
        * Then link your atdm:voice_trigger to your atdm:voice entity (CTRL-K in DarkRadiant)

        The difference between "as_player" "0" and "1" is the volume as set in the menu.

   CVARS:

    tdm_voice_player_volume
    tdm_voice_from_off_volume

   Unsupported options (taken out because the team doesn't want to add them):

    CVAR:               tdm_player_is_female
        Spawnarg:       "snd_say_female"        "female_sound_you_want_to_play"         // overrides snd_say if the player is female

*/

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#5 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 05 March 2011 - 05:31 PM

Btw, I think this needs a new scripting event, I can look into it tomorrow if you want.

Edit: We already have these:

// Sound propagation scriptfunctions on all entities
// propagate a sound directly without playing an audible sound
scriptEvent void        propSound( string name );

// propagate a sound directly with a volume modifier
scriptEvent void        propSoundMod( string name, float volMod );

I think it should be possible to create a script object that you can bind to any entity, and if triggered, it would propagate the sound (and also play an audible sound). Look for instance at the noisemaker:

void ammo_noisemaker_small::init( )
{
        // start making noise if it is active (this is set to "1" by the arrow result script)
        if( getIntKey( "result_active" ) )
        {
                float soundTimer = sys.getTime();
                float propTimer = soundTimer;

                float duration = getFloatKey( "active_duration" );
                float propInterval = getFloatKey( "prop_interval" );

                startSound( "snd_activated", SND_CHANNEL_BODY2, false );

                // play the sound, looping
                while ( sys.getTime() < ( soundTimer + duration ) && !isHidden() )
                {
                        //sys.println("TTL: " + (soundTimer + duration - sys.getTime()));

                        if( sys.getTime() > propTimer )
                        {
                                propSound("snd_active");
                                propTimer = sys.getTime() + propInterval;
                        }
                        sys.waitFrame();
                }

                stopSound( SND_CHANNEL_BODY2, false );
        }
}

See the propSounds there? Thats the line.
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#6 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 05 March 2011 - 06:59 PM

Ok, it is 0:53 here, and I am deadly tired, but it's basically done:

Resolved http://bugs.angua.at/view.php?id=2209

There is now:

* an atdm:alarm_sound entity (in DR under Sounds), it can emit a audible sound (for the player) and a propagated sound for AI. It can do so infinitely (active_duration == 0), or for X seconds (active_duration == x). It can also toggle bound children or targets, meaning you can link this entity directly to f.i. a light. (or a speaker if you'd wanted, or multiple lights, or a door that closes slowly. Whatever you want :) You can also have multiple alarm sounds.
* behind the scenes there is a script object that implements this
* there are two target entities, atdm:start_alarm and atdm:stop_alarm (in DR under Targets), these basically just call the proper function on the atdm:alarm_sound entity they are linked to. You can trigger them from any trigger you want, even multiple times, or from switches, buttons, whatever you want.

I also made a test map, test/trigger_alarm.map. If you walk through the trigger, you will start the alarm. Two levers, one for shutting it down (left) and one for restarting it (right).

The only thing that doesn't work is that the builder does not get alerted, even tho the console says:

PROPAGATING: From entity atdm_alarm_sound_1, sound "yell", volume modifier 0.000000, duration modifier 1.000000 
PROPAGATING: From entity atdm_ai_builder_guard_1, sound "tell", volume modifier 0.000000, duration modifier 1.000000  origin of sound: -1.5 -208 170.32

But debugging this is for tomorrow.

Springheel, could you please look at the testmap and see if the setup makes sense?
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#7 greebo

greebo

    Heroic Coder

  • Root
  • 16053 posts

Posted 06 March 2011 - 05:00 AM

Good work there, Tels.

#8 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 06:26 AM

Greebo, do you know why the Builder is not rushing towards the sound? The console hints it gets the propagated sound, but he does not react.

I used "yell", maybe there is another I should use? Or make a custom one?
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#9 greebo

greebo

    Heroic Coder

  • Root
  • 16053 posts

Posted 06 March 2011 - 08:00 AM

My guess is that the initiator of the sound (the speaker) is not regarded as enemy entity. I'd have to check it out myself.

#10 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 06 March 2011 - 08:15 AM

I haven't had a chance to check yet, but sounds promising.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#11 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 09:04 AM

My guess is that the initiator of the sound (the speaker) is not regarded as enemy entity. I'd have to check it out myself.


Ah,yes, while explaining this this morning to my GF I had the idea that the "team" might play a role. However, just creating a new team (17) for the speaker, then adjusting the relations might not work, the guards would then run towards the speaker and regard it as an enemy? Would they try to attack the speaker?

(Or is this backwards, the guards only cares if the yell comes from a friendly entity?)

Gonna test this :)

Edit: The builder ignores the alarm, with team 0 and team 17 set on the atdm:alarm_entity. Hm.
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#12 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 06 March 2011 - 09:17 AM

Other propagated sounds have a flag set on them to set whether it should be a suspicious sound or not. However, the default is to treat it as suspicious. So I'm not sure what's going on there.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#13 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 09:26 AM

Other propagated sounds have a flag set on them to set whether it should be a suspicious sound or not. However, the default is to treat it as suspicious. So I'm not sure what's going on there.


There are other spawnargs like "alert_factor" and "alert_max", but in true id/TDM fashion, they are not documented :D

Anyway, I looked into the code and it does:

        // For objects (non-actors) the team will be set to -1
        mteam = (maker->IsType(idActor::Type)) ? static_cast<idActor*>(maker)->team : -1;

Maybe a team of "-1" causes the builder to ignore it. Still investigating...
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#14 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 09:54 AM

I have inserted some debug prints, and the alarm definitely reaches the builder:

PROPAGATING: From entity player1, sound "footstep_default_walk", volume modifier -3.900000, duration modifier 1.000000 
Propagation volume: 38.70 Range: 279.53 units
PROPAGATING: From entity atdm_alarm_sound_1, sound "yell", volume modifier 0.000000, duration modifier 1.000000 
Propagation volume: 58.00 Range: 1889.76 units

However, there are a few curious things:

* the range is checked against a bounds - this is, however, a rectangle, not a circle. So it might be that some sounds are heard much further then they should. The builder situated at the shown location would hear a sound emitted by something in the center of the circle even tho he is out-of-range:

sound_propagation.jpg

* The builder still simply ignores the sound and I do not know yet why
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#15 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 09:59 AM

Here is what the log says, I have no idea what most of this means, tho:

[DarkMod/sndProp.cpp ( 751):DEB (SOUND) FR:  596] Found propagated sound "yell" in the def.
[DarkMod/sndProp.cpp ( 436):DEB (SOUND) FR:  596] PROPAGATING: From entity atdm_alarm_sound_1, sound "yell", volume modifier 0.000000, duration modifier 1.000000
[DarkMod/sndProp.cpp ( 688):DEB (SOUND) FR:  596] Parsing team alert and propagation flags from propagated_sounds.def
[DarkMod/sndProp.cpp ( 725):DEB (SOUND) FR:  596] Finished transfering sound prop parms
[DarkMod/sndProp.cpp ( 476):DEB (SOUND) FR:  596] Found modified duration 100.000000
[DarkMod/sndProp.cpp ( 516):DEB (SOUND) FR:  596] Found 1 ents with valid type for propagation
[DarkMod/sndProp.cpp ( 545):DEB (SOUND) FR:  596] AI atdm_ai_builder_guard_1 is within propagation cutoff range 1889.763794
[DarkMod/sndProp.cpp ( 552):DEB (SOUND) FR:  596] Sound was propagated from inanimate object: Alerts all teams
[DarkMod/sndProp.cpp ( 576):DEB (SOUND) FR:  596] Found a valid propagation target: atdm_ai_builder_guard_1
[DarkMod/sndProp.cpp ( 608):DEB (SOUND) FR:  596] Beginning propagation to 1 targets
[DarkMod/sndProp.cpp ( 615):DEB (SOUND) FR:  596] Filling populated areas array with AI
[DarkMod/sndProp.cpp ( 656):DEB (SOUND) FR:  596] Processed AI atdm_ai_builder_guard_1 in area 1
[DarkMod/sndProp.cpp ( 771):DEB (SOUND) FR:  596] Starting wavefront expansion
[DarkMod/sndProp.cpp ( 783):DEB (SOUND) FR:  596] Processing initial area
[DarkMod/sndProp.cpp ( 786):DEB (SOUND) FR:  596] Sound origin is in portal area: 2
[DarkMod/sndProp.cpp ( 825):DEB (SOUND) FR:  596] Loss at portal 0 is 24.978001 [dB]
[DarkMod/sndProp.cpp ( 826):DEB (SOUND) FR:  596] Dist at portal 0 is 4.717105 [m]
[DarkMod/sndProp.cpp ( 846):DEB (SOUND) FR:  596] Starting main loop
[DarkMod/sndProp.cpp ( 855):DEB (SOUND) FR:  596] Expansion loop, iteration 2
[DarkMod/sndProp.cpp ( 865):DEB (SOUND) FR:  596] Flooding area 1 thru portal handle 1
[DarkMod/sndProp.cpp ( 881):DEB (SOUND) FR:  596] Identified local portal index 0
[DarkMod/sndProp.cpp ( 671):DEB (SOUND) FR:  596] Expansion done, processing AI
[DarkMod/sndProp.cpp (1000):DEB (SOUND) FR:  596] Processing pop. area 1
[DarkMod/sndProp.cpp (1058):DEB (SOUND) FR:  596] Calculating least loss for AI atdm_ai_builder_guard_1 in area 1
[DarkMod/sndProp.cpp (1072):DEB (SOUND) FR:  596] AI Calc: Distance to AI = 3.775056 [m]
[DarkMod/sndProp.cpp (1078):DEB (SOUND) FR:  596] AI Calc: Portal 0 has total Dist = 8.492162 [m]
[DarkMod/sndProp.cpp (1082):DEB (SOUND) FR:  596] AI Calc: Portal 0 has total Loss = 33.400295 [dB]
[DarkMod/sndProp.cpp (1090):DEB (SOUND) FR:  596] Portal 0 has least loss 33.400295 [dB]
[DarkMod/sndProp.cpp (1100):DEB (SOUND) FR:  596] Starting detailed path minimization for portal  0
[DarkMod/sndProp.cpp (1321):DEB (SOUND) FR:  596] Path min: Performing first iteration for 1 floods
[DarkMod/sndProp.cpp (1342):DEB (SOUND) FR:  596] Path min: Skipping second iteration, not enough portals
[DarkMod/sndProp.cpp (1418):DEB (SOUND) FR:  596] Detailed path minimization for AI atdm_ai_builder_guard_1 finished
[DarkMod/sndProp.cpp (1107):DEB (SOUND) FR:  596] Propagated volume found to be 20.250633
[DarkMod/sndProp.cpp (1108):DEB (SOUND) FR:  596] Messaging AI atdm_ai_builder_guard_1 in area 1
[DarkMod/sndProp.cpp (1150):DEB (SOUND) FR:  596] Propagated sound yell to AI atdm_ai_builder_guard_1, from origin -36 -392 188 : Propagated volume 20.250633, Apparent origin of sound: -1.5 -208 170.32
[game/entity.cpp (3885):DEB (SOUND) FR:  596] Found local suspicious sound def for propagate on entity, attempting to propagate with global sound yell

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#16 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 10:45 AM

Okay, turning on more logging shows:

[game/ai/ai.cpp (8382):DEB (AI) FR: 2347] AI Hear Sound called
[game/ai/ai.cpp (8471):DEB (AI) FR: 2347] AlertAI called
[game/ai/ai.cpp (8496):DEB (AI) FR: 2347] Grace period active, testing...
[game/ai/ai.cpp (8499):DEB (AI) FR: 2347] Grace period found to have expired. Resetting.
[game/ai/ai.cpp (8528):DEB (AI) FR: 2347] Alert 1.050632 above threshold 0.000000, or actor is not grace period actor
[game/ai/ai.cpp (8576):DEB (AI) FR: 2347] idAI::SetAlertLevel atdm_ai_builder_guard_1 Set AI_AlertLevel = 2.54
[game/ai/ai.cpp (8539):DEB (AI) FR: 2347] AI ALERT: AI atdm_ai_builder_guard_1 alerted by alert type "aud",  amount 1.050632 (modified by acuity 1.000000).  Total alert level now: 2.537997
[game/ai/ai.cpp (8462):DEB (AI) FR: 2347] AI atdm_ai_builder_guard_1 HEARD a sound

So basically he is alerted, but only by a very minor amount. I now created a new def:

// Tels: Used by atdm:alarm_sound
entityDef sprGS_alarm
{
        "inherit"       "atdm:propagated_sound_base"
        "vol"           "68"
        "dur"           "500"
        "alert_factor"  "2.5"
        "alert_max"     "40"

        "prop_to_friend" "1"

        "editor_usage"  "Propagated sound by atdm:alarm_sound, they are intended to alert everyone."
}

I am not sure if the values are right, but the builder gets alerted now :) IMO he should run to the alarm, tho, but I am not sure how to set this up that they do this automatically?

Anyway, I also pimped the testmap with a vault-door that slowly closes unless you disable the alarm :)

What does not work is the new further away builder, he does ignore the alarm. I guess I need to turn up the volume to 11 :D (Yes, thats it, vol 88 and he gets alerted, too.)
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#17 Fidcal

Fidcal

    Master Mapper

  • Development Role
  • PipPipPipPipPip
  • 16686 posts

Posted 06 March 2011 - 12:04 PM

Good progress! :)

#18 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 12:13 PM

One thing missing is the visual alert. If you have f.i. a deaf builder, he would ignore the flashing lights. Does anybody know how to make a light being suspicious when it is on? I think we have "door must be closed" or "light should be on", but do we have the equivalent of "light should not be on"?

It would certainly be easier if you could just set a flag on the light...
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#19 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 06 March 2011 - 01:04 PM

I am not sure if the values are right, but the builder gets alerted now :) IMO he should run to the alarm, tho, but I am not sure how to set this up that they do this automatically?


The code will essentially treat this as if an AI yelled at the spot the speaker is placed; AI should run there and proceed to search that immediate area. This is probably good default behaviour, though mappers might want different behaviour in some cases.

If that's not happening, is it possible the sound is set to omni? Or perhaps it is in an area the AI can't get to?
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#20 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 02:46 PM

The code will essentially treat this as if an AI yelled at the spot the speaker is placed; AI should run there and proceed to search that immediate area. This is probably good default behaviour, though mappers might want different behaviour in some cases.

If that's not happening, is it possible the sound is set to omni? Or perhaps it is in an area the AI can't get to?


The problem is that the AI is not running at all, they start to search where they stand and only "edge" towards the alarm.

The speaker is not omni (but I am not sure if the AI even takes the spaker into account, or just cares for the propagated sound, anyway):

    "s_looping"                     "1"     // loops until stopped
    "s_global"                      "0"     // is not a global speaker
    "s_music"                       "0"     // is not music
    "s_volume"                      "60"
    "s_omni"                        "0"     // not omnidirectional

But the non-reachable could be, the alert is placed over the little block with the levers. I try to place it in front of it.

Edit: That reminds me, the mapper also might want to modify the alert radius. I think exposing a volume modifier for the propagated sound (defaulting to 1.0) should do the trick.
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#21 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 06 March 2011 - 03:14 PM

The problem is that the AI is not running at all, they start to search where they stand and only "edge" towards the alarm.


The behaviour should be the same as if the player shot a fire arrow to that spot. The AI will converge to the area and start looking at the good hiding spots. If the test AI is in the same room he won't necessarily go right up to the exact spot.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#22 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 06 March 2011 - 04:10 PM

Btw, the "alert_volume_mod" spawnarg has been implemented. For the "alert_factor", it seems there is not yet a scripting event that can pass this value, so I'd need to add this to the code first.

The behaviour should be the same as if the player shot a fire arrow to that spot. The AI will converge to the area and start looking at the good hiding spots. If the test AI is in the same room he won't necessarily go right up to the exact spot.


That is not really what happens, even after I moved the alert entity in front of the block and upped the volume and alert modifiers again:

there_is_an_alarm_lets_cautiously_move_slowly_towards_it.jpg

This is after several seconds after the alert, the AI are at alert index 4 (cautious searching), alert about 22. The don't seem to get higher even if I up the volume and alert_factor on the speaker.

You can see on the builder in the tunnel that he hasn't made much progress towards the alarm yet. Eventually they converge on the spot, true, but I'd like to see a bit more action, even from old Builders :)

Edit: I should note they are the same team as the player, so they only have auditory sense, they don't "see" the alert as the alert speaker is invisible and the player ignored by them. And they don't notice the flashing lights. Maybe this is the expected (or implemented) behaviour?
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#23 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 06 March 2011 - 08:27 PM

Ok, I tested the map a bit and noticed some interesting things. The AI do head towards the location of the alarm entity...when I moved it into the left hand tunnel, the two northern builders both drew their weapon and headed over to it. However, they didn't run, they used their searching walk. Oddly, when I moved the alarm right over to the left-hand builder, the northern builders didn't hear it at all. Neither could I, until I went down the tunnel a ways.

That doesn't seem right, since a volume of 98 is enough to draw AI from the far corners of a large map. I'm going to try a few things.

edit: Hmm, their reaction seems to be consistent with shooting fire arrows or noise arrows. They don't run to those positions either.

I know they run when they hear a friend "yell" in combat...maybe that's a special case?
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#24 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 07 March 2011 - 01:13 AM

Ok, I tested the map a bit and noticed some interesting things. The AI do head towards the location of the alarm entity...when I moved it into the left hand tunnel, the two northern builders both drew their weapon and headed over to it. However, they didn't run, they used their searching walk. Oddly, when I moved the alarm right over to the left-hand builder, the northern builders didn't hear it at all. Neither could I, until I went down the tunnel a ways.

That doesn't seem right, since a volume of 98 is enough to draw AI from the far corners of a large map. I'm going to try a few things.

Edit: A volume of 88 did result in the same reaction from the AI, also alert_factor 2.5 or 3.5 does not make a difference at all.


You can also use "tdm_ai_showspr_radius" (or however it was named) to see the volume radius, but I didn't find it very helpful as it is hard to judge how far it extends. "tdm_spr_debug" is also useful.

edit: Hmm, their reaction seems to be consistent with shooting fire arrows or noise arrows. They don't run to those positions either.

I know they run when they hear a friend "yell" in combat...maybe that's a special case?


When I used "yell", that was not different (except it was not so loud so they only heard it if they were practically standing next to the alarm). You can set the following to try it out:

    "snd_propagate"                 "yell"
    "sprS_propagate"                "yell"

If you set

LogDebug=1
LogClass_AI=1
LogClass_SOUND=1

in darkmod.ini, it will spew a lot of info into Darkmod.log.
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#25 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37324 posts

Posted 03 March 2012 - 08:12 PM

Resurrecting this, why do alarm entities come with a built-in "s_shader" "thunder" sound? When I add the alarm to the map, thunder sound starts playing constantly, everywhere. Oddly the one in the trigger_alarm testmap doesn't have that spawnarg, but any new alarm entity I create does.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users