Description

The implementation of UKismetArrayLibrary::GenericArray_Shuffle() will generate certain array shuffle results more often (up to three times as much) than others, rather than having a roughly equal changes for possible outcomes.

Ex: The array (1,2,3,4,5) will more often produce the result (2,1,4,5,3) than (5,1,2,3,4)

Suggested fix:
Community reporter mentioned changing

int32 Index = FMath::RandRange(0, LastIndex);

to

int32 Index = FMath::RandRange(i, LastIndex);

in function for loop will provide a more balanced chance of outcome results.

Steps to Reproduce

.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Gameplay
Affects Versions4.16.34.17
Target Fix4.18
Fix Commit3594501
Main Commit3628687
Release Commit3643070
CreatedAug 15, 2017
ResolvedAug 17, 2017
UpdatedApr 27, 2018
View Jira Issue