Hello,
From what i’ve read before and what I’ve tried, in Blueprints, the “randoms” nodes give a random value each time this node function is called.
And the “randoms from stream” nodes give a random value once and then give the same value if we call it later and don’t change the Initial Seed.
Am I right or not ?
Because after some tests, I found something weird.
Here is my blueprint test, basically an event begin play, launching 4 Print String with the value randomly chosed. All the tests scenarii were played several times to be sure.
1/ First test was with the node RANDOM INTEGER and the Max at 4.
-> As expected, every PRINT return a different value (or not because no check for the previous value but often) because every time they’re calling the function, this one get a random integer between 0 and 3.
2/ Second test was with the node RANDOM INTEGER FROM STREAM with the Max at 4 as well. And a random stream variable with a fixed initial seed at 0.
(the one currently working in this blueprint)
-> I was expecting that all the PRINT nodes would return the same value first. But NO ! (more often than in the first test though but still weird).
Moreover, I thought that when we change the INITIAL SEED of this variable, it would change the randoms value printed when i re-play the game, But NO !
Is it normal ?!
To get other values with this node, I had to create another variable (even if that one got the same initial seed)
3/ Third test was with the node RANDOM INTEGER FROM STREAM with the same Max. And a MAKE RANDOM STREAM node linked to it and a fixed Initial Seed.
-> This one work like I was expecting from a random from stream value. E.G. All the PRINT node return the same values.
And If I change, the INITIAL SEED of the node MAKE RANDOM STREAM with another fixed value. Most of the time, when I re-play the game, I got another value randomly chosed but all the PRINT node return the same values
To sum up, I guess the first test is correct !
But what’s wrong with the second and third ?
I think the third is correct, but then what’s wrong with the RANDOM STREAMS variable. Why is it not the same thant a MAKE RANDOM STREAM node ?
Is it a bug ? Or just something I didn’t understand yet ? (haha, it’s possible) !
PS : (My version is still 4.17.2 by the way)