This week was more random work! I did more audio, finished my Steam store page, and prepared all the levels for co-op play. Woohoo! Yesterday, I decided to poke around everyone’s favourite topic — please join me for one more ride on the magical replay unicorn!
In case you’re not interested, I’m peppering this long article with assets from this week.
Random Number Generation
Things were looking great the last time I worked on replays, but they were woefully un-tested. All that I knew for sure was that I could record a replay and play it back on the same computer. A better test would be to try playing it back on other computers — so I did that, and it worked great… until I tried playing it back on a Mac.
For a quick, simple refresher: a random number generator (RNG) is like a math formula. You give the formula a starting number, called a ‘seed’, and it spits out an endless series of random numbers for you! Since the numbers are being created by a math formula, though, starting with the same seed always produces the same series of numbers. So the RNG makes Bleed *seem* random, but if you were to play the exact same way, using the same seed, the random numbers would always be the same, making the game always play the same, making things like replays possible.
So. The PC version of Bleed 2 is made using XNA, which comes with an RNG built-in. My dirty Mac port was made using MonoGame, which has its own, different RNG. The RNGs are using different formulas, meaning the game behaves differently on each computer, breaking the replays.