Download

Filter NavMesh on a per Area/Actor basis?

I have a procedural level that creates rooms, with actors that move around the level from room to room. I would like to figure out a way to prevent actors from entering rooms when they are not allowed to. However, sometimes I would like to let say one specific actor (not a type, just one instance) enter a specific room based on the game logic.

I know I can create custom NavAreas and nav mesh query filters, which is probably what I need to achieve this, but I don’t know how to make it work in this scenario.

If there is 2 rooms, lets call them RoomA and RoomB. I can create a custom NavArea and lay it over the two rooms. Then in the query filter I can tell the actors to ignore this NavArea. However, lets say there are two actors, lets call them Person1 and Person2. Now I want Person1 to be able to enter RoomA for a period of time. How would I achieve this? I have no problems working in C++ (and prefer it) if that is where I need to go.

I thought maybe I could use two different NavArea types, one for RoomA and one for RoomB, but that won’t work. Because this is generated at runtime, I don’t know how many rooms there will be. There could be 100 and each is unique. I can’t use a different query filter based on actor type as the actors are all the same type (same class).

Since I can’t find anything about this subject, I have to ask: Did you find a solution for this? @wilberolive
In my example, I want to have a number of buildings with doors and windows. The owner of the house should not consider windows as entry points, but pathfind through the door.
The door which is locked to anyone not part of the house should not be considered - or maybe it should, maybe they should path to the door, find that it is locked - and pathfind through a window instead.