So a game I’m developing has a map system where individual parts of the map can be loaded independently from (most of) the other parts.
I wanted to have a random number generator which, given a seed number, and a map part number, would generate a random number. But this number has to be consistent for each pair of seed and map part number.
What is such a random number generator called? Also, what are good examples of such a RNG?
Most random number generators work like this. You call a
seed()function with some combination of yourseedandpart_number, then call arandom()function to get the “random” number you want (which of course isn’t actually random, but that’s what you want).For instance, in C++: