A_KlaxonBlare and A_ClearSoundTarget do not unalert actors

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

A_KlaxonBlare and A_ClearSoundTarget do not unalert actors

Post by Skippy »

[Based on discussion in this thread.]

The DECORATE action functions A_KlaxonBlare and A_ClearSoundTarget fire a 'null' NoiseAlert (by sector traversal and single-sector respectively) that should clear the sound target of any affected actors. As of the last official release of ZDoom and GZoom, the pointers appear to have no effect - any actor that has heard the player remains alerted.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

..Huh. I thought I was misusing the code pointer at first which lead to it not working, but now that I think about it, it should've worked properly with my Image skill dummy player and the Distractor grenade, which it doesn't, making the former completely useless and the latter unable to distract monsters that are already after the player for one reason or another.

This explains why neither of them work as I expected them to.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by Matt »

Uh, what's a "sound target" and how is it stored as opposed to a regular target?
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

None as far as the game is concerned.

When you or a friendly monster fire(s) a "noisy" weapon (one without the noalert flag set) in a room, all of the monsters in the sector you/they are in and all bounding sectors up to any doors or sound blocking lines are alerted and have their target set to the player/friendly that fired. (There's special handling for AMBUSH monsters, where they aren't alerted immediately but instead have +LOOKALLAROUND set on them so they wake up if the player/friendly enters their line of sight from any direction, regardless of what direction that enemy is looking.)

In Strife, there's special handling where, if a certain code pointer is called from an actor, it emits a "noise" that simulates a certain actor emitting a sound and getting the attention of other monsters around it, as though it was a player/friendly that fired their weapon. If the target is hostile to any surrounding monsters, the surrounding monsters will have their target set, will wake up and attack as though they had seen, or in this case, heard the target in question.

Then there's a special "sound" that can be emitted in this way from an actor, just like the former two scenarios, that resets the monsters to act as though they hadn't seen an enemy at all, the "null target" described as above. In this case it would be the same as telling a monster to thing_hate an actor tid that doesn't exist or can't be seen; it simply unsets the targets for all monsters, making them revert to their idle state as though they never saw their target at all.

Strife uses this to implement the klaxxon alarms. If you hide from enemies and wait for the alarms to stop going off, they will reset the acolytes, who will likely then proceed to blatantly ignore you as they usually do, given they can't see you.

It won't reset the monster's target if the monster can see it's target though, hence the name "sound target".

In layman's terms, it's a sound target if the monster can't see it, and a normal target if the monster can see it. They're the same, but are treated differently depending on visibility.

Edit: This post gets the record for the single most number of consecutive edits I have ever made to a single post, at around 15, 20, and counting. **slaps hand**
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by Matt »

Thanks!
Edit: This post gets the record for the single most number of consecutive edits I have ever made to a single post, at around 15, 20, and counting. **slaps hand**
Well, erm, I certainly appreciate the effort o_o;
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

SnowKate709 wrote:Strife uses this to implement the klaxxon alarms. If you hide from enemies and wait for the alarms to stop going off, they will reset the acolytes, who will likely then proceed to blatantly ignore you as they usually do, given they can't see you.
The reason I initially investigated this is that I have never seen an instance of this behaviour playing Strife via ZDoom. I've never played the vanilla release so I have no method of comparison, unfortunately. It also doesn't explain the behaviour desribed in the linked thread in my first post.

I can't help thinking that this has something to do with the 'do not remember sector sound target' compat flag, although the source code for these functions seems to explicitly set/unset the sound target on a per-actor basis.

I'll have my Metal Gear mod yet, I swear to God. :lol:
User avatar
SilentRage
Posts: 216
Joined: Mon Apr 25, 2005 10:34 pm
Contact:

Post by SilentRage »

Skippy wrote: I'll have my Metal Gear mod yet, I swear to God. :lol:
For that to work, you'd have to make some sort of custom klaxon DECORATE monster that can go off when a monster just so much as sees you, for it to have the proper effect.

Do you think it's possible?
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

I actually had a working demo going which had Alert, Evasion and Caution phases. The enemies in the area were all assigned a TID and called an ACS script in their See state that set the alarm off and called a NoiseAlert. I also experimented with A_JumpIfCloser to reduce their range of vision.

To get the timer down, I used an outstandingly hackish script in conjunction with an A_CheckSight call in the enemy's See state. Basically it checked for distance, then for LOS, and called either a 'decrease timer' or 'reset timer to maximum' script as appropriate.

Where the implementation fails is in my current inability to make the actors 'forget' the player (once the Evasion mode ends). Now that SetActorState is in, I should be able to get a more graceful implementation going, but seeing as my A_CheckLOS feature suggestion has never been considered, it'd still be hackish as hell.
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: A_KlaxonBlare and A_ClearSoundTarget do not unalert actors

Post by Skippy »

Sorry for the massive bump, but I wanted to point something else out.

I finally got vanilla Strife working on my machine via the miracle of DosBox. I'm still yet to see any evidence that the Acolytes will forget the player if they stay out of LOS (and out of any sectors in which the KlaxonAlarm things are present) until the time runs down. In other words, if the player makes a noise and the klaxons sound, then they leave the area and hide, the klaxon will sound ten times then will continue to count down silently (read the original thread in the first post for more info) then 'unalert' any actors who are in earshot of it. This doesn't happen.

This probably isn't a bug then, at least not for A_KlaxonBlare. Perhaps what we need here is for someone who knows Strife and understands the code to provide a decent explanation here and/or on the Wiki? :?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49247
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_KlaxonBlare and A_ClearSoundTarget do not unalert actors

Post by Graf Zahl »

This is a misunderstanding: It will clear the sound target - not the actual chasing target. Once the monster has decided to chase the player these code pointers won't revert this.
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: A_KlaxonBlare and A_ClearSoundTarget do not unalert actors

Post by Skippy »

Thanks for clearing that up. Now that we have [wiki]A_ClearTarget[/wiki] this isn't a problem for me anymore.

Just for the sake of my own understanding, though - what the hell is the point of these functions then? How does Strife use the functionality? :?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49247
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_KlaxonBlare and A_ClearSoundTarget do not unalert actors

Post by Graf Zahl »

It's not for monsters but for the klaxons and merchants. These react to the sound target in a specific way that requires it to be cleared at a certain point.
Post Reply

Return to “Closed Bugs [GZDoom]”