blah
blah copied to clipboard
Random module
Hi, Any plans on adding noise/random sampling to this library?
Yeah I'm into that idea. Realistically it would be a very simple/light pseudo number generator... I think if you want something really complex/thorough just using the standard library or an existing library specifically designed for that is probably best.
Understood, The main reason I ask is that rand() from c doesn't produce very nice randomness and the c++ api is quite daunting. I usually rely on https://github.com/nothings/stb/blob/af1a5bc352164740c1cc1354942b1c6b72eacb8a/deprecated/stb.h#L8360 from stb.h Would perlin noise fall outside the range of this framework? I'm imaging an api like Random rand; rand.seed(seed) rand.int() rand.float() rand.perlin1d(x) rand.perlin2d(x,y) rand.perlin3d(x,y,z)
yeah I think something like that sounds cool. I would realistically need to research algorithms to include, although I definitely agree a fast perlin would be super useful.
This library has a bunch of nice stuff in it, might be a good source of inspiration https://github.com/andrewwillmott/distribute-lib
See Generate.h for a bunch of different random number and sequence generators
Here's a really nice C/C++ random number solution. It produces pretty good numbers, and supports all the basic C types already: https://github.com/RandyGaul/cute_framework/blob/master/include/cute_rnd.h
At some point I'll definitely add perlin 1d, 2d and 3d. It's a bit low-priority but will happen at some point.
Yeah this is really nice Randy! I'm not super sure yet but I'm currently of the opinion that it's probably best to keep things like number generators and so on up to existing libraries, and leave "blah" to just doing the core of what I need to get a game off the ground.