Recast Navigation is working better and better. It’s still far from being a replacement to our old and trustworthy Tiled, but major porting and rigging problems seem to be resolved now. What remains are inherent RN issues, one of which are deadlock situations. Those I’ve been dealing with for the past few days.
Example below is a perfect deadlock situation. Two agents in the middle compete over reaching the same target (yellow point). Since both agents are equal, they push and react to each others pushing with exactly the same force.
Most of the deadlock situations are variation of this one. Agents exchange around a corner, three agents going for one target and so on. In essence it is all about dealing with “Equal opposing forces”. There are few high-level options:
- Firstly there’s the right way – tweak RN settings, which are plenty and not always well documented, Upside is that we don’t have to modify and maintain our modified version of the library.
- Secondly we can try to change RN state from the outside, e.g. by monitoring the agents, detecting if they have stuck and overriding RN agents state. There’s one major downside to this one though – in essence it’s like performing a repair on a working engine. One wrong move and whole thing might just explode. Even though I have ported Recast to Delphi, I still have rather vague idea on it’s internal workings.
Option 1 it is. And for the bonus material – exchange of 80 agents in a slideshow: