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 all 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 time 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().
Hey Rama! 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 this 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 ? This is supposed to be in :
This is a path for one of the files :
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 this 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 max uniform distribution, rand double - min to max 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 max 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 this 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?