Eliminate NPC blindspots? (Pathfinding) [SOLVED]

I’m returning to an arcade style top down shooter I was making in high school. I’m using pathfinding for the Zombie NPCs to follow the player, however, if the player gets too close to the wall, then the zombies don’t seem to lock onto the player once they’re within range anymore.

I made the walls an impassible object for the pathfinders, so I assume that the player and wall collision is too close for the zombies to try to attack me. Are there any places I can look to try and prevent this from happening? Any advice is greatly appreciated.

I think you need to adjust the cell size of the virtual grid on the pathfinding behaviour. I can’t remember if it’s increasing or decreasing it.

I can’t remember if the Pathfinder uses the hitbox or the bounding box to determine if it can reach the destination. If you can’t decrease the zombies’ area then you could use a small sprite for the movement and then make the zombie sprite move with it. (Stick it)

I checked last night, the cell size is set to 20x20. Adjusting it to be bigger (25, 45) made more blind spots for the zombies. Adjusting it to be smaller though (15, 10, 5) didn’t help with the already existing blind spots by the walls, it just led to zombies more easily clipping through walls and objects when following the player through sharp turns. Thank you for the suggestion though!

This comment led me to the right path!

The player and zombie sprites are 51x51. I switched the zombies out to a 20x20 sprite I had lying around, but that didn’t do much. I was going to reply to this comment, but then I tried to replace the player sprite, but that didn’t help either, although interestingly I saw just how much of a blind spot there was with the smaller sprite.

I was originally going to just upload this, but then I thought to replace both sprites. I did so, and I finally fixed it. Not only that, but I think the game feels much more fun to play now.

I had originally implemented the zoom system from Hotline Miami to account for the cramped space and not being able to see much, but with the smaller sprites, there’s no need. O(n top of that, everything feels much faster, and it’s harder to hit the enemy AI. I’ll have to make the crosshair smaller to account for this, actually, I’ll have to make all of the sprites smaller to this.

This project has been dormant for a couple years, but just something as simple as switching the sprites sizes has breathed new life into the game. Thank you so much for the suggestion!

1 Like

I’m glad it’s working. I just played around with the Pathfinder. Increasing the grid size seemed to allow the object to get closer to the wall although, it’s tough to tell for sure. Because changing the size also changes the grid column, row position.

I made my wall dragable. If I dragged the wall up just a little. I was able to get the player closer. Which makes sense if once set the grid seems fixed. If you’re still have troubles, you can try moving the walls just a little.