View Issue Details

IDProjectCategoryView StatusLast Update
0005286The Dark ModAIpublic20.12.2022 21:30
Reporterstgatilov Assigned ToDragofer  
PrioritylowSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.08 
Target VersionTDM 2.11Fixed in VersionTDM 2.11 
Summary0005286: Number of times seen: not increased when civilian detects player at close range
DescriptionNumber of times seen is not increased in particular case.

I think conditions are:
1) AI is civilian (flee, not fight)
2) AI is enemy (won't consider you friend)
3) AI discovers you by sighting you immediately at a very close distance (e.g. walking from behind).
Steps To ReproduceRun the attached test map.
When it starts, the noblewoman has her back to you. Walk around so that she can see you - she will run to the flee point at the other end of the room. Now go frob the stone pillar - that will display various mission statistics. Note that numberTimesPlayerSeen, sightingScore, and stealthScore are all zero.
Additional InformationReported by joebarnin here:
  https://forums.thedarkmod.com/index.php?/topic/20422-numbertimesplayerseen-mission-statistic-problem
TagsNo tags attached.

Relationships

related to 0003063 resolvedgrayman Ai ramp up too quickly when player is seen 
related to 0002887 resolvedgrayman Stealth Score Level-5 bust ("being seen") isn't countable for the stats GUI because of incrementing "cascade" 
related to 0006186 resolvedDragofer Tactile alerts don't increment the totalTimePlayerSeen mission statistic 
child of 0005888 resolvedDragofer AI alerts not always reflected in stealth status 

Activities

stgatilov

stgatilov

06.07.2020 14:04

administrator  

test2.pk4 (5,318 bytes)
stgatilov

stgatilov

06.07.2020 14:21

administrator   ~0012645

This was broken by related issue 0003063.

The increase of "number of times seen" is delayed until AI goes through some preliminary phase of CombatState ("reactipn").
However, civilians don't get through this phase: instead, they quickly switch to fleeing. But the number is not increased when they do so...
stgatilov

stgatilov

06.07.2020 14:40

administrator   ~0012646

I would say the whole chunk of code starting with "if ( enemyEnt->IsType(idPlayer::Type) && !m_ignorePlayer)" in idAI::UpdateEnemyPosition should be extracted into separate method. Then this method can be called from CombatState::Think when ignorePlayer is cleared.
stgatilov

stgatilov

29.01.2022 16:34

administrator   ~0014697

According to 0005888, touching a calm guard in the full dark does not count either.
Perhaps for the same reason: when being touched, he does not go through any reaction...
Dragofer

Dragofer

27.07.2022 18:05

developer   ~0015080

Yeah, it appears numberTimesPlayerSeen is only increased by CMissionData::IncrementPlayerSeen(), which is called during idAI::UpdateEnemyPosition().

In order for UpdateEnemyPosition() to call IncrementPlayerSeen(), these checks must be passed:
1) the enemy is the player
2) AI is not ignoring the player, m_ignorePlayer (linked to 0003063)
3) the enemy is visible

2 is bad because civilians ignore the player and 3 is bad because it ignores tactile detections.

The good thing is that this code bracket only exists to update sighting statistics, so maybe it would be feasible to use some different checks. This would have the advantage of being less invasive.
Dragofer

Dragofer

03.12.2022 17:36

developer   ~0015506

Last edited: 03.12.2022 17:59

Rev 10191
Add a check to prevent the m_ignorePlayer flag from getting enabled if the AI is fleeing. The m_ignorePlayer flag is meant to delay incrementing of the totalTimePlayerSeen mission statistic until the AI has reacted and enters the combat state, but non-combatants never enter combat and go straight to a fleeing state.

I also tried extracting from UpdateEnemyPosition the code that increments totalTimePlayerSeen into its own method and calling it from CombatState::Think after the m_ignorePlayer is cleared, as suggested by stgatilov. However, the issue is that non-combatants quickly exit CombatState::Think (usually at line 604), never reaching the point where the m_ignorePlayer flag is cleared (line 690). Therefore I went for the (possibly slightly dirty) option of not setting the flag at all on AIs that flee.

The alternative I suggested - rearranging the logic in UpdateEnemyPosition() - doesn't seem to be required or helpful for fixing the interaction between m_ignorePlayer and noncombatants.
Dragofer

Dragofer

03.12.2022 17:39

developer   ~0015507

Last edited: 03.12.2022 17:40

My debugging tools:
- z_tdm_loot_stealth_stats.pk4: custom user addon script originally by kcghost that converts the loot counter in inventory into a stealth score counter. I modified it further to show totalTimePlayerSeen instead of loot. To install, simply place it in your base TDM install folder.
- 5286.map: brightly lit test map with a noblewoman. Run into the noblewoman to alert her and watch the inventory item counter. Hide behind the pillar or activate notarget to end the current sighting.

