View Issue Details

IDProjectCategoryView StatusLast Update
0002026The Dark ModAIpublic26.03.2010 07:39
Reporterangua Assigned Toangua  
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
Product VersionSVN 
Summary0002026: Patrolling bugs
DescriptionThere are 2 issues with patrolling:
a) Every path task does NextPath(). There are a few path entities which can do 2 path tasks sequentially, like turning and waiting. The path turn task advances to the next path entity before the path wait task is done, and the path wait task does this again, effectively skipping paths.

b)NextPath is done from the same path entity twice. If there is a sequence of paths, this is not a problem, but with paths that can be randomly chosen the AI might visit both of them before advancing to the next one.
This is how the code should look like:

    // The current path gets stored in lastPath
    owner->GetMemory().lastPath = path;

    // The pre-selected "next path" is now our current one
    idPathCorner* currentPath = owner->GetMemory().nextPath.GetEntity();

    owner->GetMemory().currentPath = currentPath;

    // Now pre-select a new (random) path entity for the next round
    // this information is important for the PathCornerTask to decide which action to take on exit
    idPathCorner* next = idPathCorner::RandomPath(currentPath, NULL, owner);
    owner->GetMemory().nextPath = next;

However, this currently leads to a crash due to (a).
TagsNo tags attached.

Relationships

related to 0001998 closedangua Integrate patrolling into movement subsystem 

Activities

angua

angua

01.12.2009 08:14

manager   ~0002750

Refactored patrolling, is now done by movement subsystem.

Issue History

Date Modified Username Field Change
22.11.2009 17:15 angua New Issue
22.11.2009 17:16 angua Relationship added related to 0001998
29.11.2009 17:34 angua Status new => assigned
29.11.2009 17:34 angua Assigned To => angua
01.12.2009 08:14 angua Status assigned => resolved
01.12.2009 08:14 angua Resolution open => fixed
01.12.2009 08:14 angua Note Added: 0002750
26.03.2010 07:39 greebo Status resolved => closed