gomeler / LocationGenerator

Simple exercise in Go that generates locations for tabletop RPGs.
0 stars 0 forks source link

Add population system to location spawning #14

Closed gomeler closed 5 years ago

gomeler commented 5 years ago

This is related to a bunch of other issues, primarily #2, #3, and #6. When a location(farm/hamlet/town/city) spawns, we'll select from a range the population size and also select a population growth modifier. The former will relate in some way to the number of buildings created, chicken/egg problem for now. The latter will be used to age the towns with events like drought or trade caravans impacting the growth of the town.

To create semi-realistic towns we won't have every citizen be a fleshed out NPC using the character generation system. I think each business should have a min(1) and max(?) number of NPCs, and an undetermined range of non-NPC citizens manning it. I think a mixture of the population growth modifier and population count will be used to determine this NPC ratio, with smaller locations more predisposed to having more NPCs. Makes sense that a hamlet might have 10 NPCs and 200 non-NPCs, while a city might have 50 NPCs and 12,000 non-NPCs.

Reading a little bit about medieval/non-modern towns worked, a lot of businesses were a combined business/house. I think some businesses won't feature any housing, but other businesses might have optional group housing for the workers and housing for the business owner. Otherwise perhaps assign the NPCs housing in the town?

gomeler commented 5 years ago

Sorted this out with patch 6f027b9509672cc2954475906e07cd7535570a01. Buildings now have an option to be populated via the populateBuilding function and the associated sub-funcs. Eventually there'll be options for abandoned structures and abandoned towns, so having populateBuilding be separate from the spawning of a location/buildings made sense.