Does this occur in a clean, blank project with no additional content or is it limited to one project? What steps can I take to reproduce this on my end?
Have you tried to repro the script as seen in the Shuffle_00.Jpg I posted ? Because this is as easy as it gets. Just do that script in a pawn blueprint and voila
Yes this was the method I attempted and on my end all indexed items shuffle. I then attempted a variant where every time I pressed 1 it would shuffle and print the index with the same results. Each time the indexes shuffled as expected without missing any indexes. Are there any other steps I can take to reproduce this?
On my end, all 4 clients have consistently randomized the shuffle of indexes entirely each time the script is run. Is it possible that during the shuffle the last index just happens to retain it’s position every once in a while? That is still a possibility within a shuffled array.
Try this - Place your shuffle and print information on button input 1. Once that is done, go into each client and press 1 to see if they come up the same or similar each time. Do this a few times and see if you get the same results as you were before.
The only thing I’m seeing is that all clients are producing their numbers the same on all 3 other clients, which is expected. Are there any other steps I can take to reproduce this on my end? Perhaps try clearing and re-sizing the array before shuffling.
Well I tried to clear the array, resize and resuffle and I get the same issue.
The list is random for everybody, except for the last index.
I tried to execute that script when pressing a key, And it does the same problem, sometimes it’s fine sometimes the last index of the array is not shuffled or the randomness is resulting it as the last index.
Try to add a key shortcut in the blueprint to reshuffle the list (don’t forget to clear the array first) and see if you can reproduce the problem.
Just tried with a list of 500 indexes, and it’s the same problem… 500 is being the last index quite often… I even got it 4 times in a row ! The odds are 1/62 500 000 000… There is definitively something wrong, and I’m really surprised you can’t repro it with the exact same project.
Awesome ! Let me know if you get any information on that. This is pretty important for my project. Thanks.
ps: I might not be the only one with that issue, I don’t know if thoses posts are relevant. It seems there are different results when testing in-editor and StandAlone/Packages
I created another project with a script that would do a shuffle with a loop, and show how many times an Item appeared at a certain Index after being shuffled.
Here are the results
63538-
After 85k loops, the results speak for themselves. Everything seem to be fine and are in the correct range, except for the last index.
ps: The shuffle is using a copy of the original array, it’s not using the same shuffled array over and over.
It is noteworthy that the Last index of an array has (as expected) greater chances to be the last index after a shuffle, and lesser chances to be the first, in a linear way.
Actually all of the rows have a linear tendency with a peak at i-1, and after that everything back to normal (except last id of course because of the last element)
(Sorry, didn’t want to make it unsolved)