View Issue Details

IDProjectCategoryView StatusLast Update
0003496The Dark ModAIpublic29.08.2013 19:31
ReporterSpringheel Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionTDM 2.00 
Target VersionTDM 2.00Fixed in VersionTDM 2.00 
Summary0003496: "Surprise Bark" interrupts other barks and seems out of place
DescriptionSee this video: http://www.youtube.com/watch?v=2i1lwUG-qfY


00:06 -- AI turns around and immediately goes to Alert 4. Starts his to_agitated_search bark.
00:08 -- ramps up to Alert 5, and gives his "surprise" bark, which cuts off his previous bark.
00:09-00:11 -- somewhere in here he drops back to Alert 4 because he can no longer see me (because for some reason he ran off to the side again--this happened most of the time)
00:12 -- gives an agitated searching bark
00:14 -- goes back up to Alert 5, gives his "surprise" bark which cuts off his searching bark, and plays walk_alerted animation (?)
00:15 -- gives his to_combat bark which cuts off his surprise bark.


I see two problems here. The barks getting cut off doesn't sound very good. But more importantly, the "surprise bark" doesn't seem to be working very well in this situation.

The AI is already alerted to the point of searching, but he's overriding that search bark with what sounds like a lower-priority bark (since the "surprise barks" are from Alert 1-2). He does the same thing later, overriding an agitated search bark with a much more relaxed bark. "Show yourself you cow--something move?"

At the very least, I think we need a separate bark for the "surprise bark"--something made of quick "Hmms?" and "Huhs?" that might fit better. But additionally, I don't think it sounds right when surprise barks interrupt other alert barks.

Here is the relevant part of the log:
21152: atdm_ai_citywatch_1 spots the player and sets EAlertVisual_1
21216: atdm_ai_citywatch_1 rises to Searching state, barks 'snd_alert3s'
21520: atdm_ai_citywatch_1 spots the player and sets EAlertVisual_1
21552: atdm_ai_citywatch_1 rises to Agitated Searching state, barks 'snd_alert4
NoEvidence'
22528: atdm_ai_citywatch_1 spots the player and sets EAlertVisual_1
22560: atdm_ai_citywatch_1 sees an enemy, will use Alert Idle
22560: atdm_ai_citywatch_1 enters Combat State, barks surprised reaction 'snd_a
lert1s'
28448: atdm_ai_citywatch_1 spots the player and sets EAlertVisual_1
28480: atdm_ai_citywatch_1 sees an enemy, will use Alert Idle
28480: atdm_ai_citywatch_1 enters Combat State, barks surprised reaction 'snd_a
lert1s'
29872: atdm_ai_citywatch_1 starts combat, barks 'snd_to_combat'
TagsNo tags attached.
Attached Files
tdm_game01.pk4 (2,517,585 bytes)

Activities

grayman

grayman

18.07.2013 23:03

viewer   ~0005787

I'll remove the surprise bark.

Since the alert bark interruptions can interrupt each other at any level, I suggest putting a 3 second timer between them. If the timer hasn't expired, the second bark is skipped.

How's that sound?
Springheel

Springheel

18.07.2013 23:47

administrator   ~0005788

Last edited: 18.07.2013 23:49

I think the surprise bark could sound good when the AI is going straight from a relaxed state to combat (though I still think it would be best to make a unique bark to weed out some of the inappropriate to_observant ones--I could do that). It just doesn't work as well when the AI is already alerted. I'll leave it up to you what you'd like to do there.

The timer sounds fine with me, though would that affect rampdown barks? If an AI is at Alert3 and goes to Alert4 within the 3 second buffer, which rampdown will he make? He should probably still make a rampdown from agitated search bark, even if he didn't make the to_agitated_searching bark. I know that contradicts my earlier statement elsewhere that the rampdown should match the last bark the player heard...but I think it would be odd to have the AI searching and saying, "Come out you coward!" and then end the search with a "Must have been rats" line.

grayman

grayman

19.07.2013 01:23

viewer   ~0005789

The timer wouldn't affect rampdown barks because they occur well after alert barks are issued. And the timer would be specific to alert barks, anyway.

Alert3->Alert4 w/in 3 seconds: he'd make snd_alert3, but not snd_alert4.

Rampdown from Alert 4 would still be the appropriate bark, even w/o snd_alert4.

