View Issue Details

IDProjectCategoryView StatusLast Update
0002603The Dark ModAIpublic09.03.2012 20:50
ReporterSpringheel Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 1.03 
Target VersionTDM 1.06Fixed in VersionTDM 1.06 
Summary0002603: AI do not play "notice_lights" bark
DescriptionI've put out lights in front of AI multiple times recently, yet I've not heard AI using their "notice lights out" bark ("snd_foundLightsOff", or "snd_foundTorchOut" for flames). The console gets spammed with "who put out the light" messages, so the AI is definitely noticing. They just don't play their bark.

TagsNo tags attached.

Activities

grayman

grayman

08.03.2011 02:18

administrator   ~0003728

Last edited: 08.03.2011 02:29

View 3 revisions

The barks are all commented out, but no indication of why or who did it. I thought this would just be a 10-minute fix to turn the barks back on.

Silly me ...

Which lights are AI supposed to be able to turn on?

In the case where you didn't hear a bark, did the AI turn the light back on? If so, what type of light was it?

What I'm reading in the code is that the only lights that can be turned back on are the ones that have a light type of AIUSE_LIGHTTYPE_TORCH. No torch entities or torch flames have this spawnarg. The only light that does is a "color_me" light. (EDIT: torches that can be carried by AI are marked AIUSE_LIGHTTYPE_TORCH)

There's an AI spawnarg "canOperateSwitchLights" and there's code to recognize whether a light is switchable (i.e. gas or electric), but there's no code to actually turn the light back on. Only AIUSE_LIGHTTYPE_TORCH torches. Perhaps this hasn't been written yet?

Springheel

Springheel

08.03.2011 03:17

administrator   ~0003729

