View Issue Details

IDProjectCategoryView StatusLast Update
0004046The Dark ModAIpublic26.12.2015 03:49
Reportergrayman Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.02 
Target VersionTDM 2.04Fixed in VersionTDM 2.04 
Summary0004046: Barmaid in Inn Business has a problem in the bathroom
DescriptionWhen the barmaid goes to the bathroom to use the toilet, if the bathroom candle has been doused and placed near her on the toilet, she gets stuck sitting on the toilet.
Additional InformationShe's supposed to do this:

Arrive.
Sit on toilet.
Close screens.
Pee.
Open screens.
Get up.
Leave.

To exhibit the problem, douse the candle on the washstand before she arrives and place it on the toilet, in the corner of the room beside her.

The doused flame stims her during her entire time in the room, but since there's nowhere for her to stand while relighting it, what happens is this:

PathWaitTask() is running, telling her how long to sit there.

Flame stims her.

SwitchOnLightState() switches out her IdleState() routine on the state queue and begins to run. SOLS() finds she can't relight the candle, so it dies.

With no state on the state queue, IdleState() starts again from scratch, which restarts her patrol tasks from scratch, which restarts the PathWaitTask() from scratch. This resets the "wait" timer.

Flame stims her before the "wait" timer has expired.

This happens over and over, ad nauseum.

This is similar to what happens when CombatState() gets interrupted and has to keep track of what it was doing so it doesn't go through its Init() code again. Some piece(s) of information that PathWaitTask() uses need to be stored somewhere so they can be queried when PathWaitTask() goes through its Init() code again, so it knows not to make the AI wait the full duration.

Probably storing the time spent or the time remaining in the path_wait node as a spawnarg might do the trick. If that value is non-zero when PathWaitTask::Init() runs, use that value to determine how much time should be spent before finishing the task. If that value is zero, then use the full "wait" time.
TagsNo tags attached.

Activities

grayman

grayman

19.01.2015 15:35

viewer   ~0007355

a quick solution might be to ignore stims if currently running a path wait task. this check must be done before starting SwitchOnLightState, so that IdleState remains alive and has no need to restart the patrolling tasks
SteveL

SteveL

19.01.2015 18:47

reporter   ~0007357

Off the cuff remark, but the spawnarg to let a path wait tick down sounds better. An AI using a path wait to stand guard should react to doused lights and gold chalices being snaffled from under their nose.
grayman

grayman

19.01.2015 19:13

viewer   ~0007358

I will admit to being in the hospital and under the influence of drugs when I wrote that note. :)
grayman

grayman

26.12.2015 03:49

viewer   ~0007918

When an AI is running a Path Wait task, he’s waiting for a timer to expire. If he’s stimmed by a visual stim and begins to work on processing that stim, the Path Wait task is terminated.

If he can’t complete his processing of the visual stim (i.e. he can’t reach a doused light to relight it), the stim remains enabled for him, and he starts his Path Wait task over.

This cycle can continue ad nauseum.

Solution is to save the original wait ending time in the AI if the Path Wait task was interrupted, and use that when the task restarts.

rev. 6564:

PathWaitTask.cpp
PathWaitTask.h
AI.cpp
AI.h

Issue History

Date Modified Username Field Change
18.01.2015 18:01 grayman New Issue
18.01.2015 18:01 grayman Description Updated
18.01.2015 18:02 grayman Description Updated
18.01.2015 18:04 grayman Additional Information Updated
19.01.2015 15:35 grayman Note Added: 0007355
19.01.2015 18:47 SteveL Note Added: 0007357
19.01.2015 19:13 grayman Note Added: 0007358
26.12.2015 03:49 grayman Note Added: 0007918
26.12.2015 03:49 grayman Assigned To => grayman
26.12.2015 03:49 grayman Status new => resolved
26.12.2015 03:49 grayman Resolution open => fixed
26.12.2015 03:49 grayman Fixed in Version => TDM 2.04