Sign in to follow this  
Tereth

Town Generation

Recommended Posts

Tereth    183

I am having trouble making a suitable Town Generating Algorithm.  I'm making a dungeon crawler/survival game in which the player encounters towns along their journey that are built on the pseudo-randomly generated maps.  It get's pretty boring when every town has the same basic pattern as well, it doesn't reflect the different cultures in the game.  I've looked at some materials on random town generation and I've been extremely underwhelmed.  That's probably because I don't know where to look.  Can anyone point me to some good resources or have any advice on this topic?

Share this post


Link to post
Share on other sites
ryutenchi    353

What style are you looking for? I would probably start by generating the street layout and then placing buildings based on plot size... I don't know of many articles though... read a few a while ago and will look around for them, but in the meantime maybe that will be a helpful starting point^^;

Share this post


Link to post
Share on other sites
Tereth    183

@Ryutenchi: I appreciate the response and the idea.  That's a lot of what I have seen in my search.  I was looking for more complex city types.I'm basically looking for a modular city/town planning algorithm that can express the different cultures of the game just by adjusting the parameters.  In fact, most of my game works off of the same principle for dungeon generation, character generation and biome creation, however, making a city/town, I have found is very tricky.  For example, I want to make a tribal faction's cities look disorganized, but yet in clusters of families.  Whereas, I want more civilized factions to have cities that are more organized, with zoning and must more of the grid-like organization.  As well, much of the towns encountered are not huge metropolises, but rather hamlets of ranging from 10-50 people and I would like to have each one, even if they are apart of the same faction, look and feel like a unique settlement.

 

@Alvaro


The general idea (my contribution) is pretty simple. You start with a pseudo-randomly generated terrain, which is something like a noise function which can be sampled anywhere, a polygon on the ground and a number to be used as the [64-bit or 128-bit] seed for pseudo-random numbers. The task is "build a city on this polygon". A few random points inside the polygon are chosen as important squares, joined by avenues, and the resulting polygons surrounded by avenues are neighborhoods. Now the problem is reduced to several instances of "build a neighborhood on this polygon". Each neighborhood gets its own seed as well (and this is important). Neighborhoods are similarly divided into city sections, sections into blocks, blocks into plots and plots into buildings (or parks). Only two types of building were implemented in Descensor (a tower block and a traditional building around a patio, which shows up in many cultures). You can keep decomposing design problems into subproblems until the problem is simple enough that you can just write down the geometry ("build a wall here", or "build a flight of stairs there").

One neat thing about this way of proceeding is that the whole scene can be seen as a tree and can be generated dynamically when needed. Since every node in the tree has its own seed, you can forget about some part of the tree and regenerate it when needed. With a culling algorithm you only need to generate the parts of the city that you can see from where the camera is standing (so if there is a neighborhood entirely outside the view frustum you don't generate it at all).

 

This is such a cool idea!  I wish I could give you 20 thumbs up!  I could definitely use something like this for larger towns.  For the past few hours, I have been trying to see if I can use graph theory to build a minimum spanning tree between nodes in the city to develop the central paths of the town and then radiate paths from the central tree for peripheral homes.  The nodes being key points in the town's economy (i.e. farms, mine, place of government), which I would place according the the culture/economic focus of the town.  Let's see if this works out.

 

I may PM you at a later time about the referenced idea, if you don't mind.  I really appreciate your response!

 

Also, I am still open to more ideas!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this