But what specific are you having with the current random generator?
Also, if you give me the whole code,** tested in the current version of my Victory BP Library**, then I can review it and add it to Victory Branch (hee hee!)
Monte Carlo, personally. but also it seems that anytime i see someone use rand() they almost always use the modulo operator on it, which does horrible horrible things. since rand generates from 0 to RAND_MAX and it need to be is in-between them, rand()'s quality is never check, ie it can always return the same number, which conforms to rand()'s implementation. The quality of rand’s distribution is so poorly implemented that low order bits cycle in very short amounts. Also rand() in general is a terrible psudo-random number generator because if its seed is know, prediction is inevitable…
When people use rand() most of the it’s psudo-ness is fine in most applications, but in games, if we don’t want a loaded dice roll we must use something other than rand().
As soon as it is ready and tested in packaged game as not having any weird dependencies that prevent packaging, I will be happy to add it to Victory Branch and give you credit !
Hey ! Awesome plugin! I’ve been using it in my project and it has so much extra nodes that are incredibly helpful! Thanks for that! I’ve run into a bit of a problem though, when I try to package the game for testing on multiple computers I get error message:
I’m guessing I need to put the plugin somewhere in the packaged game folders, I’ve tried putting it in Projectname/Plugins as well as Engine/Plugins, but still that error message appears so I figured I would ask!
Are you using the current available plugin ? ( Newest ). Are you using UE4.6 and not an older version ? is supposed to be in :
ProjectName\Plugins
is a path for one of the files :
ProjectName\Plugins\VictoryPlugin\Source\VictoryBPLibrary\Classes\VictoryBPFunctionLibrary.h
Check if you are not missing anything in that path.
So I’ve fleshed out two different paths for the new rand functions, basically you don’t have to do anything but either use the construct rand ONCE like in begin play somewhere, or seed rand somewhere like construct rand and use the functions, if you use construct rand, it will determine if you have access to a random device, (entropy chip) if not it will default to a default random engine, it will use number from either the random device or use “std::chrono::system_clock::now().time_since_epoch().count();” to seed a pseudo random number generator then you can use the random functions i’ve included. You can also construct rand for some generations, then seed with others, it’s pretty awesome! im working on a ton of other engines and distributions exposed but for now there is; rand bool - Bernoulli distribution, rand int uniform 0-1 distribution, rand double uniform 0-1 distribution, rand int - min to uniform distribution, rand double - min to uniform distribution, but first i was just wondering, what kind of packaging testing i should do, atm i only have access to the windows 32 path. I packaged it into shipping and it seems to work. Anyone up for some testing on other systems ? Currently the only dependencies are <random> and <chrono> which are both c++ 11 headers
p.s. the picture has an error (not error, but random float has the min and variables as ints and i guess they should be floats not ints.)
Yeah, I’ve tried both 4.5 and 4.6 using the appropriate plugin, still doesn’t work… And just to be sure we’re on the same page, the plugin itself works just fine, it’s just that when I build the game and try to run the built game I get error, have you been able to build a game with a plugin? Anything else I need doing for it to work? My project is blueprint only, maybe I need to have a code project?