How to add obstacle / block area per agent?

The game is using:

  • RecastGraph to generate the navmeshes in a 2D top-down game

  • FollowerEntity to move the agents

  • RVO avoidance to prevent agents from overlapping

I want to prevent certain monsters from entering a specific area of the map (for example, inside the city), while still allowing players to access that area.

Additionally, this is a co-op game. Is it possible to “cut” or modify the navmesh per agent? For example, if Player A completes a certain quest, they gain access to a restricted area, but Player B (who hasn’t completed the quest) should not be able to enter it.

Note that I dont want to create a navmesh per agent and modify it if possible.
Note2 I found that tutorial Utilities for turn-based games but I want it to FollowerEntity

Ok found the solution in here:

However, I saw that there are limited number of tags, if I use one tag per quest lets say, I will run out of tags. Still need to think how to go about it.

This was going to be my suggestion. You can have a graphMask that seperates the Navmesh Cuts per player or agent. How many different types of agents are you expecting to have to limit area access to?

You can do quite a bit more with ITraversalProvider than just use tags. You can basically use filter to find a path arbitrarily- the example explains it pretty well, how you can only filter paths with nodes above 50 units high.

It’s an online multiplayer game, and each player can have many quests that either grant or restrict access to certain areas. The number of quests could easily exceed the tag limit.

Is there a way to attach custom data to a node? If so, I could use a provider to check whether that node is associated with a specific quest, for example.

I think your better option would be to do it backwards. Hold the data in the quest that holds those nodes or tiles. That’s how I’d go about it personally. You can then check against the quest’s/agent’s data for tiles it can or cannot traverse.

Not sure if I understood, how do I create this areas and store it ? It would need to be a new navmesh for each quest?