Ghost Spiders
Our launch of this game was marred by an absolutely horrific bug that we internally called "Ghost Spiders" after a player's comment to that effect. It seemed like enemies were attacking and killing the player which were not anywhere to be seen, making diagnosing this problem rather difficult. Tracking down and eliminating this bug was such a headache for me.
- Enemies check if they are within range to see if they can attack. However, since I added the functionality that spiders can climb on walls, this meant they could be on the other side of a wall or door and still attack the player. So I solved the issue by forcing the spiders to raycast a line to the player before they could attack. But still... the ghost spiders remained.
- To better performance in the browser, enemies are Object Pooled and simply disabled when defeated. I thought some aspect of their code, which was spread over several scripts, must somehow still be running and delivering damage to the players. So I added functionality to move them far out of reach when defeated. But still... the ghost spiders remained.
- I reasoned their logic must be running after being defeated, so I added more checks to ensure they were properly disabled when pooled. But still... the ghost spiders remained.
- I had used a hacky timer implementation for syncing up enemy attack animations with actually dealing player damage. I reasoned perhaps my timing logic was off, causing these attacks to stack up, and firing off when the enemy was re-enabled from the pool to be used again. Better of course to use animation events, calling logic at a specific frame within an animation. I figured out that one can add these events right in the animation import tab and avoid having to duplicate an external animation within Unity simply to get rid of the read-only status that imported animations all have. This also prevents blowing up the animation size when duplicating, which is important in WebGL so I will always use this method going forward. But still... the ghost spiders remained.
- When I reworked the object pooling, I at one point used an "early return" to exit a block of code logic if the enemy was disabled. However, later in that same code block, there was logic that checked if the spider was within range to perform the attack and this was getting skipped. I refactored this section of code. At long last... no sign of ghost spiders.
I want to believe the issue of ghost spiders is finally, once and for all, behind us forever. But somewhere deep within the infested jam source code, I worry these monsters still lurk. Just waiting for their chance to strike. So, player beware. Proceed with caution.
This update features several other bug fixes, some of which I'll list below:
- Proper texturing of final boss
- Kill cam for final boss
- Better AI pathing in final boss arena
- Boss arena is in a separate area for better memory management
- Improved graphic materials for foliage
- Combat difficulty tweaks (in favor of the player)
- Range of enemy plant attacks has been increased by 50%
- More visible Hit Flash when damaging enemies
- Improved Door Logic to solve several edge case bugs
- Weapons now cycle properly using the scroll wheel or 1, 2, 3 number keys
- Scenes now fade to black when transitioning or upon player death
- Some sound and music tweaks and improvements
Files
Get Space Infestation
Space Infestation
Sole Survivor, Stranded in Space, Confront the Bugs
Status | Released |
Authors | Lanyard, Bhaskar P, RedXink, LeoDiCarryo, Luca, CampLowell |
Genre | Action, Shooter |
Tags | FPS, lone-survivor, Sci-fi, Space |
Comments
Log in with itch.io to leave a comment.
👻🕷️
Thanks for the insight how you approached the issue. It was interesting to read. :)