This week went well. I finished what I needed to get done, and even went on to other areas that I wanted to work on. I made some adjustments to some of the enemies I worked on earlier, and got those more in line with how they are intended to function. The piranhas are now visually implemented for the most part, and don’t look out of place anymore. I also worked on making their pathfinding grid update when walls are destroyed, without needing to rebuild the entire graph. The last thing I worked on was starting the boss AI. I started working on the system it will use to decide which attacks it should use.
The first thing I did was finish implementing some systems that the enemies were supposed to use, but that I hadn’t gotten around to doing yet. I made the piranhas take damage and get destroyed by the player’s laser, instead of simply being destroyed on contact. I also made the sand dollar enemies destroy walls with their explosions. Additionally, I implemented the piranha’s sprite and the bite VFX for when they attack the player. All of these were simple additions that didn’t take much work, but were delayed either because they involved a system I needed to get more information about, or they required work from other team members before I could implement them.
After I finished all of those and was waiting on another system to be implemented, I decided to work on making the pathfinding grid update. I didn’t plan on working on it this week, but it needed to be done eventually and it was something I could start working on right away. The system used a graph of nodes with connections built between them in the editor. If there was a wall where a node or a connection would go, no node or connection would be built. This meant that updating the graph would require adding in new nodes and connections, which would be needlessly complicated and expensive. I changed it to make the nodes and connections, and simply avoid using them. Whenever a wall is damaged, the nodes around that area are checked for new available connections, and those connection are set to walkable if they are now clear. This can be done quickly during runtime, and makes the piranhas look much smarter, because now they won’t get stuck when they have an obvious path to their target.
The last thing I did was start the boss AI. This system depends heavily on design and art that still needs to be done, but some of the underlying systems could be started with the information I had. I made a system that can transition to a random state from a list, in order to get the random attacks we want the boss to make. I also made a script that picks one of these sets of transitions to try, based on the relative position of the player to the boss. This means that the boss will check where the player is, and then pick the set of attacks that correspond, then pick one of the attacks from that list randomly. This is how the designers described it, so I set it up that way.