Procedural City Generation

I had a project for one of my classes in school on maze generation algorithms. After finishing the project I did some further expanding on the algorithm to generate a city. The project allows the user to change various parameters about the generation such as city size, building minimum/maximum size, etc.

The algorithm I based my original maze off of was the Recursive Division algorithm. The Recursive Division algorithm creates mazes by dividing the area with a horizontal or vertical line and leaves an opening. It then divides the two resulting areas with a horizontal or verticle line and then repeats it until you are left with a maze. You can read more about the algorithm and many other maze algorithms here: http://www.astrolog.org/labyrnth/algrithm.htm

I tweaked the algorithm and had it generate rooms which I eventually turned into buildings for a 2D city. I had a lot of fun working on the project because I enjoy procedural generation. Looking back on the code now, I do see improvements that could be made (the whole algorithm is in one file).

I will just link to the file on github so the code can be seen easily: https://github.com/Dislecix/ProceduralCity/blob/master/GenerateMaze.cs

Here is the file that has a basic A* algorithm for enemy pathfinding as well as handling my “turn-based” game portion (do a ctrl+F and look for ASTAR): https://github.com/Dislecix/ProceduralCity/blob/master/GameMaster.cs