A Way to 'cap' "Very High Penalty Applied" Behavior?

I’ve working on a recast graph type that also uses GraphUpdateScene scripts from time to time (a penalty is applied, a path is calculated, then the penalty is removed). I’m guessing the “Very High” warning because if any GraphUpdateScene areas overlap, the nodes in those areas get updated (with additional penalty) each time? And that the warning is occurring for each node where this is the case (I get hundreds of warnings in some cases).

That said, is there a way to ‘cap’ the max node penalty that I can apply to safe values, preventing any overlap issues from generating this warning?

Sorry for the extra reply (I’m having all kinds of trouble updating my post…it keeps asking me if I want to ‘keep’ or ‘abandon’ my post, either way it just keeps the text the way it was, won’t let me update it at all). Anyway:

I’m guessing I can change the GET/SET for “Penalty” in GraphNode? I’ll try it out, and hopefully this won’t break something else…


I don’t think it is caused by that. I think it is caused by the values underflowing when you remove the penalties (which the warning also hits about).
Penalties are stored as unsigned integers, so if you try to set some value to a negative value, it will underflow and become huge instead.

Make sure that when you remove the penalties, you are removing them from exactly the same nodes as you added them to.

Also. If you set A* Inspector -> Settings -> Debug Mode to “Penalties” and enable “Show Graphs” you can visualize the applied penalties which might help with debugging.

All good points, but as strange as it is, it seems to actually be working 100% of the time and can be reproduced easily (just adding a cap to the penalty value removes all warnings (well, values of ~<16 million, and commenting the cap out will make the warnings re-appear). Any ideas on why this is?

More info:
The warnings only come up after the penalties have been applied, ‘resetting’ them has never caused an issue so far (and as you suggested, I’m changing the penalties to the nodes ‘as is’ before doing anything else to the navmesh.

*Don’t know what is going on the the forums today, can’t make any edits, anyway:

In my specific case, I’m giving ‘bad nodes’ a penalty of 10 million, in cases where 2 areas overlap, I get a warning that nodes have values of 20 million (which made me think the areas are being applied

Keep in mind that uints cannot represent negative values so

(uint)(0 - 5) > 0

Is true.

Ok, 10 million is a lot. I think that cap is at 16 million. Why do you need so huge values? 10 million corresponds roughly to the cost of moving 10000 world units.

But yeah, if you would apply a 10 million penalty twice, then it would go over that warning threshold.

Also, if you do not want the overlaps to have increased penalties, maybe you want to use a tag instead (see page about tags in the documentation).

“Why do you need so huge values?”
-I think I read a few forum posts where people seemed to have issues with values as high as 1 million and still the Seeker was making some ‘undesirable’ decisions. So I just thought ‘10 million’ should do it (keep the Seeker away unless it has no other possible choice [trapped in a ‘dangerous area’ or a similar situation]).