C
Catastrophe
Guest
Got a bit of an open question regarding saving and random seeds.
So I've got a large grid based open world map and a seed defining said map. For terrain and small decorations I'm using perlin noise and a faster trig-based noise generator respectively, and simply making choices based on the float number I get from them at a grid point. This works great.
However, I also want unique random encounters and shops/towns based on a grid point, and doing these with just returned floats would be ultra-time consuming and complicated, since there are a lot of variables and they need to be deterministic based on the map seed and grid point. The two ideas I have here are:
A) just determine them on the fly after a randomize(), and save every detail of them into save files, though the player could visit dozens of towns/enemies,shops/etc over the course of the game. Edit: actually, this would mean the player could reroll these before a visit, so this is not so great.
B) use the map seed and the grid point to generate a new seed, and random_set_seed to it to use just for the encounter/shop/etc
--
B) sounds much more attractive, but I don't really know enough of what goes on under the hood of random() calls to know if it's truly random this way. It also sounds like I'd have to figure out my on noise generator to generate the new seed since the ones I'm using so far only give 2 decimals of accuracy.
Anyways, just thought I'd get some opinions before building the entire game around this concept.
So I've got a large grid based open world map and a seed defining said map. For terrain and small decorations I'm using perlin noise and a faster trig-based noise generator respectively, and simply making choices based on the float number I get from them at a grid point. This works great.
However, I also want unique random encounters and shops/towns based on a grid point, and doing these with just returned floats would be ultra-time consuming and complicated, since there are a lot of variables and they need to be deterministic based on the map seed and grid point. The two ideas I have here are:
A) just determine them on the fly after a randomize(), and save every detail of them into save files, though the player could visit dozens of towns/enemies,shops/etc over the course of the game. Edit: actually, this would mean the player could reroll these before a visit, so this is not so great.
B) use the map seed and the grid point to generate a new seed, and random_set_seed to it to use just for the encounter/shop/etc
--
B) sounds much more attractive, but I don't really know enough of what goes on under the hood of random() calls to know if it's truly random this way. It also sounds like I'd have to figure out my on noise generator to generate the new seed since the ones I'm using so far only give 2 decimals of accuracy.
Anyways, just thought I'd get some opinions before building the entire game around this concept.
Last edited by a moderator: