Exception when using MultiTargetPath

I am getting this exception while using a MultiTargetPath but in this test case we had only one target :

Cannot create more than 256 temporary nodes. You can enable InvalidOperationException: : ASTAR_MORE_MULTI_TARGET_PATH_TARGETS in the A* Inspector optimizations tab to increase this limit.

Could you please explain what are those temporary nodes for ? We never had this kind of issue with the v4.x. We could increase to 4096 but I am not sure if it will not fail again with multiple targets (I thought that this limit was the number of targets, but it does not).

Best

Hi

In v5, the multi target path is more precise and can distinguish between multiple targets in the same node. This requires some temporary nodes to be created. A path will use roughly number of start nodes + number of destination nodes + 2 * number of off-mesh links it sees temporary nodes.
Will your game really need more than about 4000 targets?
Increasing the limit is not hard, I just didn’t think that games would really need that many targets.

In this test case we only had one target & one source. But we could have many links next to a target, so according to your feedback this exception should be related to “2 * number of offmesh links”. When talking about 4096, I was not clear, I was talking about the compilation define ASTAR_MORE_MULTI_TARGET_PATH_TARGETS. Note that we have enabled it and did not get any new exception yet. We will do more tests.

Best

1 Like