#include <settlement.h>
Public Member Functions | |
Settlement (int chunk_x, int chunk_y, int _height, int _width) | |
void | settlement_from_bst (BSpaceTree &bst) |
void | blocks_from_bst (BSpaceTree &bst) |
std::vector< Block > & | get_blocks () |
Private Attributes | |
IntPoint | chunk |
int | height |
int | width |
int | population |
std::vector< Block > | blocks |
bool | walled |
int | age |
int | developments |
int | num_focals |
std::vector< IntPoint > | centers |
int | agriculture |
bool | feudal |
bool | planned |
std::vector< Tile > | building_mats |
The class to hold cities, towns and villages. The metric for determing cities is as follows: Big Cities = 12,000-100,000 people, rarely exceeding 50,000. Cities = 8,000-12,000 people. Towns = 1,000-8,000 people. Villages = 20-1,000 people. Isolated dwellings = >20 people. These will be generated in order of size to fill the population of a nation. The more rural settlements will make up the majority of the population (villages and isolated settlements), with ~3% of the population existing in urbanized locations.
The layout of the settlement will also vary based on the size of the settlement, the age of the settlement, and the age of the nation. Older nations (that have moved into feudalism) will tend to have a high number of planned settlements (mostly towns), which means straight streets. There will also exist unplanned cities which are based around a single structure, usually monastic or clerical, but occasionally secular.
The majority of towns, villages and isolated settlements will lie along the trade routes between cities (the roads which join the cities). Villages and small settlements are more likely to be "off the beaten paht", while towns are more likely to exist along well travelled roads or useful landmarks which may include rivers or mines.
Towns and cities will likely be walled, depending on the level of threat . If there is a threat nearby, then it is likely that the city will be contained within the walls. It is also possible that the walls have been expanded several times in order to accomodate growth. This is largely dependent on the age of the settlement and the location.
Settlement::Settlement | ( | int | chunk_x, |
int | chunk_y, | ||
int | _height, | ||
int | _width | ||
) |
The constructor for settlements. As with buildings, I'm going to end up coding it in a series of refinements by getting a simple working version and then adding complexity as I go. In the first draft, most* of the variables will not be used.
void Settlement::blocks_from_bst | ( | BSpaceTree & | bst | ) |
Creates city blocks from a binary space partition.
void Settlement::settlement_from_bst | ( | BSpaceTree & | bst | ) |
Makes a settlement out of a binary space partition.
|
private |
The age of the settlement.
|
private |
The governing figure of the town. This figure may answer to someone higher, but that's not necessary to know for the purpose of generation. This may also be NULL, which indicates that the town is self-governing. The ruling figure helps to dictate the organization of the town as well as the presence of a larger structure like a castle or palace. The larger the settlement, the less likely it is that it will be self governing.
The percentage of occupants of the settlement involved in agriculture. This will effect the layout of the settlement. Larger settlements generally mean less agriculture. The smallest settlements (villages and isolated settlements) will be almost exculsively agricultural.
|
private |
The city blocks which are present. These also contain the houses.
|
private |
The potential materials available to make buildings. This represents the materials which can be used to create buildings. This is subject to change over time. It is determined by the technical ability of the city and nation, and determines how high buildings can be built. Also has an influence on the rate of fires in a town.
|
private |
The point(s) from which the settlement was built. This is primarily for settlements which were not planned. Planned settlements will most likely conform to a linear, parallel street plan which does not necessarily have a center. Centers may be buildings or landmarks, like rivers or defensible hilltops.
|
private |
The chunk that the settlement's top left corner is in. For now the top left corner will just be at (0, 0) of the chunk.
|
private |
The number of stages of developments the town has undergone. This will manifest as different sections of walls if the city has walls, or a different pattern of building if it does not. This is primarily determined by the age of the city.
|
private |
Whether or not the settlement is based in feudalism. If the settlement is feudally based, then it is not truly a town, village, or city. Rather it has essentially become a massive plantation where each tenant is given a plot of land where a large percentage of the food is taken from them. It will look like a series of farm plots with incredibly impoverished tenants. Cities and towns were effectivley the next step after feudalism, and as such the older the nation, the fewer feudal settlements there will be.
|
private |
The size of the city, in terms of number of tiles. Will eventually be determined by the number of buildings, which is in turn determined by the number of people. For now, I'll just assigned it a size.
|
private |
The number of centerpoints that the settlement has. Occasionally, two towns would run into each other, or one town would "split." This would create binary towns, and theoretically tertiary towns could exist. This ends up looking like a town in the process of mitosis with two very clear centers.
|
private |
Whether or not the settlement was deliberately planned. This will actually be the primary influence. The older the civilization, the more planned cities there will be. These will almost always have a ruler, and will typically have less of a center. Planned towns will also have more parallel streets. However, there will still be an element of chaos, more so the older the town is and the more developments which have been added.
|
private |
The number of people currently living in the settlement.
|
private |
Whether or not the settlement has walls.