This is a place where we keep track of some bugs that we encounter. We don't include simple bugs like a typo, null reference, or just simply forgetting to call the function. The bugs here are oversights and logic errors that we didn't foresee when coding. Sometimes these logic errors can be easy to fix, and sometimes it will be rewriting and adding a hundred lines of code.
Bug #1 "The Double Swing"
Bug: This bug was just a pretty simple logic error. When the player clicked, their sword would swing, but what if the player clicked again during that swing? Well, it would call the swing function again, so when the previous swing finished, the next one would start, even if the player didn't click anything. While this is a pretty small bug and doesn't affect too much, this would be annoying when we add more complex fighting.
Solution: The solution was pretty simple, just add a bool to check if the sword swing function is running, and if it is true, just don't call the swing function again when the player clicks.
Bug #2 "Player Not Found"
Bug: This bug occurs in the "Enter Island" script, which is on a prefab that gets spawned into a scene with the player and the player's boat. We have a GameObject.Find("Player") line in the start function, but when it runs, it is not able to find the player for some reason. I tried switching it to a find game object with tag function, but it still doesn't work.
Solution: The solution that we found for this bug was to rework the whole system. Instead of using different scenes for each island. We have all the islands in the same scene and just moving the player between them. This solution also makes it a lot easier to move the players' variables, like what they have in their inventory.
Bug #3 "The Invisible Wall"
Bug: Bullets shot by enemies would randomly dissapear midair. This was due to the large 2D collider trigger used by chests to detect nearby enemies. Bullets destroy themmselves when they hit anything, including this invisible trigger.
Solution: Give the chest trigger zone a "NoBulletCollisions" tag. Tweak the bullet code so that bullets longer destroy themselves when the collider they collide with has this tag.
Bug #4 "Frozen Inventory"
Bug: The inventory slots stopped responding to the mouse cursor. The player was unable to equip any weapons or abilities.
Solution: The reason for this bug was that we were turning off and on the inventory in an odd way, making it so that if you did it in a specific order, it would be frozen. We fixed it by changing the order in which the inventory gets disabled to a new way that acts the way we want to have.
Bug #5 "The Infini-island"
Bug: Island loot and enemies reset whenever you enter an island. This worked even when you reentered the same island. This broke the gameplay loop because it let players camp out at one easy to loot island.
Solution: Linked islands resetting to a minimap system that tracks which islands the player has "visited". If a player has already visited a particular island, it doesn't reset its chests when the player enters it.