Continuing on with last week’s issue, were not able to make any headway on the issue with range detection. We, therefore, decided to search for alternatives. As we continue to explore options on potential pathfinding algorithms, we came across a more dynamic version of the D*-Lite. While D*Lite allows for dynamic changes occurring in the map, MT-D*-Lite offers an additional benefit; it allows targets to also be dynamic, which can be crucial to our game when we allow enemies to target the player.
The underlying concept of MT-D*-Lite, as you may have guessed, is similar to that of D*-Lite. It retains information on the nodes it has visited thus far to avoid recalculation of the node. However, in order to accommodate a dynamic target, MT-D*-Lite also employs concepts from G-FRA*. In full action, MT-D*–Lite maintain a list of visited nodes with their calculations, however, when changes are made to the environment, it recalculates its path and basically erase/delete nodes in the visited list that are no longer useful in searching for the current path.
The basic implementation was quick, as it was very similar to D*-Lite. Unfortunately, we ran into multiple issues. First, we have a bug where somewhere along the calculations, nodes are pointing at each other as parents, causing an infinite loop to occur when determining a path. Second, on occasion, the enemy was ignoring obstacles and walks straight through them. Third, an issue with path calculation when the target suddenly becomes far from its position in the last frame of the update. I was able to locate most of the issues to be caused by the way we are handling the recalibration of nodes when the cost of a node changes. Unfortunately, I have yet to be able to uncover the reason why strange things happen when trying to path to a target that is suddenly far away.