Friday, April 26, 2024

Seven Seas to Glory - Sprint Blog 6

 Sprint 6

My goal for Sprint 6 was to fix all issues and imperfections that were present in the game and make the ship combat a more fun experience for the player.


The first thing I did was make the cannon move up and down when aiming. This made it so the aiming of the cannon was more realistic to real life. I interpolated the cannon’s movement to make its rotation feel a lot more smooth. I also clamped the rotation between 10 and -1, so the player can’t rotate the cannon an unrealistic amount. This also allowed for the cannon to be angled down enough to still hit the enemy ships when in close proximity.


Next, I added two more cannons to each side to make the combat between the player and enemies more fair; enemies have three cannons each. I thought this would be easy at first, but then I thought about the issue with the special cannonballs and the possibility of the player having less than three but more than zero special cannonballs. I then decided to have each side have a master cannon that controlled the actions of the other two. The other two don’t have scripts of their own. This way, I was able to not only make sure that the special cannonball count was accurate to what the player had, but I made it so that two special cannonballs would shoot out the outer two cannons and one would shoot in the middle cannon. This made the difference in cannonball types feel less random and more purposeful. Another thing that stemmed from this task was making sure the special cannonball values were stackable. Both of them called an IEnumerator, which wouldn’t run if called multiple times. Instead, I created a bool that detected if the ship was hit, and an integer that stored the number of times the ship was hit. This allowed for the values to stack even if they hit the ship after the IEnumerator had already begun.


I, then, implemented the cannonball models. This consisted of making sure both the inventory and shop UI depicted the accurate cannonball models. I also added particle effects to the bomb, which made it look like it was lit. Most of the work for this was checking to ensure that all the cannonballs had the proper colliders and scripts attached.


After I was happy with the cannon’s functionality, I moved on to cleaning up the UI. Text would sometimes appear on top of each other, which made prompts hard to read. I began by first making sure only one health bar was on the game canvas at a time so that the UI was less cluttered than it needed to be. I then moved “Press F to return to ship” under the health bar, and the hand-to-hand prompt just under that.


I also implemented the sword model for the player. I had to ensure that the sword script was attached to the model, as well as make the collider a trigger so it would function properly.


Before completing any more cards, I had to deal with fixing merge conflicts that occurred. It took me two days to find all the conflicts from the merge because they weren’t all obvious. The most important issue that happened from the merge was that the cannons fired on the z-axis again. The script was the same, but they didn’t work properly. I tried making a prefab of the cannons and importing the package, but that didn’t fix the issue. I had to create a prefab of the water that was merged and add the prefab to a branch that didn’t have the merge yet. This solved the cannonball issue. Many of the other issues were finding discrepancies in the inspector.


During the last playtest, some people noticed that pressing Y for hand-to-hand combat didn’t always work. My teammate figured out that one of the reasons for this issue was that the duration of the choice was too short. We increased the duration to 10 seconds instead of 2. I then added a line that ensured the text would disappear after the duration was up. This helps avoid confusion about when the option is available. I also noticed that the option for hand-to-hand combat would sometimes appear when the player is already on the enemy ship, so I added a small if statement that made sure the player was in the ship mode before presenting the option. Lastly, I decreased the size of the hand-to-hand combat collider, so the player would have to be closer to the ship before switching to hand-to-hand combat. This makes it possible for the player to be able to jump onto the enemy ship every time, instead of being too far away.


My last assigned card was making the player ship collide with the enemy ship, instead of driving through. This had a larger impact than I had anticipated. I had to add a rigidbody to the player ship so that the collisions would register. I made sure to lock the ship’s X and Y rotation, as well as the ship’s Y position. I had to change the ship control script to move the rigidbody, rather than the game object itself. This then caused the player to fall through the mesh collider that was being used previously, so I had to add box colliders around all the areas that the player would touch. I had to make sure that I got the curve of the ship to be well represented by the colliders. Then, I had to add box colliders to each enemy ship. The rigidbody also caused the player ship to be pushed by the cannonballs. This felt awkward, so I had to fix it. I achieved this by changing the enemy cannonballs to triggers and having the player health script handle most of the cannonball’s functionality.





No comments:

Post a Comment

Seven Seas to Glory - Sprint Blog 6

 Sprint 6 My goal for Sprint 6 was to fix all issues and imperfections that were present in the game and make the ship combat a more fun exp...