What exactly is "BIG_NUMBER"?

I am attempting to create a custom nav area that cannot be traversed, similar to the NavArea_Null provided by the engine. The c++ code for the engine’s Nav Area has this:


DefaultCost = BIG_NUMBER;

It seems as if BIG_NUMBER is what is used to stop AI from entering that area, but what exactly is BIG_NUMBER? How would I create my own null Nav Area without creating a Nav Area in C++ and doing the same thing?

It is (3.4e+38f) i believe.

if my memory serves me correct i think BIG_NUMBER is the max of a 32bit float.

If you ever find other constants try looking on the github for the file “UnrealEngine/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h”

Thanks for the link! Do you know of any way for me to represent BIG_NUMBER in blueprints?

2^128 ? Idk honestly. might have to make a c++ variable exposed to bp’s

Maybe better to understand the concept here. It isn’t the number itself that is causing the AI not to go there, but rather the cost.

Pathfinding is typically cost based, where the AI computes a route and looks at the cost of each area it has t move through then choosing the patch with the lowest cost. By setting the default cost to be BIG_NUMBER what the code is doing is simply making it really expensive to go there and thus making it pretty much impossible for the AI to choose to go there.

My point here is there there isn’t any mystical or special about BIG_NUMBER other than that it is a big number :slight_smile: Setting your cost to any sufficiently large constant value should serve the same purpose.

Well I was setting both the initial cost and traversal cost to something like 100000000000, but maybe that’s not big enough :stuck_out_tongue:

Yes, but using a number like 3.4e+38 ensures that the movement cost is the maximum it can be. So that there isn’t weird path finding glitches. For example, in my level generator plugin, i have entities that roam the level making features/rooms. Since it’s a path-finding entity i need a cost for things the entities place down such as a wall. Well lets say that wall was ((3.4e+38)-1) cost and not (3.4e+38) since it is one less than maximum cost, if something were actually maximum cost(3.4e+38) say a different wall, wall2, the pathfinder entity could potentially move onto that wall feature with ((3.4e+38)-1) cost.

Maybe a failed design by me, but I’ve never been able to figure it out.

Try 340,000,000,000,000,000,000,000,000,000,000,000,000

Alright thanks, the cost maxes out at “340282346638528860000000000000000000000.0” and does not allow AI to pass through.