If we add the timer, then the surprise bark could stay (and become snd_alert5, since we don't have one), and it would only be played if at least 3 seconds had elapsed since the previous alert bark, whether that was snd_alert3 or snd_alert4.

We can adjust the timer length based on observations.
grayman

grayman

19.07.2013 04:04

viewer   ~0005790

I attached tdm_game01.pk4 with the alert bark timer in it, as well as more debug statements to see what's going on. If a bark is skipped, the debug statements will say so.

I left the surprise bark in, with snd_alert1s as a placeholder.
Springheel

Springheel

19.07.2013 13:33

administrator   ~0005791

Last edited: 19.07.2013 13:35

"The timer wouldn't affect rampdown barks because they occur well after alert barks are issued. And the timer would be specific to alert barks, anyway."

What I meant to ask was whether players will hear a "rampdown to Alert 4" bark even though they didn't hear the snd_alert4 bark.

"I left the surprise bark in, with snd_alert1s as a placeholder. "

Ok, let me see how it works and then I'll come up with suitable barks.

 "it would only be played if at least 3 seconds had elapsed since the previous alert bark, whether that was snd_alert3 or snd_alert4."

Is a surprise bark needed if they're already agitated searching? If they're looking for an intruder, they shouldn't really be surprised if they find one.

grayman

grayman

19.07.2013 14:11

viewer   ~0005792

Players will hear a "rampdown to Alert 4" bark even if they didn't hear snd_alert4.

I can skip the surprise bark if the AI has spent time in Agitated Search.
grayman

grayman

19.07.2013 14:57

viewer   ~0005793

If the AI spends time in Agitated Searching and rises to Combat, the surprise bark won't be played.

Also, if the AI spends time in Agitated Searching and drops down to Searching, and rises to Combat, the surprise bark won't be played.

My reasoning is that when dropping from Agitated to Searching, the AI's weapon is still out and they're still barking "snd_state4*", so the player won't notice the difference.

If the AI drops out of Searching, back to Suspicious, then he will no longer be considered as having been in Agitated Searching. This won't affect his "I've been in Agitated Searching" rampdown bark when he gets back to idle, but if he jumps straight to Combat, the surprised bark will be heard.
Springheel

Springheel

19.07.2013 15:28

administrator   ~0005794

Ok, that sounds reasonable to me. I'll have to play with it, but don't know how much time I'll have today.
grayman

grayman

19.07.2013 17:11

viewer   ~0005796

I attached a new pk4 with the latest changes.
Springheel

Springheel

19.07.2013 17:21

administrator   ~0005797

Last edited: 19.07.2013 17:22

I tested the last one a bit, and this new one a few times, in 75% light conditions. The barks sound better, but there is still something odd about the behaviour. About a third of the time, the AI does exactly what I would expect...he spots me, makes a bark, and then charges straight at me. But 2/3s of the time, he spots me, and then runs off to the side, at his 10 o'clock. I've seen this happen under all different light conditions. He then has to circle around the stone wall there, searching for me even though I haven't moved.

Shouldn't he run directly to my position every time?

video: http://www.youtube.com/watch?v=QsUR8Vgl8qw

grayman

grayman

19.07.2013 17:48

viewer   ~0005799

I suspect that pathfinding is telling him the route to you is around the far end of the wall. Unfortunately, id's pathfinding thinks it's finding the shortest route, but the distances across AAS areas aren't always correct (I've verified this in the past), so the path around the far end of the wall is incorrectly determined to be the shortest route when in reality it isn't.

You can prove this by closing off the route around the far end of the wall. If he runs straight to you, then I'm right about what's happening.

Correcting this is a big deal. Maybe I'll look at it after 2.0. Given the simple case you've presented here, it might not be too difficult looking at the layers of math involved for such a short distance.
Springheel

Springheel

19.07.2013 17:54

administrator   ~0005800

Last edited: 19.07.2013 17:56

It's odd, because it doesn't happen every time. Sometimes he DOES run straight at me, even when I'm loading the same saved game (so I know I haven't changed position). I'll try closing that route and see what happens.

edit: btw, can I get you to describe under exactly what conditions the AI will play the snd_state5 bark? I'd like to have a clear idea of what kind of lines would work best before working on them.

Springheel

Springheel

19.07.2013 20:02

administrator   ~0005802

Last edited: 19.07.2013 20:21

Weird. I updated the map and removed the wall entirely. But watch the vid--the AI still runs off to the side of me, running to a point to my left and behind me. He only finds me by accidently bumping into me.

This doesn't _look_ like the AI taking an incorrect shortest route...it's like he intends to run to that specific spot, because when he gets there, he seems confused that I'm not there.

IIRC, sound alerts generate a random search point somewhere near the player...but sight alerts shouldn't do that, should they?

video: http://www.youtube.com/watch?v=40D_c9GGoyk

grayman

grayman

19.07.2013 21:41

