View Issue Details

IDProjectCategoryView StatusLast Update
0003559The Dark ModAIpublic04.04.2014 19:31
Reportergrayman Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.00 
Target VersionTDM 2.02Fixed in VersionTDM 2.02 
Summary0003559: Implement pickpocket reaction
Description1. Create physical reaction: stop? reach for belt? other?

2. Use existing pickpocket barks.

3. Look around for a moment?

4. Should AI _always_ react, or is there a way to implement a "light touch"?

Bring up on forum for discussion.
TagsNo tags attached.

Activities

grayman

grayman

01.04.2014 20:17

viewer   ~0006487

Implement the following:

1. Player steals item. If the victim's "chanceNoticePickedPocket" spawnarg is "0", he won't react. (This lets mappers use custom reactions or no reactions.) If > 0, he might.

2. Wait 2 seconds. Then, if the victim was alerted in the previous 4 seconds, and if his current alert level is below Searching, skip steps 3 and 4.

3. Check the victim's "chanceNoticePickedPocket" spawnarg (0.00 -> 1.00, default 0.50). Since the chance value is compared to a random number, and it's only compared once, if it fails, the victim won't react.

4. The "pickpocket_delay_min" spawnarg (default 10 seconds) and the "pickpocket_delay_max" spawnarg (default 120 seconds) define a span of time that randomly delays the victim's reaction.

5. At reaction time ...

If he's in Searching mode or higher, he doesn't react.

If sleeping, his reaction is delayed until he wakes up.

If he's not in Alert Idle mode, he'll emit the picked pocket bark.

If sitting, he'll look either to the left or right for 3-5 seconds. He won't stand.

If standing, he'll play an anim, and turn to look at the ground behind him for 3-5 seconds.

If patrolling, he'll stop, play an anim, and turn to look at the ground behind him for 3-5 seconds.

6. When he's finished, he returns to what he was doing.


pickpocket_alert

The "pickpocket_alert" spawnarg (default 0.0) adds its value to the AI's current alert level, capping the alert level just below Combat. If the alert level rises to where he will emit a ramp-up bark, he won't emit the picked pocket bark. If the alert level rises to Searching or Agitated Searching, he will not look at the ground around him, but will do whatever the search code tells him to do. This also applies if he's sitting.

Evidence of intruders

If the picked pocket occurs near an alert and the victim reacts right away, his "evidence of intruders" count will bump up by 1.

If busy doing something else

If the AI is performing any of these activities at reaction time, he doesn't react:

- reacting to being hit by something
- having a conversation
- fleeing
- any other activity I think of later

If the AI is performing any of these activities when the delay is over, the reaction will either occur, or be delayed until after the activity is finished. It depends on how far along the activity is.

- relighting a light
- examining a rope
- opening or closing a door
- dealing with an elevator

If reacting to a picked pocket (pp) and something else happens

- light goes out - light ignored, continue pp reaction, light probably noticed later

For the rest of these, the pp reaction is aborted:

- rope appears
- hit by something
- start a conversation
- start searching
- spot an enemy
- start fleeing
- blinded
- failed KO
- spot weapon
- spot something suspicious
- a friend wants you to help search
- spot dead or unconscious person
- spot blood
- spot that something's missing
- spot a broken item
- need to run for cover
- your torch goes out

Animation

TBD. If the hands move in a new anim, we need replacement anims when the AI is carrying a torch or weapon.

Stealing keys

Stealing a key or stealing a money pouch should elicit the same reaction.

Stealing a key generally doesn't mean an AI can't get through the locked door the key fits. Mappers have been careful to not lock AI out, because it can mess with gameplay. (Unique situations where that's the desired behavior are up to the mapper.)

The bark

Barks are already defined. They should not generate propagated warning sounds to other AI. This bark is just the AI muttering to himself.
grayman

grayman

04.04.2014 19:31

viewer   ~0006489

Rev. 5945:

Conversation.cpp
BlindedState.cpp
CombatState.cpp
ConversationState.cpp
ConversationState.h
DeadState.cpp
ExamineRopeState.cpp
ExamineRopeState.h
FailedKnockoutState.cpp
FleeState.cpp
HitByMoveableState.cpp
HitByMoveableState.h
KnockedOutState.cpp
SearchingState.cpp
State.cpp
State.h
StayInCoverState.cpp
SuspiciousState.cpp
SwitchOnLightState.cpp
SwitchOnLightState.h
TakeCoverState.cpp
UnreachableTargetState.cpp
HandleDoorTask.cpp
HandleElevatorTask.cpp
AI.cpp
AI.h
AI_events.cpp
Actor.cpp
Memory.cpp
Memory.h
Mind.cpp
Mind.h
MovementSubsystem.cpp
MissionData.cpp
DarkModGlobals.h
PocketPickedState.cpp
PocketPickedState.h

Rev. 13783:

tdm_ai_base.script
tdm_ai_animal_horse2.def
tdm_ai_animal_rat.def
tdm_ai_base.def
tdm_ai_female_animations.def
tdm_ai_guard_proguard_devel.def
tdm_ai_humanoid.def
tdm_ai_humanoid_undead.def
tdm_ai_monster_base.def
tdm_ai_monster_spider.def
tdm_ai_steambot_base.def
tdm_ai_trainer_melee.def
tdm_ai_undead_revenant.def
tdm_moveable_weapons.def

Issue History

Date Modified Username Field Change
21.09.2013 14:59 grayman New Issue
21.09.2013 14:59 grayman Status new => assigned
21.09.2013 14:59 grayman Assigned To => grayman
23.11.2013 16:27 grayman Target Version TDM 2.01 => TDM 2.02
01.04.2014 20:17 grayman Note Added: 0006487
04.04.2014 19:31 grayman Note Added: 0006489
04.04.2014 19:31 grayman Status assigned => resolved
04.04.2014 19:31 grayman Resolution open => fixed
04.04.2014 19:31 grayman Fixed in Version => TDM 2.02