My stealth system works pretty well but there is a decent flaw and I’m not sure what is the best way to handle this. The flaw is how should the NPC keep up with the player.
The stealth system keeps track of the visibility of the players, noise played around the map and finally the light visibility of the players. There is also a way for NPCs to communicate each other because all of the NPCs report player locations to every NPCs but this hasn’t been implemented yet.
The issue lies when the player gets caught by the NPC and must go through a chase to get away from the NPC. The chase would go smoothly IF it was all in the light. Once the player goes into the darkness, they cannot be seen by the NPC and the NPC would give up the chase.
This is obviously problematic because these dark areas would be considered as safe zones and they’re not supposed to be safe zones.
I also will prefer if all suggestions are ways to improve the AI rather than nerfing the player’s ability to sneak around.
You could make it a percentage system, much like Skyrim, for example complete darkness will give you a 80% of not being seen as base, but when you’re being chased it comes down to 0% because they got lights? Only thing I can think of to escape is to get break line of sight and hide somewhere where they can’t find you
I’m using Light detection revamp - Optimized and more accurate as my light detection and I turn it into a percentage already. I solved the issue of darkness by checking if the player is close to the NPC in the dark and then increase it during chases but now I have another issue to solve. Players breaking line of sight. If a player runs around the corner or goes through a hole in the wall, the NPC doesn’t know where the player is and gives up the chase.
You have to implement a LSP system, it’s where the last seen position of the Player/NPC is recorded, and the NPC goes there, then you could also check for their direction and make the NPC go there, and after this after line of sight is lost/the Player is hidden you then put a cool-down before the chase is stopped
Another thing is for when the Player is very fast and gets seen for like a second, to not start the chase, maybe depending on how professional they are they might go check or they might just say “must’ve been the wind”
I don’t know if you already did it but it’s just a suggestion LOL