viewer   ~0005805

There's fuzziness in sound origins, but not in sight origins.

If it's not a pathfinding problem, then he's running to a search spot. For this type of alert (spotting the player), he should go to the player origin as his first search spot. Only after that will he begin to search for spots the Hidden Spot Search tells him are good places to search.

What ambient level are you using?
grayman

grayman

19.07.2013 21:47

viewer   ~0005806

Last edited: 20.07.2013 00:13

"can I get you to describe under exactly what conditions the AI will play the snd_state5 bark? I'd like to have a clear idea of what kind of lines would work best before working on them."

He will bark this if BOTH of these are TRUE:

1 - It's been at least 3s since he last barked ANY snd_alertN bark.

2 - He rose to Combat State w/o stopping at Agitated Search first.

If he stops at Agitated Search, drops back to Searching, then goes straight to Combat w/o again stopping at Agitated Search, that's FALSE as far as # 2 goes.

Springheel

Springheel

19.07.2013 23:47

administrator   ~0005808

Last edited: 19.07.2013 23:49

"What ambient level are you using? "

That test was with the light set to 35.

grayman

grayman

23.07.2013 02:12

viewer   ~0005867

Change the ‘surprise bark’ to ‘snd_alert5’. Don’t bark it if arriving in Combat State from Agitated Searching State, or after having been in Agitated Searching State, then dropping back to Searching State, then rising to Combat State.

Don’t allow an alert bark if another one was emitted less than 3s earlier. This applies to all alert levels. This has no effect on rampdown barks.

Rev. 5830:

AgitatedSearchingState.cpp
AlertIdleState.cpp
CombatState.cpp
IdleState.cpp
ObservantState.cpp
SearchingState.cpp
SuspiciousState.cpp
Memory.cpp
Memory.h
Springheel

Springheel

29.08.2013 19:31

administrator   ~0006121

This seems to be fine now. I'm going to mark it resolved.

Issue History

Date Modified Username Field Change
18.07.2013 22:38 Springheel New Issue
18.07.2013 22:40 Springheel Description Updated
18.07.2013 22:42 Springheel Description Updated
18.07.2013 23:03 grayman Note Added: 0005787
18.07.2013 23:03 grayman Assigned To => grayman
18.07.2013 23:03 grayman Status new => assigned
18.07.2013 23:47 Springheel Note Added: 0005788
18.07.2013 23:49 Springheel Note Edited: 0005788
19.07.2013 01:23 grayman Note Added: 0005789
19.07.2013 04:02 grayman File Added: tdm_game01.pk4
19.07.2013 04:04 grayman Note Added: 0005790
19.07.2013 13:33 Springheel Note Added: 0005791
19.07.2013 13:35 Springheel Note Edited: 0005791
19.07.2013 14:11 grayman Note Added: 0005792
19.07.2013 14:57 grayman Note Added: 0005793
19.07.2013 15:28 Springheel Note Added: 0005794
19.07.2013 17:10 grayman File Deleted: tdm_game01.pk4
19.07.2013 17:10 grayman File Added: tdm_game01.pk4
19.07.2013 17:11 grayman Note Added: 0005796
19.07.2013 17:21 Springheel Note Added: 0005797
19.07.2013 17:22 Springheel Note Edited: 0005797
19.07.2013 17:22 Springheel Note Edited: 0005797
19.07.2013 17:48 grayman Note Added: 0005799
19.07.2013 17:54 Springheel Note Added: 0005800
19.07.2013 17:56 Springheel Note Edited: 0005800
19.07.2013 17:56 Springheel Note Edited: 0005800
19.07.2013 20:02 Springheel Note Added: 0005802
19.07.2013 20:03 Springheel Note Edited: 0005802
19.07.2013 20:21 Springheel Note Edited: 0005802
19.07.2013 21:41 grayman Note Added: 0005805
19.07.2013 21:47 grayman Note Added: 0005806
19.07.2013 23:47 Springheel Note Added: 0005808
19.07.2013 23:49 Springheel Note Edited: 0005808
20.07.2013 00:13 grayman Note Edited: 0005806
23.07.2013 02:12 grayman Note Added: 0005867
23.07.2013 02:12 grayman Status assigned => feedback
23.07.2013 02:12 grayman Resolution open => fixed
23.07.2013 02:12 grayman Fixed in Version => TDM 2.00
23.07.2013 02:12 grayman Target Version => TDM 2.00
29.08.2013 19:31 Springheel Note Added: 0006121
29.08.2013 19:31 Springheel Status feedback => assigned
29.08.2013 19:31 Springheel Status assigned => resolved