World generation

uses procedural generation to create much of its content each playthrough. While a few of the main quest locations are pre-determined or pre-built, such as, most of the rest of the world is largely procedurally generated. Even many main quest dungeons and guaranteed settlements tend to include a large element of procedural generation. For example, the shops and merchants surrounding the Six Day Stilt, in the, will be procedurally generated during each playthrough, and much of the interior structures of and the  are also procedurally generated.

History
A core component of world generation is the history of the sultans. Related to the sultan history are the underlying types of government, historic sites, villages, and other locations.

The history of the sultans will always include 5 initial periods of sultan rule, involving 5 procedurally generated sultans. Those sultans' names, events from their lives, bits of lore that recount those events, and recurring sultan themes that are relevant to each sultan will all be procedurally generated.

The sixth sultan is Resheph - a guaranteed sultan who appears in every playthrough and always has the same fixed events described in his lore.

Regions and Locations
The world generation process creates a variety of named regions and locations that correlate to the five periods of sultan rule. During each period, a handful of additional regions and locations are added to the history, increasing the overall size of the historic region and location pool. After the regions and locations are generated for a particular period of the sultanate, the sultan history for that period is generated, using those regions and locations (along with any regions and locations from previous sultanates) as context.

Significant events in each sultan's life that involve named regions or locations will always occur in regions or locations that have been generated as part of the history thus far. For example, a 2nd period sultan will have a minimum of 4-6 regions and 11-18 locations available for possible inclusion in their lore. A 5th period sultan will have the greatest number of regions and locations available for potential inclusion in their lore (a minimum of 10-15 regions and 20-30 locations).

In addition to the core regions and locations created as part of initial world generation, sultans can also discover or build new locations (within existing regions), or rename existing locations, during significant events in their lives. Those locations are then added to the pool of available locations in the world from that point forward.

Ultimately, most of the regions and locations that are generated as part of the world history will not be accessible in game. Each region, however, will be mentioned at least once in the corresponding sultan's history from that period. For example, the sultan may have "travelled through" the region as part of one of their notable life events. Locations, on the other hand, may not be referenced anywhere in game or in any sultan histories.

The one notable exception is historic sites, as described below.

Historic Sites
The sultans from period 4 and period 5 are unique because they will each have two procedurally generated historic sites associated with them. These historic sites will always be chosen from among the 2-3 historical regions that were added to the generated world history during those sultan's reign. Regions from earlier parts of the generated history won't be used for this purpose.

The historic sites will be inhabited by sultan cults composed of members from the sultans' favored factions. The sultans' favored factions can generally be observed from the various bits of lore that describe events in the sultans' lives. For example, this snippet of sultan lore indicates that crabs are one of the sultan's favored factions:

Historic site generation is controlled both by features from the broader generated world, such as the government type, and by features from their associated sultan, such as the sultan's themes.