At this point I'm basically just plugging random numbers and functions into the formulas.
I guess the next logical step is to randomize everything.
Edited March 19th
Randomized the parameters of the function. This is creating all kinds of crazy stuff now:
Posted March 19th
Well, I've achieved my goal. I have absolutely no idea what to expect from the terrain generation now.
Edited March 19th
I can just barely make out the expression on the bottom of the pictures. Can you explain in some detail what determines the color of each cell?
I'll try to explain how the generation is done in the bottom three replies, since that does seem to be the most interesting and varied algorithm at the moment (though I'm working on the other ones too sooo)
Each "dimension" is assigned 3 colors, or sometimes it gets 5-7 or 4 grayscale colors. Whatever amount of colors it has forms the dimension's "palette".
You'll also occasionally get colors outside the pallette -- these correspond to things you interact with in-game.
!!=cyan RNG Seeding
I have a function that I'll call the "seeding function" from now on. You pass it a list of numbers and it does this:
** Start with the "universe seed" (some number from 1-99999999, or some other large amount of digits, I forget what).
** For each number in the list, multiply it by a unique number (right now I'm just using 7,11,13,9,19,23) , and then add this to the seed.
** Take this number, raise it to the seventh power.
** Modulo this by 19650218.
** Seed the mersenne twister with this number.
!!=ruby Basic terrain generation
Each cell has an X and Y coordinate, as well as a "dimension number". These get passed in a list to the seed function. Then some random numbers are generated to tell which color is generated in the cell.
This gives you some basic terrain:
As you move around, more cells get rendered. Despite how complex the code has gotten and despite the twister being reseeded 441 times per screen, this generation is extremely fast and I've been able to build some tools to zoom around each dimension without any lag whatsoever.
!!=sapphire More interesting terrain
** Pick a number of times to pick a variable -- right now I've got this set to between 5-7 times.
** A variable can be X, Y, X+Y, X-Y, any of those four things modulo a number from 10-100, or a number from 1-30.
** Each variable has an "effect mix" which is somewhere between 50-100% (it favors 100%). An effect mix just makes the cool generation happen that much of the time, and the really random (in the pic above) generation happen the rest of the time. It adds a bit of noise to the generation.
** If the variable is X, Y, X+Y, X-Y or one of those modulo something (like X%75), the variable is based on the X and Y coordinate of the cell.
** These numeric variables (and their effect percentages) go into a different function:
!!=gold Sculpting function
** The sculpting function takes each number in the list in turn and turns it into a "size" variable. It then modulos the x and y coordinate by size*2, and if that modulo is bigger than the size variable, it stops the loop. If it doesn't stop the loop, it plugs the size variable into the next stage of the sculpting function. So depending on the x/y coordinate you get some variable amount of sculpting.
** The next stage takes each size variable, and does the seeding function on the dimension and (x/size)*(y/size). Basically it takes the random generation and scales it up, assigning size number of cells to each cell in the original generation.
** After all of this is done, there are some secondary effects, like generating "rocks" some random number of cells (sometimes big, sometimes tiny). With the blown up cells you end up getting "pipes" when the colors don't match up.
Since the "size" here is variable, sometimes depends on the x and y themselves, and happens a variable number of times, the generation can vary a lot depending on what those original 5-7 variables are. I guess tl;dr I have no idea how it works either.
Here's some more interesting things I've found:
Posted March 20th
Panorama shot because this place is just cool:
Posted March 20th
I am very interested in terrain generation but I have no idea how what you’re showing here works. It looks cool, though. But I wish I could figure out how to use it or learn from it to make my own cool-looking stuff.
If you're trying to do something conworlds-based, you might be interested in this portfolio project I finished up recently:
Uses a very different set of algorithms, which are explained in some detail in these files:
Thanks, @Xhin: !
I’ll look into them.
I tried it out several times. Not sure yet.