SRP icon indicating copy to clipboard operation
SRP copied to clipboard

The first out out of four enemy phrases about counter attack may play

Open SurDno opened this issue 6 years ago • 11 comments

SurDno avatar Nov 27 '18 19:11 SurDno

I do not know if it's really related to the fact if any counter-attack is planned. I did not get an according quest, though an enemy squad headed to the newly captured point. I've encountered this several times through my playthrough.

SurDno avatar Nov 27 '18 19:11 SurDno

Okay, it’s two out of four. Happened at least a few more times. It’s just like the game plans a counter attack and then decides to actually start none. Are there different requirements for every phrase in the set or are they just playing one after another?

SurDno avatar Aug 24 '19 22:08 SurDno

The audio for counter-attacks is initiated in function CCaptureSmartTask:check_task(tm) in task_objects.script.

Let 'S' denote the smart terrain to capture; let 'D' denote the defending faction; let 'A' denote the attacking faction, i.e. the faction that gave the 'capture' task. Then the logic is roughly:

  • If/once S is owned by A:
    • If use of the counter-attack feature is permitted for D:
      • Start playing pre-counter-attack sounds (e.g. 'Anyone there?', 'Come in!', etc.)
      • If/once the pre-counter-attack sounds have finished or 15 real seconds have elapsed since they started playing:
        • If a squad of D is stationed at a neighboring smart to S and it's 'safe' to send them to S:
          • Play 'counter-attack launched' sound
          • Send the squad (only one if there are several) at the neighboring smart to S
        • Otherwise, finish the task

The 15-second timeout is a work-around added by the SRP to prevent the 'capture' task from never finishing. For some reason, the pre-counter-attack sounds sometimes never register as finished in vanilla.

I haven't looked into what determines how many pre-counter-attack sounds are played before the game registers them as finished or the 15-second timeout is reached.

Decane avatar Aug 25 '19 11:08 Decane

@SurDno What do you think is the problem here? The fact that a counter-attack isn't always executed even if you hear pre-counter-attack sounds? As explained above, a counter-attack is only launched if a suitable enemy squad is found at a neighboring smart terrain.

Decane avatar Aug 25 '19 11:08 Decane

According to logic you provided, everything is working as intended. Just the scenario of pre-counter-attack sounds happening but the faction not sending any squads to actually counter attack was rare enough it seemed to be a bug to me.

If the only requirement for pre-counter-attack sound is being owned by enemy faction and being suitable for counter-attack, why does it sometimes play no sounds at all and other times it’s playing the first two without initiating the counter-attack, even on the same point? For example, I’ve seen both described behaviors at Pump Station.

SurDno avatar Aug 25 '19 13:08 SurDno

why does it sometimes play no sounds at all [...] without initiating the counter-attack, even on the same point?

That sounds like a bug; pre-counter-attack sounds should always play, as long as the previous smart terrain owner uses the counter-attack feature (mutants, mercs, and monolith don't).

Decane avatar Aug 25 '19 15:08 Decane

It should always play “Anyone there?” on any point getting captured, or do I not get something?

SurDno avatar Aug 25 '19 15:08 SurDno

It should always play “Anyone there?” on any point getting captured [...]?

For any point that is the target of a 'capture' task and whose previous owner uses the counter-attack feature, yes.

Decane avatar Aug 25 '19 15:08 Decane

@Decane I know it's late, but what do you mean by 'safe' in following quote?

it's 'safe' to send them to S

SurDno avatar Jul 03 '20 14:07 SurDno

@SurDno 'Safe' was a poor choice of wording. I meant by it: 'the squad of D stationed at the neighboring smart to S either doesn't have a scripted target or has S as its scripted target'.

So basically, any squad of the defending faction that is stationed at a neighboring smart is available for sending to the capture target except one that has a scripted target that is not also the capture target.

Decane avatar Jul 03 '20 18:07 Decane

Got it, thanks!

SurDno avatar Jul 03 '20 18:07 SurDno