RVOController collidesWith more layers

I want to simulate combat between some enemies. I can’t group them with types. They individually decide who they consider as a target to attack. I am using RVOController so they avoid each other. I want to make the agents stop avoiding their targets. I am guessing that the layer system could help in that regard. Each agent has a type and a list of agent types that he can attack (he can even attack his own type). One way I thought for fixing the issue would be to assign each agent type to a layer and then using the list of targets to change the collidesWith property. The issue is that there are only 30 layers available so if I decide to have more agent types then the above fix won’t work. Is there a way to have more than 30 layers or could I approach this issue in another way?


Currently there’s no way to get more layers, I’m afraid, except by modifying the source code (e.g. changing the layer field to be a long instead of an int).

Hm I see. I will try another way then. I was thinking of having a range check. If the target is “close” and we want to attack him we deactivate the RVOController so the rest of the movement to the target happens without local avoidance. Apart from that the attacker will try to go to attack “slots” so by combining those two I hope there is little to no overlap of the attackers. If there are no free slots then the attackers will just be using RVO normally

1 Like