Hello! This is a complicated question, so I’ll try to break it down as well as I can. I’m currently not near needing an answer, but it keeps popping up in my head all the time, and I will need the help at some point, so I might as well already.
I have a game world populated by peeps who go around, go to work, eat, sleep etc. Some of their decisions as well as outcomes of some of their actions are governed by random chance.
What I want is for the player to be able to interact with them (which will obviously also need some random rolls) and when they inevitably die, I want to generate the state the game world would be in if the player never existed. That way you’ll get a measure of how much of an impact you had during the game.
If I simply used the original seed to run the world again (without the player’s input), the outcomes of all random rolls would be affected whenever the player used a random roll himself. Ideally I would use a separate sequence of random values for each of the peeps living in the world, so that their rolls would only change after they encountered either the player or a ripple of his actions in the world.
To make an example:
- On day 3 a peep called Joe will get hungry and will randomly decide to go to Restaurant A.
- On day 1 the player has the option to try to intimidate peep called Bill. This shouldn’t affect Joe’s decision on day 3.
- Bill is intimidated and decides to go to bed to reflect on his life, which means he doesn’t have to make a decision on whether to have one more beer that evening, since he didn’t go to a pub. This also should’t affect Joe two days from then.
- Due to the change of schedules resulting from this, Bill and Joe meet on day 2 and Joe thinks whether he should talk to him. This extra decision from Joe means he’ll maybe decide to go to Restaurant B on day 3 and that is fine. Joe will be in a slightly different frame of mind on day 3 and thus the butterfly effect can come into play and change the outcome of his decision.
So… this is what I want. I can see some potential solutions here (unless there’s a shortcut I’m missing, which would be awesome):
-
I can write my own random function that would support what I need. I should point out I have little idea of how I’d go about that. Maybe something like the original Doom used (here) would be enough - the randomness doesn’t have to be too complex.
-
I can pre-generate all the random numbers I’ll likely need during the game’s course, multiple times, and use those. This sounds needlessly wasteful.
So… any tips on this?