Skip to content

Project Sprawl Design Document

Rhys edited this page May 21, 2021 · 3 revisions

"Project Sprawl" is the name given to the redesign of Eigengrau's Generator. This document assumes only a passing knowledge of Eigengrau's Generator.


Quick links


Overview

Project Sprawl is a fully-featured town generator for use in TTRPGs such as Dungeons and Dragons, creating towns and their inhabitants, in a "ready to read" format- instead of "Blacksmith: untidy", it makes use of modern technologies and extensive dictionaries to create syntactically valid prose for the Dungeon Master to read out to players. It is different to other town generators in that it generates an entire contiguous town, with NPCs referencing one another, with complex webs of relationships, as well as the sociopolitics and geography of the town impacting what is generated.

Context

Difference between Project Sprawl and Eigengrau's Generator

Apart from the rebrand, Project Sprawl will be a separate repository, and feature several features such as user accounts, shareable links to generated towns, and a modern development stack. The benefits of shifting to a modern infrastructure cannot be overstated; it's long overdue.

Reason for Project Sprawl

The framework of Eigengrau’s Generator, Twine, is built for interactive fiction rather than massive data-driven projects. It stores all of the town data (which is several thousand lines long) in its memory, making the app slow down as more NPCs are generated. There are several other issues with the Twine architecture which make it a poor choice for such a large application:

  • There is no database or authentication service in Eigengrau's Generator, which makes it difficult for users to keep saves.
  • There is no way to link to specific buildings or NPCs in Eigengrau's Generator; you can only share the URL with the seed (technically feasible, but a massive pain).
  • There is no way to share customised towns in Eigengrau's Generator via URL.
  • There is no way to create NPCs that are not from the town in Eigengrau's Generator (feasible, but a pain).
  • There is currently no way to open multiple tabs of the same town in Eigengrau's Generator.

Core "Gameplay" Loop

The User loads the website, which automatically generates a Town for the User; if a Seed was provided in the URL, then it uses that- otherwise, it generates a seed to use for PRNG. They are presented with a brief overview of the town, as well as its political system and racial demographics, and are presented with a list of the buildings that have been generated. The Players drive the story forward, and will presumably ask for either something specific, or an overview of what they encounter; if something does not fit (a church in a world without religion, for example), the User can simply omit it from their narration.

The User navigates to the buildings that the Players are interested in, and is presented with the overview of the building. They can then read out the content as they see fit; parts can be omitted freely, without disruption. If the User requires more in-depth information about an NPC, they can navigate to the NPC's "profile", which has roleplaying tips, physical characteristics, their financial situation, backstory, and relationships. Think of the navigation as similar to Wikipedia, in a sense that the content is all presented as factual, with plenty of hyperlinks and popups adding more context where needed.

Editing

The User may decide that the Output generated does not quite fit what is needed; if so, they can simply hover over the attributes which they wish to change, and the text then changes to the appropriate input type; constrained types (biomes being arid, tropical, temperate, or polar) are presented as dropdown menus, integers are presented as sliders, and so on, with a "reset" button on the left, and a "save" button on the right; clicking outside of the focused element discards the changes made.

This "edited" town now diverges from the seed, though; it exists in the local storage, and the User can navigate back to the URL on the same device to see the changes, but if someone else were to navigate to the same url, the changes the User made would not be evident on another device. These changes can only be "backed up" to the database with an active Patreon subscription.

Database

The database will store user preferences, as well as the customised towns, if the user is a Patreon subscriber- preferably just storing the values that were modified, hydrating the rest of the object on load.

Minimum Viable Product

The minimum viable product should feature the following:

Town

  • Population: random integer
  • Name: random string (there's a town name generator in the Eigengrau's Generator codebase)
  • Biome: random constrained type 'arid' | 'temperate' | 'polar' | 'tropical'

NPC

  • Name: string
  • Gender: 'male' | 'female' | 'nonbinary'
  • Race: 'human' | 'elf' | 'dwarf'
  • Profession: 'bartener' | 'merchant' | 'farmer'

Professions

Three different professions: bartender, merchant, and farmer, with support values that change based on the biome; in polar biomes, farmer SV is raised, and merchant SV is lowered.

Buildings

Three different buildings: tavern, farmhouse, market, each with the following:

  • Name: string
  • cleanliness: 'disgusting' | 'dirty' | 'average' | 'clean' | 'spotless'
  • roll: { cleanliness: number between 1-100 }

With the cleanliness being derived from the roll.cleanliness, with < 20 being dirty and > 80 being spotless.

Generation

The Generator uses PRNG to determine everything, stemming from the seed provided in the URL. The town is generated first, with the name, biome, and physical characteristics, followed by the population. Population-level things such as racial demographics and religious demographics are then generated.

Then, from these physical and societal level attributes, a workforce is derived; using the support values, it is populated with the appropriate professions. If those professions happen to have buildings attached to them (you can't have a butcher without a butcher's shop, or a bartender without a bar!), then the corresponding buildings are then generated.