A comment to my previous blog entry was pretty right on the nose: Stream of consciousness. I do that a lot, thinking as I write and ending up writing my thoughts down more or less as they come to me. I'll try something else this time around, but do go to that entry and see if my thoughts don't happen to align a little with yours. Also, I'm still running a test there, so... can you stand not knowing what kind of test it is? Just asking...
But more constructively: I'm trying to use science to recreate entire universes inside of computers. I work a lot with math, even outside of programming (I teach mathematics), and over the last half to whole decade, I've become rather angry about a certain topic. That topic is procedural generation. Now, I'm not angry that people use it. In fact, it bothers me more when commenters and such start ranting against PG as if "oh, it can't create anything truly interesting *insert arrogant cackle*". Let me make this clear: PG can create anything a person can create. Wanna know why? Because a person created the PG. If you wanted, you can create something cool and then reverse engineer it to make it PG. Design a cool storyline with cool characters inside a really cleverly designed space station or dungeon or city or whatever? Take each piece of it and create alternative pieces that could function in their place just as well. Pick a differently designed gun, a different height of scenary to be traversed, etc., and let the game pick which variation it uses every time. Voila, procedurally generated game, equal to what you could make n your own, because you made it. If PG creates something crappy, it's not because it's PG, it's because the person using it is not good at using PG. A painter has no right to blame the brush, a carpenter no right to blame the hammer.
What I suspect people actually mean is that PG does not create anything truly new. It just takes bits and pieces that humans made and shuffle them together in new ways. And for games like No Man's Sky, Spelunky, and others, that's true. But that's because their PG was designed that way. It's a testimony to humanity's desperate craving for control over its creations, and their resulting stiffling of creativity. We don't want games to create something really new and weird, we want them to create the things we imagined, but to do the work of making it for us. PG is not a creative tool, it's a shortcut. Hollywood would be proud of us wanting to cash in on mixing the same elements again and again and presenting them as something new.
I, on the other hand, am a card-carrying lunatic. I want madness, chaos, and unexpected results. But the First Rule of Procedural Generation is "Never go full random". Truly random results are nothing but meaningless chaos. It's the game equivalent of TV screen static (something that so many young people have never really seen, I suddenly realize. If that's you, google it, and behold the world of the past). So I must decide on what chaos to kill and what chaos to nurture. I make those decisions with my trusty sidekick, SCIENCE! (biatch)
That there is an image of my universe during a test. I start with random dots of light, then place invisible points that attract them based on proximity. It's an older version. A slightly newer version is this, a universe screenshot from 9 random angles:
Each dot is a 'hypercluster', millions of galaxies seen from such a distance that they resemble just one dot. More up close and personal, the early test galaxies (colorcoded for testing) look like this:
These pictures are from different versions of the program, hence the sudden appearance of a HUD. Other versions have the actual stars and planets, but that is where a lot of my problems currently arise.
See, the big problem is not how to create the PG mechanisms to build an entire universe. I did this stuff in little over a month, on the side. No, the problem is how little things grow out of proportion. How a slight rounding of a tiny, tiny number can escalate and throw everything out of whack. Right now, I am rewriting everything to deal, again, with a way that double-precision floating number decimals (a.k.a. 'doubles') are handled in C++, my programming language of choice. The entire core of the matter is that detail is added along the way, based on some complex math (although the math I test it with is a much simpler, boiled down version of that, or madness would ensue). Here is a less realistic screenshot to exemplify that:
One triangle polygon gets created, and as you approach it, it tesselates, breaking into smaller and smaller parts, for added detail (no detail added here, just the basic tesselation). What happens when something gets rounded just a little bit wrong? Things jump around, that's what! Suddenly, the new, smaller polygons do not line up. And then the next rounding problem makes them act even worse, and so on, until everything goes everywhere. This is my battle. This is the saddening fact of creating a huge universe to fit inside a simple laptop: Your entire work hangs on a few numbers being rounded off. I never had the "three days of work to find a 1 should be a 0", but I did almost have "two days of work to find a 2 should be a 4", so I feel like it counts.
But when it finally succeeds, I intend to reap the whirlwind. Not only can this create a universe of infinite (truly infinite, not this "very big number" hogwash) content, but it can make things in every size. And I mean every size, from subatomic machinery to monsters eating up galaxies (or something less insane, like the kaiju-like creatures of Shadow of the Colossus). The code doesn't care, it just puts in dots and polygons.
And with that level of flexibility, SCIENCE! (biatch) can make its mark on it. PG is not just "take these 18 modular pieces and slap them together randomly, over and over again". Algorithms exist for basic artificial life, for geological processes, for atmospheric phenomena, for stellar debris, for the spread of cultures and technologies, and for more. We are still living in the "I must control my assetts" era, but only because people use that mindset when handling PG. If you give in, chaos may give you more than that. Only you are no longer fully in charge.
All of that hinges on the rounding of small numbers. Ever wonder if even God knows the last digit of Pi??
And today's challenge to you: Write something in the comments that you do not believe procedural generation could ever create, and I will try(!!) to argue you wrong. No exact results ("PG could never recreate Legend of Mario: Vorpal Kombat level 31!"), but things that you might see, or want to see, in a game. Don't worry, I'll be gentle with you!
Please be gentle, please be gentle... hahaha.
I liked your little blog. I think the most likely problem you'll encounter is generating content that is meaningful to the end user and most importantly, assuming it's a game, fun. One idea I had reading your post is I wonder whether or not you could write a complementary AI which could 'refine' the variables so to say, so as to speed up the process of taking the universe-builds out of the realm of meaningless chaos into one that is familiar.
I likes I likes, I want your universe to generate a bottle of red wine!