Blog 2 (2/11-2/25) - Spring Break is here!

Introduction

These two weeks were composed of a QA sprint along with the first half of our second feature sprints.

Studio Meetings (4 hours)

We had our weekly studio meetings on Sunday to check in with our respective teams as usual.

Bug Fixes (6 hours)

The QA sprint involved fixing various bugs in the game so that we can hopefully have a stable build to playtest and get design feedback. Since I was on the enemies team, most of my fixes revolved around the bosses and enemies

Most of the bugs were pretty simple to fix. However, there was one interesting one that took me a bit longer and allowed me to learn a bit more about Unity's physics system in the process. We had an issue where enemies were pushing each other around, even when they were not touching each other.

This issue was pretty odd since the enemies were set in the project settings to not collide with each other. After some digging around in the prefabs, I found a component attached to several of the enemies called a point actuator. The purpose of this component is to create a repulsive force around an object that propels nearby objects away. However, the actuator still shouldn't have been pushing enemies due to the collision layers. However, I soon found out about a sneaky option on the actuator called layer override. It was set to the enemy layer, which you think would cause it to only collide with objects that enemies can collide with. However, what it actually did was overrite the object's layer setting to also collide with enemies. There are tons of small things like this in Unity that can blow you up if you don't know about them, so I'm glad I got a chance to learn one of them.

New Boss Attacks (10 hours)

My main task for the first week of the feature sprint was to implement a handful of new boss attacks. Thanks to the boss behavior framework I had setup the previous week which took advantage of composition, the new attacks would "just work" when I added them to the boss!

The first attack I tackled was the bouncing bullet attack. This attack fires two projectiles that will bounce around the arena. Implementing the attack was relatively simple. What was more complicated was modifying the projectile system I had previously created to handle bouncy projectiles. I wanted the system to use composition, not inheritance, so the bounciness of a projectile could be easily enabled and disabled. I created an IsBouncing component that would be activated whenever a projectile is fired. This component would simply flip the x or y component of the projectile's velocity when it hit a wall or floor.

The next attack I worked on was the cross fire attack. This is an attack that will fire projectiles in a rotating cross pattern. Implementing this attack required me to think in angles.

Lastly, I fixed up the previously implemented burst fire attack so that it would fire 3 separate bursts instead of just 1. I also made the number of bursts, and the number of projectiles per a burst configurable, so that the designers could easily modify the attack behavior as they liked.

Work in Progress on Laser Attack (4 hours)

Since I had a bit of extra time, I decided to start working on another one of the attacks in the design documentation, the laser attack. This attack would be different than the others, because it would use a continuously firing laser instead of discretely fired projectiles.

The way I chose to implement the laser was as a new game object with a box trigger that would continously damage the player while they stood in it. This would simplify the attack, because I could effectively instantiate the laser once and then just rotate the new object as I needed.

Figuring out how to rotate the laser was a bit tricky and required me to do some angle math to figure out what direction the player was in relative to the boss and how the boss would need to rotate its laser to hit the player. I am not super satisfied with how its working, so I will come back and touch this up after Spring break.

Conclusion

This week, I worked for a total 24 hours! I'm looking forward to finish out this sprint after a restful break.