Randomness
Well, do you even need it?
Apple changed the ipod shuffle play algorithm – because random can clump, but we don’t think it should…
Seed
Were it is – e.g. the running game i made, had a selection of predefined map sections that were ‘randomly’ selected – so long as there was not the same one after the other… seemed to work well. As the levels progressed, the pool would get new items in it (that were more difficult) and the ‘easier’ items were weighted lower so would come up less frequently…
Shufflebag
A Shuffle Bag is a technique for controlling randomness to create the distribution we desire. The idea is:
Pick a range of values with the desired distribution.
Put all these values into a bag.
Shuffle the bag’s contents.
Pull the values out one by one until you reach the end.
Once you reach the end, you start over, pulling the values out one by one again.
Oregon trail example
https://if50.substack.com/p/1971-the-oregon-trail?subscribe_prompt=free
An example: “If the player has at least (22 + a random number between 0 and 4) clothing, that’s sufficient to stay warm.” A player might figure out through trial and error that while $20 spent on clothes is never enough and $30 seems always sufficient, there’s some uncertainty from game to game about where exactly in the middle is safe—a difference it’s easy to imagine correlating to the unpredictable strength of a winter storm.
Progression curve
From: https://if50.substack.com/p/1971-the-oregon-trail?subscribe_prompt=free
Another example can be seen in the sketch at a narrative arc enabled by this line, which determines the likelihood each turn of being attacked:
2100 IF RND(0)*10>((M/100-4)^2+72)/((M/100-4)^2+12)-1 THEN 2500
The details are gnarly, but the equation pivots on the M variable, representing the number of miles traversed. Offsetting it and dividing it by differently scaled amounts creates a curve of probability distribution across the player’s journey, making attacks more likely as the player moves away from settled Missouri, and then less likely again as they approach their final destination. This mathematical trick establishes a deepening and then easing sense of danger, without printing any text to this effect explicitly. A similar trick increases the chance of cold-weather hazards during the middle of the journey when the homesteaders would logically be crossing the Rocky Mountains, even though the game never explicitly mentions this geography. Oregon Trail lacks explicit markers of progress other than the increasing mileage number—the concept of “rooms” from later adventure games didn’t yet exist—yet still works to give players a sense of forward progress and geographical consistency.
More here:
https://codedive.substack.com/p/something-found-in-the-oregon-trail
Textures
in ‘a link to the past’ the ground textures that have a little bit of detail are clumped together – it feels natural – rather than ‘random’