Inelegant Solutions

For every elegant solution I make, I make a few inelegant solutions when I can’t find any smarter solution. I started working on getting the golem to attack. Adding the collisions to the hands and adding the logic for it was a no brainer since I did it before for the player and the other boss. But since the golem is much larger, slower, and doesn’t turn as quickly, its attacks can easily miss or look stupid and clumsy. I tried using line traces at first as I did for the previous AI, but this didn’t fit because it was still turning too slow.

So instead I started my first piece of the inelegant solution which was add a giant box in front of the boss. Which doesn’t seem to be a bad idea, it’s similar to a vision cone, but instead this is for attacking. Whenever the player is in the box the boss knows it can attack. My biggest issue was getting the boss to continue turning to make sure it can attack. For the behavior I’m using the built-in MoveTo node and it doesn’t have any logic for facing the player, so the boss can reach a certain radius away from the player but be facing away because it turns so slow. It couldn’t attack so it gets stuck just standing there.

My finishing move to this inelegant piece was adding several MoveTo nodes where in the radius would get smaller and smaller, at least that way it would guarantee the boss would never stay still. I will definitely found a better way to do this later, but since the golem isn’t going to be the smartest enemy and there will be more threats in the area, I don’t mind keeping this for now.

Besides that I realized I didn’t have a default variable for the intensity of the player’s lantern so I fixed that. And I fixed the rotation orientation of the first boss because his rotation should follow the player’s because it worked better if he constantly turned to the player. I put back the voice lines for the boss because it was gone after I updated the AI, and I added a locked sound on the door to make it more apparent when it is locked.

I’ll be adding a few more attacks to the golem. Since it is a gigantic lumbering beast I won’t give it as much variety as other bosses, and I’m planning to add other damaging effects in the level once I’m done with the golem.

Leave a comment