UE5 - Shuffle an Array Using RandomStream

Поделиться
HTML-код
  • Опубликовано: 7 май 2023
  • RandomStream is a super useful tool in Unreal Engine for generating reproducible random numbers from a single seed. But it doesn't come out of the box with a way to shuffle an array (or vector, or other random-access container). Here I show how to adapt it to the C++11 Uniform Random Bit Generator named requirement so that it can be used directly with C++11's std::shuffle algorithm. Hope you enjoy weeds, because we'll be diving into some.
    Blueprint-only version: • UE5 - Shuffle Using Ra...
    Amazing, extensive tour of the C++ "random" header • CppCon 2016: Walter E....
    FRandomStream docs - docs.unrealengine.com/5.1/en-...
    URBG docs - en.cppreference.com/w/cpp/nam...
    std::shuffle docs - en.cppreference.com/w/cpp/alg...

Комментарии •