Random stream in ActorComponent doesn't give consistent random results

I have a master blueprint class derived from Actor, that is placed in the world. This BP Actor is called*"Path*. In Path I have added an ActorComponent based BP called RandomTest.

In both Path and RandomTest I have a visible, editable, variable called Random which is of type Random Stream.

Inside the Construction Graph for Path I do some things, and then call a custom event on its components to let them do some things. The result is that whenever Path is changed in the editor, not only is its construction graph run, but also a pseudo-construction graph is run for all attached components.

Now the problem I am running into is that random streams acts as expected in the main Actor, Path, they do not act as expected in the components, such as RandomTest. Despite no change in the random seed, the values inside the components are not consistent, and give different results every time.

I set up a very simple test, where in the Actor Path I use Random Integer in Range From Stream to get a value and print it out, and then do the same in the component. I can clearly see the random value in the Actor remaining the same each cycle, and the value in the component just as clearly changing each cycle. I have confirmed that the seed is not changing.

Thanks for your response. I have not attempted this on a clean project, but will attempt to do so in a little bit. No code changes have been made.

As for screenshots, I can try if it is really important, but due to MPAA restrictions, it is a large deal to get any data out of the studio and requires a lot of hoop jumping :slight_smile:

Hello,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in clean project?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved?
  4. Could you provide any code changes that you may have made that would be involved with this issue?

Sorry I still haven’t found the time to try this on a new project, but something I did find out is that if I manually set the stream’s seed and reset the stream, at the start of each cycle, then it works properly. So I have a workaround.

Hello,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.