Hi! I've got a few issues when it comes to sending points of interest to NPCs that are located in doorways. There seems to be an issue where, as a result of blocking off the navmesh (Single door doorways are too narrow for the regular navmesh no matter what settings I use, so I'm using smart links for all doorways for consistency), whenever there is an actor or a point of interest the NPC should go to in a doorway (if the player itself is spotted in a doorway, or makes noise in a doorway), it will get stuck in a loop trying to walk to a place it can't access. Would it be too much to ask that it just tries to go to the closest point on the navmesh?
Anyway, for the noise (the NPC goes to investigate noise), I've tried some of those nodes that get a random point in navigable distance, but it appears to fire in all directions instead, and make several noises for whatever reason. The way I've done it currently is to create two scene components that make noise on each side of the doorway, above reachable navmesh. This could work, but I don't necessarily get the best result this way. The best way would possibly be choosing one of the two noises at random when received, and either go through the doorway entirely to investigate, or stop just shy of it - NOT stopping and awkwardly bending in the middle of the doorway. However, the behaviour tree will treat these two points of interest the same, and I don't know which one it will pick since there are two. Maybe, if the noise is close to a doorway, I could somehow tell the NPC to ignore the point of interest and keep walking for a couple of seconds - but not back through the same doorway.
This issue is at its worst, however, when the NPC detects the player while the player is in a doorway. Until the player moves out of the doorway, which only uses a smart link and has no navmesh underneath it, the NPC will be stuck in a loop until the player moves. This doesn’t seem to happen when the NPC is already chasing the player, only upon state change for whatever reason.
Sometimes the NPC will also randomly stop in a doorway for a couple of seconds while chasing the player. It works almost every time, and I can never reliably recreate it. Whether it's caused by the smart links or the player's current location, is beyond me. I'm stumped.
Replies
Thanks, will keep that in mind. I have a tendency to want strange things people don't seem to bother with for small projects - or they have a setup that wouldn't work for the type of game I'm going for. If doorways cause problems, a developer may just not have doors that NPCs go through at all. So I end up having trouble finding appropriate solutions to certain things. I have this horrible habit of posting threads as a last resort, so I'm already somewhat agitated by a persisting problem. I try