Placing and sizing cities in an infinite world

In my first post on this topic, I introduced the idea of ontogenetic generation. In this post, I want to explore some of the ideas I have had for being able to produce cities in a procedural world.

There are a few resources I have found online which discuss the generation of procedurally generated cities but I haven't seen anything which discusses how you might place them in an infinite procedurally generated world like Minecraft.
In my research into producing cities in the context of civilisations, I spent a lot of time looking into the way that the settlements in Dwarf Fortress are produced.  I found it surprising how little information there is about how settlements arise in the game. All of the interviews seem to focus on the terrain generation which is comprehensive. The more I have read about the systems used in the game the more interested I have become.

First idea
When thinking over the topic of how one might generate integrated city structures in a manner that would allow for loading the location ontogenically, the first idea I came up with is similar to where one might start when trying to create procedural terrain generation, with sin waves. The idea which is represented one-dimensionally in the graph below shows a single large "capital" with smaller settlements propagating out around it.
Across a single dimention
Expanded across a landscape
A topside view of this expanded across a landscape

The idea was spurred from one of the videos I mentioned in the last post about how the structure of cities forms. In the graph each peak represents a settlement, the amplitude of the peak represents the size of the settlement. A core element to the idea here is that the algorithm can know using only a local search around the position to be loaded if it is at a peak and therefore if a settlement should be spawned.
One of the problems is that the location of the capital would always need to be known. A problem which I only thought of a solution after being inspired by the layering approach Dwarf Fortress uses in its terrain generation.

In Dwarf Fortress the simulation of the world, I think both in the generation and as time propagates in the game, is done at different resolutions.
It might be that the world is broken into and NxN block for weather simulation and simulating what biome each bock is. These cells are then further subdivided into MxM blocks to simulate the waterways.

Using this method and a fixed size of the capital city you would be able to know if there was a capital in the current region, which would be large enough to solve the problem.

I felt that this solution lacked the ability to have arbitrarily large cites in the game. Given that in an infinite map, or at least a map limited only by the precision of the numeric representation of its coordinate system, I think it would be reasonable that the maximum size of a settlement should be unlimited.  

Second idea

This second idea does require some processing, however, the amount of processing is proportional to the size of the settlement.

The idea starts with a regular distribution of settlements, which could be as simple as placing them randomly or could be more complicated in having them placed more frequently in more favourable geographies.


The local chunks are then aggregated so that regions surrounding settlements have the perceived impact of being around a settlement.
This is then run again which in places causes the shape of cities as well as their density. This could be scaled to create small settlements up to any sized city. Albeit with very large cities being smaller.

In this example, the locally summing settlement flags are done for every location but it could be done only surrounding the loaded chunk in such a way that its value could be calculated.








Comments

Popular posts from this blog

Structural engineering with cardboard

The twelve fold way