In Ukraine, there is such an interesting thing as the Small Academy of Sciences. In general, this is something like a competition of projects for students in schools. Quite interesting projects come across, and I will tell you about one now.

This project is mine, casually reminded of itself while ordering in the bookcase. His theme, then, 5 years ago, seemed awfully cool and sounded like this: "Methods for generating game cards." Slightly above is an example of what I did. As you can see, these are examples of the levels of some kind of non-existent game, stylized as
bagel . But first things first.
')
All this work was written in an old Dev-C ++ version 4.9. In general, at that time I did not even know how to use anything. I did not recognize Visual Studio, as it was cumbersome, and created a bunch of some files, and C ++ Builder was unusual with a bunch of open windows. QuickCG was used as the graphics rendering magic. A very simple library - an SDL interlayer - which a very, probably intelligent person wrote for pixel by pixel output. To create old-school effects: fire on the floor of the screen, tunnel effect, raycasting, etc. By the way, I still don’t know better how to build a bunch of Dev-C ++ and QuickCQ in order to learn how to work with graphics.
The program allows you to make landscapes and levels, although they were limited to the size of the window. If you believe the description of the project, which was supposed to be as large as possible, and the oceans of water flowed in there, then the maps are divided into global, local, and special. And of course my art was able to do all this.
I divided all the ways of creating global maps into 3 types: recursion, fractals and heights. It should be immediately clarified that the third group included methods using noise, or some two-dimensional functions. Though I understood what recursion is, I didn’t know how to use it properly, I couldn’t even talk about fractals, so the generator could only make cards based on the
noise of the pearl . Naturally, then I did not understand any formulas, and therefore the implementation was taken from the QuickCG site, where clouds were made this way.

The algorithm was simple: first generated noise. It turned out a dull gray picture. If bored and gray - then you need to paint. Color is added. For this, the brightness of the noise is declared as the height, and a pixel is colored depending on the height. For a while, I thought to add the level of sand - but it didn't turn out very well. Total as a result, there were 4 biomes: water, grass, mountains and snow.

Then objects were added, namely trees, cities and rivers. Everything is simple with trees: we take a random point on the grass and plant a tree there. On the map, they are indicated by dark green dots. Then the city. They were made just like trees, but could be located near the water, and sometimes on the grass and in the mountains. They were denoted by brown circles.

With the rivers, everything was not much more complicated. A point is selected on the map, above sea level, and the cycle goes down until it falls into the water, or it has nowhere to go. In the latter case, a lake is drawn around this point.
This is where the capabilities of the global map generator ended. Go ahead. Maps of the area I divided into 3 types: forests, ponds and cities.

The forests, by default, littered the leaves, and then the trees, consisting of a crown, a diamond shape, and a brown stick, piercing the crown, were added, so that the player would not pass through the trees. You may have noticed the "@" icon in the pictures - this is the player. And they could be controlled.

To create a river, a point was selected at the edge of the map, water was created to the right and to the left of it, and a cheerful stream pushed the way to the opposite side of the window, constantly moving either to the right or left or not moving. For the exterior was added a house, a couple of trees and a couple of residents. The house was a rectangle of random size, decorated in 2 colors, imitating the tiles illuminated and not illuminated by the sun.

And finally, the town. First, the whole city is overgrown with tiles. Then rush from the sky at home. If a house breaks through another house, then it doesn't matter, let's call it such an architecture. After homeopad residents come to the city. They get on the place free from the houses and wait. And they are waiting for the most important thing, without which the city cannot exist, namely the water delivery system. In this case, it is represented by a well, which could appear both on the main square and in the place closed by houses.
And finally there were special maps to which I assigned special zones, such as dungeons, caves and labyrinths.

Let's start with the simplest. From the very beginning, the caves are filled with impassable rock. In the center we put the void and move in some direction. For example, to the right. Then we move up. Then somewhere else. And so once under 100. And then we become the center and start all over again. Through iterations 20-30 we get a cave.

Further there will be dungeons. They, too, are filled with impassable rock, in which rectangular rooms are carved. The walls of the room in random places collapse. If suddenly a room appears in the middle of another room - it doesn't matter - we will write off the architecture feature.

And finally, the labyrinth. There are many cases of labyrinth generation:
recursion ,
dye, prima ,
neural network . In my case, the recursive method was used, which was steeped from the depths of the Internet. We choose a point, we choose a direction - we go, we choose a direction - we go, we cannot go - we go back. It is easy, but it took me a long time to understand how it works.
In general, the projector did not know how. He did not save the maps, he could not render them in bmp., He could only generate maps and immediately show them. Not much, of course, but for me, that time was something. Here it was for some time passion. And then a Doom-type raycasting appeared with fermentation through the maze, then the generator began to show in 3d and other dimensions. But about this somehow another time.
That's all. Thanks for attention. Live and prosper.
PS Hi lyceum!