“I want for this loot system to spawn over 1000’s of items in each container throughout the world on beginPlay.”
and
“I also would like it to be highly optimized”
Is an oxymoron.
You need to just have a list and generate a random item when the barrel is interacted with.
running things on begin olay is ridiculous and would add A LOT to loading times depending on the size of the loot list * the amount of barrels.
Never seen the tutorial series you mention, that said, the concept of having weighted random list should be simple.
assuming > 1 item per barrel,
The table should contain a list of items, and a % for how likely they are to appear.
It doesn’t have to total 100% in fact you can use the 100% to force any item to always appear.
example. random int is 45.
item list is
A 5%
B 88%
C 100%
D 45%
E 30%
Now because of how % works, the system should allow for
c, b. And D to spawn, but not A or E.
So all ints > 45 can spawn.
I would suggest using floats instead of ints. You can fraction percentages off better that way.