Paganini wrote:
I think your cave semigraphics look really good. Is that a randomly generated dungeon, or did you hand-make it?
Thank you, my wife really likes them too
Randomly generated. It's actually a true 'random walk' and your character starts at the beginning and the stairs are at the end. After it digs out some set amount of blocks, it stops wherever it is, thus you are always able to reach the stairs.
It was actually tricky to get a better randomizer. My 'random number generator' was simply: Current = 5 * Previous + 17. I had been using that forever, running it while waiting for keyboard presses and stuff to make it more randomized. But I was noticing that it would leave certain patterns that were previously unseen because I had just not used the code in some particular way that would show that.
Next I used the T2 timer on the VIA. I had previously wanted to use it for sound capability, but I was mistaken about high and low bytes. So, I figured using it as a random number generator was a good idea, as I heard about it from Garth at some point. But then I saw a new problem arise: Because I would call random numbers back to back sometimes, it would always give very particular patterns as well. It was always X cycles between calls, thus it was always Y amount different, and so it wasn't really worked out again.
In the end I combined both of the procedures together. I think it's now: Current = 5 * Previous + 17 + T2_Timer. And that works really well actually, have had no visible repeating patterns or anything. I used to do a lot of ROL A's to get "more randomized" values, but I don't even see the need for that anymore really.
Anyways, hope that little bit helps out the next guy wanting some random numbers. Thanks for asking Nathan
Chad