Sunday, 5 February 2017

Pathfinding adjustments and Chris meeting

For this weeks work I looked into improving the pathfinding system and also had a quick meeting with Chris to discuss the bug stopping the AI sight raycast from begin at eye level. Firstly I changed the AI way-point system to be more user friendly so instead of having to assign all the way-point markers individually, it now will automatically find the way-points and assign them to an array when found. This makes it much easier to add way-points for the AI characters and saves a lot of time when trying to put loads of AI into the scene at once. A bug was fixed where the game would crash if no way-points were put into the scene as well. If no way-points are selected he will now use his start position as a way-point. One thing I looked into adding was using Gizmos to draw out the path that the AI will take by connecting lines between the calculated path. I decided not to do this as the amount of work that it would have taken wouldn't have been worth it as you could only see this in the scene view. It would also be quite costly as it would be calculating the path between way-points often and having a lot of AI in the scene at once could lead to a significant drop in frames.


AI Pathing


After working on the pathfinding elements I decided to use the animations from the Unity standard assets to set up a basic animation controller. This was so that I could have the character walk, run and idle deepening on what he is doing. I also fixed a bug where running into the character would cause him to spin around while still trying to path towards you. This would cause the AI to break (As he never stopped spinning) and would need you to restart the game to fix it. I also had a meeting with Chris and fixed the raycast so it is now shot from the AIs eye line and not from his feet.

Before bug was patched


For my next weeks work I will be working on creating my presentation which I will be presenting to my lecturers. I will also be linking the sight, hearing and pathing mechanics together so that the AI can react to everything that is happening properly.

No comments:

Post a Comment