Chance and numbers


Dev: Jacob Zhu

Today the post is about randomization. Specifically, randomization down in programming.

Because of the way randomization algorithms work, it leads to "predictable randomization", and an article  that talks more about this phenemonon is this: How random are the random numbers generated by your computer?

For our game, we want our AI to not spawn in all the time in the buildings, to give an element of freshness to each playthrough. How I've designed the code is from the basis that there is a pecentage chance that an AI will be spawned when the proximity volume is triggered by the player's position. As shown in the screenshot below, which uses Unreal Engine's randomization algorithm.

To minimize the predicatability aspect, I have used another random math function to provide the seed for the the spawn chance randomization. a sort of "double whammy" to allow for better prevent predicatablity. 


Get Lustrat Somnia

Leave a comment

Log in with itch.io to leave a comment.