Devlog - A Pathfinding and Enemy Spawn Issue (17th September 2024)


Enemy Spawning and Pathfinding Issues:

Today, I worked on spawning enemies using the free version of the A* Pathfinding Project. There are currently issues with spawned enemies not properly connecting to a path or reaching the player target. I reached out to my unit coordinator for help, mentioning the following details and attaching screenshots for context:

  • Image 1: Shows four enemy objects placed directly in the scene, following paths correctly towards the player target, though there is a strange animation glitch.
  • Image 2: This image includes both manually placed and spawned enemy objects. While the manually placed enemies follow a path, the spawned objects are following paths to unknown points rather than the player.
  • Image 3: Confirms that the manually placed enemies follow the correct path from the furthest point in the scene toward the player target, showing the intended behavior for the pathfinding system.

The issue likely involves the spawned enemies not updating their paths correctly to follow the player target, and I plan to further troubleshoot or await feedback from my unit coordinator.

Enemy Ghost Color Change and Health Adjustment:

In addition to the pathfinding work, I implemented a feature where the enemy ghosts blink and turn red after being alive for a set period of time (10 seconds). Upon turning red, their health increases, making them harder to defeat. This was achieved by creating a separate health system, and when the ghosts turn red, their health increases from the initial value of 2 to 4.

  • A coroutine handles the blinking effect, alternating the ghost's color between red and white for a few seconds before locking the color to red.
  • The arrow collision system was adjusted to account for the increased health after the ghost turns red. Each arrow strike reduces the ghost's health, and when the health reaches zero, the ghost is destroyed.
  • The ghost's health is now publicly accessible in the EnemyHealth script to provide feedback on remaining health in the console.

Debugging and Improvements:

  • Encountered an issue where the arrow collision stopped working due to missing health access. This was resolved by exposing the health field in the EnemyHealth script.
  • Ensured that after two strikes when the ghost is in its normal state, and four strikes when in its red state, the ghost is successfully destroyed.
  • The setup now works smoothly, allowing for future tweaks in the ghost's behavior and difficulty progression based on health and color states.

Leave a comment

Log in with itch.io to leave a comment.