Note that totalTimePlayerSeen is only updated when the AI no longer sees the player.
5286.map (6,681 bytes)   
Version 2
// entity 0
{
"classname" "worldspawn"
// primitive 0
{
brushDef3
{
( 0 0 1 -72 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 1 0 -152 ) ( ( 0.0520833320915699 0 984 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 1 0 0 -200 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 -1 0 -160 ) ( ( 0.0520833320915699 0 40 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( -1 0 0 -904 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 -1 64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 1 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 1 0 0 -200 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( -1 0 0 -904 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 -1 0 152 ) ( ( 0.0520833320915699 0 40 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 1 0 -152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 1 0 0 -208 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 -1 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( -1 0 0 200 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 1 0 -152 ) ( ( 0.0520833320915699 0 984 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 1 0 0 -200 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 -1 -72 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 -1 0 -160 ) ( ( 0.0520833320915699 0 40 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( -1 0 0 -904 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 1 64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 1 0 0 -200 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 -1 0 -168 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( -1 0 0 -904 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 1 0 160 ) ( ( 0.0520833320915699 0 984 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 39.58333206176758 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 1 0 -152 ) ( ( 0.0520833320915699 0 984.4166870117188 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 984.4166870117188 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 0 -1 0 -160 ) ( ( 0.0520833320915699 0 39.58333206176758 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( -1 0 0 -904 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
( 1 0 0 896 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/wood/boards/dark_redwood" 0 0 0
}
}
}
// entity 1
{
"classname" "light"
"name" "light_1"
"light_center" "0 0 0"
"light_radius" "736 320 320"
"origin" "-264 -8 0"
}
// entity 2
{
"classname" "info_player_start"
"name" "info_player_start_1"
"angle" "90.000000"
"origin" "-704 -48 -64"
}
// entity 3
{
"classname" "path_flee_point"
"name" "path_flee_point_1"
"origin" "136 88 -32"
}
// entity 4
{
"classname" "atdm:mover_button"
"name" "atdm_mover_button_1"
"model" "atdm_mover_button_1"
"origin" "-816 -80 -28"
"target" "atdm_target_callscriptfunction_1"
"translate" "0  2 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -36 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -8 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -8 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -36 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -8 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -8 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
}
// entity 5
{
"classname" "atdm:target_callscriptfunction"
"name" "atdm_target_callscriptfunction_1"
"call" "dumpstats"
"foreach" "0"
"origin" "-856 -56 -32"
}
// entity 6
{
"classname" "atdm:gui_message"
"name" "msg"
"lines" "6"
"origin" "-858 -20 -28"
"show" "6"
"text" "Enter here your text. Don't forget to adjust the 'lines' spawnarg!"
}
// entity 7
{
"classname" "atdm:ai_noblewoman01"
"name" "atdm_ai_noblewoman01_1"
"origin" "-824 8 -63.1951"
"rotation" "-1 0 0 0 -1 0 0 0 1"
}
5286.map (6,681 bytes)   
Dragofer

Dragofer

20.12.2022 21:30

developer   ~0015594

Further adjustment was needed: https://forums.thedarkmod.com/index.php?/topic/21679-beta-testing-211/&do=findComment&comment=481431

The issue is now resolved as follows:
1) clear m_ignorePlayer when the AI switches into a fleeing state (rev 10220)
2) prevent m_ignorePlayer from being (re-)enabled while an AI is fleeing (rev 10191)

Issue History

Date Modified Username Field Change
06.07.2020 14:04 stgatilov New Issue
06.07.2020 14:04 stgatilov Status new => assigned
06.07.2020 14:04 stgatilov Assigned To => stgatilov
06.07.2020 14:04 stgatilov File Added: test2.pk4
06.07.2020 14:17 stgatilov Relationship added related to 0003063
06.07.2020 14:21 stgatilov Note Added: 0012645
06.07.2020 14:40 stgatilov Note Added: 0012646
05.12.2020 12:29 stgatilov Target Version TDM 2.09 => TDM 2.10
21.12.2021 14:51 stgatilov Target Version TDM 2.10 => TDM 2.11
29.01.2022 16:24 stgatilov Relationship added has duplicate 0005888
29.01.2022 16:34 stgatilov Note Added: 0014697
29.01.2022 16:56 stgatilov Assigned To stgatilov =>
30.01.2022 02:25 stgatilov Assigned To => stgatilov
30.01.2022 02:25 stgatilov Status assigned => confirmed
30.01.2022 14:24 stgatilov Assigned To stgatilov =>
27.07.2022 17:14 Dragofer Relationship added related to 0002887
27.07.2022 18:05 Dragofer Note Added: 0015080
03.12.2022 17:36 Dragofer Assigned To => Dragofer
03.12.2022 17:36 Dragofer Status confirmed => resolved
03.12.2022 17:36 Dragofer Resolution open => fixed
03.12.2022 17:36 Dragofer Fixed in Version => TDM 2.11
03.12.2022 17:36 Dragofer Note Added: 0015506
03.12.2022 17:39 Dragofer Note Added: 0015507
03.12.2022 17:39 Dragofer File Added: z_tdm_loot_stealth_stats.pk4
03.12.2022 17:39 Dragofer File Added: 5286.map
03.12.2022 17:40 Dragofer Note Edited: 0015507
03.12.2022 17:44 Dragofer Relationship replaced child of 0005888
03.12.2022 17:53 Dragofer Relationship added related to 0006186
03.12.2022 17:59 Dragofer Note Edited: 0015506
20.12.2022 21:30 Dragofer Note Added: 0015594