Anything beyond max int32 will return -2147483648
The issue I found is the use of TruncToInt instead of TruncToInt64 inside RandHelper64
int64 Max = MAX_int64;
int64 Random = FMath::RandHelper64(Max);
UE_LOG(LogTemp, Warning, TEXT("%lld"), Random);
If we apply the fix like so the issue is resolved.
//TruncToInt64 used
Random = FMath::Min(FMath::TruncToInt64(FMath::FRand() * (float)Max), Max - 1);
UE_LOG(LogTemp, Warning, TEXT("Fixed %lld"), Random);
You can see the second line is how it should be.
I’ve seen pull request been made about this but I don’t know if there’s something else to it.