Random streams with different seeds consistently return same number
Hi, I've been having an issue with random streams returning the same numbers as streams using different seeds. I've set the seed of the stream at begin play of the actor and told the actor to print a string of the seed it is using. I've then told it to print a random integer from the stream as shown in the image below.
I've got roughly 10 actors doing this all with different initial seeds as seen printed in blue however the red numbers they return are always just two different numbers.
I've tried changing the initial seeds to ensure it isn't just random coincidence but it just changes the two numbers that are chosen. These actors are down a chain of actors that have a random seed and then produce a random seed for the actor that they spawn, I think this might have something to do with it.
I have five tiers of actors spawning the next one down, giving it a seed variable from their random stream and setting the stream seed to that seed variable. The first four tiers of actors all produce completely random numbers but once it hits these actors they all produce the same two numbers. I don't know if it's just an inevitable result of the maths that they eventually converge to the same numbers or if there is something going wrong with my random streams but I'd really appreciate any help you could offer. If there is any other information that would be helpful I'd be happy to provide it.
asked Aug 11 '17 at 04:03 PM in Blueprint Scripting
Make sure that the Random Stream variable is initialized, by making a random stream and setting the value to that.
answered Dec 11 '18 at 11:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here