This week, the team’s focus was to push for a playable Alpha build. We have most of the milestone features implemented. However, one important feature that I am still working on was the MT-D-* Lite pathfinding system. As mentioned previously, there was an issue with the system where the agent would not be able path find correctly. I have spent countless hours trying to locate the cause of the issue and ultimately decided to recode it with fresh eyes. While most of its functionality and structure remained the same, there was one major adjustment to the system this time around. The system maintains its own set of data representing its perception of the world. Previously, it was set to initialize the data for every tile currently existing in the world, such an approach has the potential to waste memory. Therefore, I have adapted the system to only initialize the data when necessary, such as when the information becomes relative to find the path.
To my surprise, because of the change in structure, it appears to have resolved the prior issues with the system. Under multiple testing, the agent was able to correctly find the path to goal regardless of the test conditions. With the system in place, the next major step is to have an enemy apply the system and utilize it in the game in real-time. Unfortunately, a few problems arise upon integration. First, the enemy would occasionally exit the playable area, thus preventing the game to continue. Second, at times, the enemy would path in a circle, not moving towards its target. Because of these concerns, I was not able to include the system in this recent build. While I am currently working to resolve these bugs, I suspect that the first problem is caused by the fact that the agent moves based on its velocity. When the agent is close to the map boundaries and happens to have a target towards that direction, there is a communication gap in which the velocity did not get updated in time to divert the agent towards a different path. Further investigation is needed to narrow down the cause.