CAGD 470 - LockedIn Sprint #2
During this Sprint, I wanted to tackle more monster behavior and start some other mechanics related to the monster. During Sprint kick-off, we discussed that the objective for this sprint was to polish the already-made progress. So, as the developer in charge of the monsters, I aimed to finish one of them.
So, the first thing I wanted to work on was to finish the mimic behavior that I started working on in the first Sprint. To start, I made a sphere collider that would act as a trigger; once the player entered this collider, then the mimic would transform into monster form and follow the player. This worked theoretically; however, once I implemented it in my prototype, I faced the first problem. The player will enter the area, and the mimic will follow it even if the player is on a different floor or behind a wall. To solve this, I implemented a Raycast that will shoot from the enemy to the player, and if the first thing that the Raycast hits is not the player, then it will not follow the player, and once the Raycast hits the player, It will start the follow state.
With the Mimic following the player, it will constantly shoot a Raycast in the direction of the player, and if the player is too far away, it will start a timer that the enemy will keep following the player even until that timer runs out, and then go back to its starting position. If the enemy sees the player while the timer is running, the timer will cancel, and the enemy will return to the following state. This is how the mimic’s behavior turned out:
After adjusting other details and making everything intuitive for the designer, the mimic behavior was done. With that, I had to work on the light that would stun the Enemy for a few seconds. Since this was something that the player would do, I had to make it as modular as possible for the other developers to connect. So, I thought that the best way to handle this was by creating a trigger, which, if the enemy enters, will reduce its speed until it goes out. A problem I faced was that the enemy was slowing down before hitting the light, and the issue was that the trigger being used for player detection was hitting the light and stopping the enemy before entering the light. I solved it by checking if the collision type was two-triggered and preventing that from making the player stop. After that was solved, this is how it turned out:
With all that, the mimic was finished. I met with my designer, and the radioactive bug was the next enemy in priority. Fortunately, has a more simple behavior than the mimic; the bug is meant to follow a defined path and apply damage to the player if close by. After researching, I remembered a curve path that can be defined as Unity’s Splines. Splines are an easy way to make curved paths and it was fairly easy to make a gameObject follow the path. I also made it available for the designer to choose what speed they want the radioactive bug to travel. I also made a glow material that shows the radioactiveness of the bug.
Overall, this sprint went very well, and a lot was achieved. Thankfully, the mimic behavior is finished and can now work as my base for developing other enemies that LockedIn will have. I managed to make the code as modular as possible for further implementation and adding new features. We had some trouble merging the project on GitHub; however, after solving all the conflicts, my team was able to put everything together and have our first game prototype. After everything, I used Sprint's final days to make everything as friendly to the designer as possible. Thanks to the Scriptable objects created in the first Sprint, I just had to expand on it to give the designer the necessary variables to customize the enemy's behavior. It was a great Sprint and I’m hoping to improve my performance for the next sprints.
Comments
Post a Comment