View Issue Details

IDProjectCategoryView StatusLast Update
0006211The Dark ModAIpublic01.01.2023 12:08
ReporterDragofer Assigned ToDragofer  
PrioritynormalSeveritynormalReproducibilitysometimes
Status resolvedResolutionfixed 
Product VersionTDM 2.10 
Target VersionTDM 2.11Fixed in VersionTDM 2.11 
Summary0006211: Stealth score not increased if player escapes into darkness while AI is in combat setup
DescriptionSince the resolution of 0003063 with rev 5366, AIs have some reaction time between fully detecting the player and entering combat mode. This is referred to as combat setup, where the AI draws its weapon while standing still. When combat setup is finished it either starts running towards the player if the AI is a melee combatant, or switches to and fires a ranged weapon if the player is standing out of reach.

As part of rev 5366, a new boolean m_ignorePlayer was added which is meant to be true while the AI is in combat setup. It causes the current alert to temporarily not be counted until combat setup is finished. The added score therefore drops from 3 (agitated searching) to 0, before becoming 5 (full detection) once the AI begins to attack.

During 2.11 beta it was reported that if the player manages to get into total darkness while the AI is in combat setup, the added stealth score remains at 0:
- initial report: https://forums.thedarkmod.com/index.php?/topic/21679-beta-testing-211/&do=findComment&comment=481603
- test map: https://forums.thedarkmod.com/index.php?/topic/21679-beta-testing-211/&do=findComment&comment=481618
- repro steps for test map: https://forums.thedarkmod.com/index.php?/topic/21679-beta-testing-211/&do=findComment&comment=481662

The most likely cause is that m_ignorePlayer doesn't get cleared anymore because the AI never enters full combat or fleeing mode, so that alert episode never counts towards the score.

m_ignorePlayer only appears to have 2 purposes:
1) temporarily stop counting the current alert to stealth score in idAI::UpdateEnemyPosition.
2) set lastTimeEnemySeen to the current game time if the AI receives an audio alert (CombatState::OnAudioAlert) and can't see the player. Not entirely sure what this is for since the AI actually can't see the player, but lastTimeEnemySeen only appears to be used for the seenTime stealth statistic.
It therefore only seems to affect how stealth statistics are computed and is not required for the AIs to have a reaction time.
TagsNo tags attached.

Relationships

related to 0005888 resolvedDragofer AI alerts not always reflected in stealth status 
related to 0003063 resolvedgrayman Ai ramp up too quickly when player is seen 

Activities

Dragofer

Dragofer

01.01.2023 11:43

developer   ~0015663

Last edited: 01.01.2023 12:03

Rev 10230
m_ignorePlayer no longer stops an alert from counting towards the stealth score. Reasoning:
- it appears this flag only has to do with computing stealth score statistics; it's not required for AIs to have a reaction time, which was the original intent of the code revision as part of which it was added.
- it's causing undesirable stealth score behaviour (scores temporarily dropping to 0), and is only cleared if the AI can still see the player after combat setup.

When the AI fully detects the player the stealth score for the current alert immediately becomes sightings +1, score +5, rather than dropping to 0. If the player manages to get into darkness before the AI has entered combat mode the score remains intact.

I haven't fully removed the m_ignorePlayer flag because it's still used in CombatState::OnAudioAlert to update the lastTimeEnemySeen variable when the AI can't see the player. I suspect this isn't doing what we want either, but it seems risky to remove this during the 2.11 beta.

Issue History

Date Modified Username Field Change
01.01.2023 11:33 Dragofer New Issue
01.01.2023 11:33 Dragofer Status new => assigned
01.01.2023 11:33 Dragofer Assigned To => Dragofer
01.01.2023 11:40 Dragofer Description Updated
01.01.2023 11:43 Dragofer Note Added: 0015663
01.01.2023 11:44 Dragofer Note Edited: 0015663
01.01.2023 11:44 Dragofer Note Edited: 0015663
01.01.2023 11:56 Dragofer Status assigned => resolved
01.01.2023 11:56 Dragofer Resolution open => fixed
01.01.2023 11:56 Dragofer Fixed in Version => TDM 2.11
01.01.2023 11:57 Dragofer Relationship added related to 0005888
01.01.2023 11:59 Dragofer Note Edited: 0015663
01.01.2023 12:03 Dragofer Note Edited: 0015663
01.01.2023 12:03 Dragofer Note Edited: 0015663
01.01.2023 12:08 Dragofer Relationship added related to 0003063