The AI has to be set to be able to light torches (I think it's on by default) and the light has to be set to ShouldBeOn. It definitely did work in Sons of Baltona at one point--1.01 or so, as I distinctly recall the AI relighting torches in the outside area.

The code for turning on electric switches isn't there yet, as far as I know.

However, I believe AI should be able to at least *comment* on electric lights being out, even though they can't relight them yet.

The barks for commenting on lights that are out are really separate from the issue of actually relighting lights (which has its own barks).
grayman

grayman

08.03.2011 04:36

administrator   ~0003730

Last edited: 08.03.2011 04:38

View 2 revisions

I'll check the outside torches in Sons of Baltona tomorrow and try putting some out.

At the moment I think my problem is that only certain types of torches can be commented on and relit, and I have to figure out which those are. I would think that the "ShouldBeOn" and "CanLightTorches" spawnargs would be all you need, but apparently not. I placed a switchable electric light in my test map and had to add the "ShouldBeOn" flag, but the code ignores it. I'll have to find electric light entities that can use the flag.

Both the comment barks and the "I've relit a torch/light" barks were commented out. Don't know why. They're back now, but I have to check to be sure the right comment barks are being played. Can't get to the "I've relit..." barks until I can get an AI to relight something.

grayman

grayman

08.03.2011 04:58

administrator   ~0003731

It looks like the comment barks were commented out over three years ago, with the comment that "it's getting annoying hearing these again and again". That comment disappeared soon after, but the barks were left off.

Heh. I know the feeling.
nbohr1more

nbohr1more

08.03.2011 05:27

developer   ~0003732

Related enhancement suggestion 1623

Related enhancement suggestion 541

Also, Perhaps make 518 the parent?
grayman

grayman

06.05.2011 22:39

administrator   ~0003834

Last edited: 06.05.2011 23:02

View 2 revisions

1. Added AIUSE_LIGHTTYPE_ELECTRIC in *.def files where needed.
2. Added STIM_VISUAL in *.def files where needed.
3. Corrected a few light definitions so they could be turned back on.
4. Added the ability to relight candles and electric lights.
5. Recognize the “shouldBeOn” flag when it’s on the parent or grandparent of a light, and not on the light itself.
6. AI can now “see” candle and torch flames that are embedded in func_statics. (Think of a candle flame in a candle model in a candle holder.)
7. Added the ability for an AI to use a switch to relight switched lights. The AI doesn’t have to have a LOS to the switch for relighting. He’ll walk to the switch--even if it’s in another room or behind a door--and activate it to turn the light back on. If there is more than one switch that could be used, the AI will pick the closest.
8. Slightly increased the distance an AI keeps between itself and a light (or switch) when relighting, to reduce knocking over relit candles when turning away while carrying a torch.
9. Added code to use the “noimpact” spawnarg on switches, to keep AI from bumping a switch after using it to relight a light. This was turning the light back off, causing the AI to use the switch twice.
10. Uncommented existing barks.
11. Reordered the visual stim handling code, allowing for early exit when the chance of noticing a stim is zero. The code was checking a variety of things, including the ability to see the stim, which involved expensive traces, before checking the “chance” setting.
12. Also reordered the code so that lights that were on no longer bothered to check LOS to an AI, which can be attempted through walls. The AI wasn’t going to pay attention anyway, so why bother with LOS traces?
13. Added a frame command so that lights would be turned on in sync with the different animations.
14. Rewrote the SwitchOnLightState routines to add states for easier reading and maintenance.
15. Cleared alert weights when entering alert idle state, so that lower weighted alerts could be seen.
16. Fixed a problem where searching AI less than 100 from their goal would jerk forward tiny bits occasionally.
17. Added code support for Springheel’s new animations for dropping a torch, and relighting doused flames with a tinderbox or a torch.

rev 4834:

AlertIdleState.cpp
FailedKnockoutState.cpp
State.cpp
State.h
SwitchOnLightState.cpp
SwitchOnLightState.h
InvestigateSpotTask.cpp
ai.cpp
ai.h
ai_events.cpp
MovementSubsystem.cpp
Memory.cpp
Memory.h
FrobButton.cpp
FrobButton.h
actor.cpp
entity.cpp
entity.h
light.cpp
light.h
game_local.cpp

rev 11876:

tdm_lights_static_electric.def
tdm_lights.def
tdm_prop_items.def
tdm_ai_guard_proguard_devel.def
tdm_light_holders.script
tdm_lights.script
tdm_events.script
tdm_ai_base.script

grayman

grayman

20.05.2011 01:20

administrator   ~0003853

Second Round of changes:

rev 4854:

State.cpp
State.h
SwitchOnLightState.cpp
SwitchOnLightState.h
Memory.cpp
Memory.h
Mind.cpp
BinaryFrobMover.cpp
FrobButton.cpp
FrobButton.h
ai_events.cpp
ai.cpp
ai.h
anim_blend.cpp
syscvar.cpp
syscvar.h
actor.cpp
entity.cpp
entity.h
light.cpp
light.h
moveable.cpp

rev 11890:

tdm_prop_items.def
tdm_ai_townsfolk_beggar.def
tdm_ai_humanoid.def
tdm_ai_female_animations.def
tdm_base.def
tdm_lights.def
misc.def
tdm_ai_base.script
tdm_light_holders.script
tdm_lights.script
tdm_ai_jack.sndshd
grayman

grayman

20.05.2011 19:15

administrator   ~0003855

Third round of changes:

rev 4855:

State.cpp
SwitchOnLightState.cpp
SwitchOnLightState.h
DarkmodAASHidingSpotFinder.cpp
ai.cpp
syscvar.cpp
syscvar.h

rev 11891:

tdm_ai_base.script
grayman

grayman

24.05.2011 15:12

administrator   ~0003857

Fourth round of changes:

1. Add a 5s delay to extinguishing a flame that's become non-vertical.
2. Change "will relight" bark to 50% "will relight" and 50% "found light out".
3. Extend _standOff when dealing with low moveable candles.
4. A dropped torch should NOT cause a propagated sound.
5. Delay the initial bark by 2s ("found" or "relighting").
6. Keep "canLightTorches" and "canOperateSwitchLights" as booleans.
- Set "chanceNoticeLight" high (0.9) to increase the odds that AI will say something.
- Set "chanceOperateSwitchLights" a bit lower (0.7).
- Set "chanceLightTorches" even lower (0.4), to reduce the odds of the player wasting inventory.
7. Let AI see a doused flame when the smoke starts, not when it ends.

rev 4866:

State.cpp
SwitchOnLightState.cpp
ResolveMovementBlockTask.cpp
MovementSubsystem.cpp
Response.cpp
ai.cpp
ai.h
ai_events.cpp
actor.cpp
af.cpp
entity.cpp
entity.h
light.cpp
light.h
moveable.cpp

rev 11900:

tdm_ai_humanoid.def
tdm_lights.def
tdm_moveable_candles.def
tdm_moveable_weapons.def
tdm_lights.script
tdm_light_holders.script
tdm_events.script
grayman

grayman

24.05.2011 20:38

administrator   ~0003859

Fifth round of changes:

rev 4867:

SwitchOnLightState.cpp
SwitchOnLightState.h

rev 11902:

tdm_lights.def
grayman

grayman

31.05.2011 18:15

administrator   ~0003865

Sixth round of changes:

rev 4869:

AlertIdleState.cpp
BlindedState.cpp
CombatState.cpp
ConversationState.cpp
DeadState.cpp
FleeState.cpp
IdleState.cpp
KnockedOutState.cpp
ObservantState.cpp
SearchingState.cpp
State.cpp
StayInCoverState.cpp
SuspiciousState.cpp
SwitchOnLightState.cpp
TakeCoverState.cpp
UnreachableTargetState.cpp
Memory.h
DarkmodAASHidingSpotFinder.cpp
ai.cpp
ai.h
afentity.cpp
entity.cpp
entity.h
game_local.cpp
game_local.h
light.cpp
light.h

rev 11914:

tdm_ai_humanoid_undead.def
tdm_ai_vocal_set_base.def
tdm_ai_vocal_set_builders01.def
tdm_ai_vocal_set_builders02.def
tdm_ai_vocal_set_female01.def
tdm_ai_vocal_set_monster.def
tdm_ai_vocal_set_mute.def
tdm_ai_vocal_set_revenant01.def
tdm_ai_vocal_set_zombie01.def
tdm_ai_vocal_sets01.def
tdm_ai_vocal_sets02.def
tdm_lights_static.def

Seventh round of changes:

1. Allow sitting AI to stand up, relight doused lights, and sit back down.
2. Add bark priority for new “suspicious” rampdown bark.
3. Fixed bug that was using an uninitialized variable.
4. Only allow "to idle mode" rampdown barks if AI was searching.
5. When one AI encounters another AI, and the other is searching, the other will bark about seeing evidence of intruders, or about being suspicious. The arriving AI will inherit the search characteristics of the searching AI if not already engaged in his own, more important search.
6. Fixed a typo in a sound shader name (“snd_alert3sc” was “snd_alert3cs”).
7. Fixed a bug in the hiding spot finder code that wasn’t checking for true intersection of one idBounds with another. With the bug, hiding spots outside the AAS areas could be produced.
8. Reduced the vertical dimension of the lost enemy search (used for doused light searches also) to cut down on AI running away to far-flung reaches when they shouldn’t.

rev 4870:

AlertIdleState.cpp
IdleState.cpp
SearchingState.cpp
State.cpp
SwitchOnLightState.cpp
SwitchOnLightState.h
SingleBarkTask.cpp
Memory.cpp
Memory.h
ai.h
ai.cpp
ObservantState.cpp
SuspiciousState.cpp
DarkmodAASHidingSpotFinder.cpp
InvestigateSpotTask.cpp

rev 11917:

tdm_ai_vocal_set_base.def
grayman

grayman

06.06.2011 02:20

administrator   ~0003870

Eighth round of changes:

An AI engaged in a conversation should ignore doused lights.

Fix a bug that can occur when a light is right around the max allowed height.

rev 4876:

State.cpp
SwitchOnLightState.cpp

Ninth round of changes:

Fixes a problem where an AI does two or more torch-dropping animations when his torch is doused near a “shouldBeOn 0” light that’s out. Found this in The Transaction.

rev 4880:

State.cpp
ai.cpp
ai.h
ai_events.cpp
grayman

grayman

15.06.2011 02:54

administrator   ~0003878

Removed 4 console debug print lines.

rev 4889:

State.cpp
grayman

grayman

09.03.2012 20:50

administrator   ~0004381

Eleventh round of changes

Hitting bindMaster of a light is as good as hitting the light itself. This was already in place, but by checking the origin of the bindMaster, which isn’t necessary. We just need to see what we hit on the trace and if that’s a bindMaster of the light.

rev 5326:

Actor.cpp

Issue History

Date Modified Username Field Change
02.02.2011 01:05 Springheel New Issue
02.02.2011 01:08 Springheel Description Updated View Revisions
07.03.2011 20:55 grayman Assigned To => grayman
07.03.2011 20:55 grayman Status new => assigned
08.03.2011 02:18 grayman Note Added: 0003728
08.03.2011 02:29 grayman Note Edited: 0003728 View Revisions
08.03.2011 02:29 grayman Note Edited: 0003728 View Revisions
08.03.2011 03:17 Springheel Note Added: 0003729
08.03.2011 04:36 grayman Note Added: 0003730
08.03.2011 04:38 grayman Note Edited: 0003730 View Revisions
08.03.2011 04:58 grayman Note Added: 0003731
08.03.2011 05:27 nbohr1more Note Added: 0003732
06.05.2011 22:39 grayman Note Added: 0003834
06.05.2011 22:39 grayman Status assigned => resolved
06.05.2011 22:39 grayman Resolution open => fixed
06.05.2011 22:39 grayman Fixed in Version => TDM 1.06
06.05.2011 22:39 grayman Target Version => TDM 1.06
06.05.2011 23:02 grayman Note Edited: 0003834 View Revisions
20.05.2011 01:20 grayman Note Added: 0003853
20.05.2011 19:15 grayman Note Added: 0003855
24.05.2011 15:12 grayman Note Added: 0003857
24.05.2011 20:38 grayman Note Added: 0003859
31.05.2011 18:15 grayman Note Added: 0003865
06.06.2011 02:20 grayman Note Added: 0003870
15.06.2011 02:54 grayman Note Added: 0003878
09.03.2012 20:50 grayman Note Added: 0004381