Hi, please, I need implement a door in my grid graph, this door only can let pass my units, and don’t let pass the enemy units, I try to implement this with a RVO obstacle component and flags it, but says that is deprecated, how I can do this? I don’t want create more graphs because this add performance, what is the right way.
You can maybe place an empty GameObject with an RVO Controller in the door that’s assigned to a layer that will keep neighbors from freely going through the door? Be warned there are some weird interactions with locked/stopped RVO agents but I’d say give it a test and see if that solution works for you.
I was trying, but the RVO have a circular shape, I need a rectangular shape, there is a way to get that shape? I remembers that before we can define and RVO agent, but now that is deprecated.
I guess my honest question here is if a square is fully necessary? I can’t see much harm from having a small circle (or two, or five, as pointed out by dvneal) if it functions correctly. On top of that, with RVO even if there was a square shaped obstacle for RVO they’d still basically just push up behind it and try and “pathfind” through it and it would look unnatural. Hence why I’d recommend ITraversalProvider still. I, honestly, don’t think RVO is a good fit for the job of “keeping a unit from going through a door”.
I think ITraversalProvider is probably the best solution, but there are a ton of pragmatic solutions that are possible, depending on your exact needs and circumstance.
Have 2 separate graphs, and have the graph the enemies are walking on not extend into “safe areas,” like whatever is beyond the door, or
Make the enemy too tall to pass through the door (even if it’s not visibly the case), or
Make a “threshold” at the door that is too tall for the enemy to walk over, but not too tall for the player, by adjusting step size, or
Make the enemy radius too wide to fit through the door, or
Use a script to detect when the agent is near the door, and then give it a new pathfinding destination (give up and go back to the nest, or whatever), or
Filter the destination locations when you generate them to make sure it never gets one that’s behind the door