21 JAN 2023:
Just got back from my business trip last night!
Since I wasn't able to work on Scrapship, I spent some time learning more about QBASIC and basic computer concepts, especially how "Random" Number Generators work. Why is "Random" in quotes? Because computers are actually just using PSEUDO-Random Number Generators -- run any RNG long enough and you'll start to see little patterns here and there.
In a nutshell, most RNG programs take a Real World value, like time and then perform an operation against it to generate a random number.
This ties into Scrapship since the game makes heavy use of "random" numbers. As I soon found out, not all "random" number generators are equal! In some cases you might even be better off writing your own!
What you see above is called a RANDOGRAM or a histogram that tracks random numbers. This is a visualization I made to see how the QB64 RNG looks like.
It has a nice "random" static look to it and the colors are almost equally distributed. 32,000 instances of each color (red, blue, green, purple).
Now if we applied this to Scrapship, that would mean that if I spawned 4 types of enemies, the spawn-order would have a lot of variance, but ultimately each type of enemy (e.g. shield fighter, bomber, cruiser, battleship) would spawn about the same number of times. If you wanted an output that was more irregular you'd have to tweak the original RNG or make your own.
I had mentioned earlier how I had been reading about Procedural Generation in game design. That, coupled with my experiments in RNG led me to try creating random maps -- possibly for a future game???
Below you can see my early attempt at procedural map generation:
It looks pretty good -- but there are still some straight lines that are a little too obvious.
When I tried to do this with the built-in RNG from QB64, it looked awful because -- as mentioned before -- it tends to distribute evenly. You can render a thousand randograms and you'll almost never see "slabs" of similar colors next to each other. So if you want to make a continent made out of pixels, you got to be creative.
If you're interested in Random Number Generation I highly suggest this website that has some excellent articles to read and tech demos to try out!
QUOTE OF THE WEEK:
"Timing, perseverance, and ten years of trying will eventually make you look like an overnight success." -- Biz Stone
Thanks for reading and have a great rest of your week!