I’m desigining a melee combat NPC who has a sword like weapon and also has movement abilities like double jump and dash.
There will be many NPCs in the game at once (25+) and I am finding that constantly computing pathfinding for them just isn’t viable.
Once the NPC locks on to a target and gets close enough, they will strafe around the target until it is their turn to attack, the problem is sometimes where they strafe will actually be off a cliff.
So to remedy this I used pathfinding to verify if the position they are strafing to is achievable, but as the NPC is constantly strafing in a circle around the target, this requires constantly recalculating the pathfinding which for dozens of NPCs won’t work.
Does anyone know of some better strategies to make this work?
I was thinking of just adding invisible walls to all major ledges in the game and then changing collision groups so that only NPCs can’t fall off them, and then not bothering to calculate pathfinding for strafing, but it feels like a very crude solution.