(UE4) My "GetRandomPointInNavigableRadius" has broken and returns the same fixed values.

Hello, I’m hoping someone can help me.

UE 4.27

My “GetRandomPointInNavigableRadius” node has completely broken, it does not matter where I call it from it will always pick the same positions, it’s never random.

Here is a simple setup on the Level Blueprint, in a brand new UE4.27 project I get random values, it works as expected…

However in my project it has randomly (been fine for several months) stopped working and now only returns specific points:

image

When I run the exact same in a new blank project:

image

It works fine…

I’ve tried various things:

  • Reset all settings to default
  • Copied settings from a blank project
  • New Map
  • Remove all AI logic
  • Tried in several BP places (Level, Actor, AI… all the same)

No matter what it will always return those exact positions everytime I click Play…

I feel I’ve done something or changed a setting, even though I’ve reset everything…

Kind of at a last hope before I migrate my entire project to a new project… :frowning:

I don’t know why it isn’t working, but you could try doing silly things like having 3 copies of the node all fire at once and then random int selecting one of the locations.

This is crazy…

Two things:

  1. Have you tried setting a much smaller radius? Like 500? Does it output the same points in that scenario?

  2. Have you tried duplicating your entire project and seeing if it works in the second project?

Hello, thank you for responding.

Reducing to 500 seemed to improve it, however it still picks the exact same spots, just “more” of them, which is weird as I thought Radius was an “up to” amount.

When I click Simulate or Play it will ALWAYS pick the exact same pattern, here is an example:

image

The first 4 points are exact the same as you can see…

Is RandomPoint just not that random? does it take the tick or something as it’s seed?

I think this is just completely buggy in UE 4.27 (i cant use UE5 because its broken for VR)

In a brand new project:

image

You can see X is always 61 > 32 > 50 > -426… it always follows the exact same pattern.

I kind of solved this, for anyone who might run into this:

It turns out in UE 4.27 “Random” isn’t actually random and this is well documented, several factors affecting the Seed make it feel like it is but a basic “RandomInt” will always return the same pattern when spawned in the same actor. Doing Array > Random node proved this behaviour.

To solve it, I use the current date, multiply the Day/Hour/Min/Second/MS and than use this as my new Seed in “Set Random Stream Seed”, this will let you get much more randomness in your “Random Float In Range from Stream” nodes and such, which can be used to modify GetRandomPointInNavigableDadius.

A much simpler option would be C++ to gen a random seed but I can’t do that at the moment.