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: