Skip to main content

Module game

Module game 

Source
Expand description

The gameplay resources: terrain and climate profiles, start conditions, the toolbar, entity templates and the descriptions of their components (buildings, citizens, animals, resources, fires and more).

Each resource has a struct and a reader function, for example ToolbarDescription and toolbar_description. The source is split into topic files (world, interface, entities, nature, particles, construction, goods, work, people and disasters), and everything is re-exported here, so every path is banished_formats::game::NAME.

Structs§

AnimalDescription
AnimalDescription (the idle time, is not stored and keeps the constructor’s 4).
BuildDescription
BuildDescription: what constructing a building costs.
CharacterDescription
A CharacterDescription: how a walking entity moves (its speeds and turning).
CitizenDescription
CitizenDescription. The class has ~60 scalar fields; they are kept keyed by their runtime offset (as the original code reads them) with named getters for the ones whose consumers are traced.
ClearAreaDescription
ClearAreaDescription (Template\X.rsc:cleararea).
ClimateGenerator
ClimateGenerator: monthly weather thresholds used by the environment loop.
ClimateHeader
The first fields of a ClimateGenerator (a climate profile of the New Game dialog): the string table, the name key and the “listed” flag. The climate values that follow are not decoded here.
ComponentDescription
An entity template (ComponentDescription): the scheduling bucket and the ordered component descriptions (model, naturalresource, growth, …).
ConsumeProduceDescription
ConsumeProduceDescription (Template\X.rsc:consumeproduce).
CreateBridgeDescription
CreateBridgeDescription: the bridge tool’s (BridgeTool) cell-type masks: the cells it spans (water), its banks, further cells drawn as valid, at least one spanned cell of these, the cells beside it within (its half width); the part templates (start, 1, 2, 4 and 8 cells long).
CreateDragDescription
CreateDragDescription (Template\X.rsc:createdrag).
CreateFencedDescription
CreateFencedDescription: the fenced tool’s (FencedTool) cell-type mask, its six part templates (shelter, end, corner, straight, long straight, gate), the largest, and smallest, size, the shelter centred on its side, and the template whose entities may stand in the way.
CreatePlacedDescription
CreatePlacedDescription: how a building is placed; the start structures take their size from it.
CreateRemovalDescription
CreateRemovalDescription (Template\ClearX.rsc:createremoval): what a RemovalTool drag does to each cell.
CreateRoadDescription
CreateRoadDescription: the road kind (0 stone, 1 dirt; a lower kind replaces a higher), the raw material a cell takes (none for dirt).
DecalDescription
DecalDescription: the terrain decal a DecalComponent puts over its entity’s map rectangle (Template\X.rsc:decal).
DestroyDescription
DestroyDescription: the template left in the building’s place once it is torn down (the quarry’s and mine’s hole; none for most), the ModelComponent’s material set while damaged, the decal while damaged, the lowest construction mesh a collapse steps down to.
Disease
Disease (version 2, Game/Disease/Diseases.rsc lists them).
DiseaseDescription
A DiseaseDescription: blight on fields, orchards and pastures. Times are in months of 300 seconds.
EnvironmentDescription
EnvironmentDescription: weather and monthly lighting.
EnvironmentMonth
One month of EnvironmentDescription lighting (32 bytes at + 0x20·month).
FireDescription
A FireDescription: how a fire burns, spreads and is put out.
FishingDescription
FishingDescription: the catch’s raw-material template, the cell types counted as fishing water and, from version 1, the stock-manager slot of its limit.
FloorDescription
FloorDescription: the picking mesh walked on, added on activation.
ForesterDescription
ForesterDescription: the tree template it plants and, from version 1, the stock-manager slot of its limit (logs, 0).
GrowthDescription
GrowthDescription. See GAME-LOOP-STEP-11/12 and RESOURCE-SEEDING.md for the consumers.
HappinessDescription
HappinessDescription.
HerbalistDescription
HerbalistDescription: the natural-resource templates a gatherer or herbalist harvests (count) and the stock-manager production group its limit is checked against (5 food, 6 herbs).
HerdDescription
HerdDescription.
HuntDescription
HuntDescription (versioned): the hunting time a kill needs (× 300 s of a full lodge’s work) and, from version 1, the stock slot of its limit.
ImmigrationDescription
An ImmigrationDescription: when nomads come to the town. Two values are not serialised: the month in which nomads leave (7) and the margin from the map’s edge (10).
InteractDescription
InteractDescription: the point list whose named points “use”, “build” and “create” become the three interaction categories.
LivestockDescription
LivestockDescription (versioned): the raw material a pasture gathers from the animal (none for cattle), every × 300 s, and from version 1 the stock slot.
MapDescription
MapDescription: how an entity stamps the gameplay map.
MapGenerator
MapGenerator: a New Game starting-condition profile. Field names follow their confirmed consumers; offsets are the in-memory record’s.
MarketDescription
MarketDescription: vendors stop while the market is fuller than threshold; the categories (raw-material flags) and each one’s share of the market’s room.
Merchant
A TradeDescription merchant (0x48 bytes): its name (string table, key), the templates it always offers (seeds, livestock), integers the game does not read, its lots before the town’s divisor, the raw-material flags it sells, and more flag masks.
ModelDescription
A ModelDescription: the meshes and materials an entity is drawn with.
ModelVariant
One model variant: an animation set and its alternative meshes.
NamedPoint
A named point of a Pathfinding::PointList (position in model space, yaw in degrees).
NaturalResourceDescription
NaturalResourceDescription. Field offsets are in the runtime object; see docs/RESOURCE-SEEDING.md and GAME-LOOP-STEP-14.md.
ParticleDescription
ParticleDescription: the entity’s particle systems, then one more reference.
ParticleSlot
One of a ParticleDescription’s systems (0x28 bytes).
ParticleSystem
A particle system: an emitter of quads that face the camera (smoke, fire, dust, snow). Times are in microseconds. See docs/PARTICLES.md.
PlacedStructure
A building placed relative to the start point of a new town.
PointList
Pathfinding::PointList: a mesh name, a second string, path points and named points.
PopulationDescription
PopulationDescription: the wildlife manager’s grid and the herds it starts.
ProduceRecipe
One production recipe of a ConsumeProduceDescription: what a workplace uses and what it makes.
Profession
Profession: a job citizens can be assigned to.
QuarryDescription
QuarryDescription: the pit the quarry digs, a picking mesh in model space whose vertices set the terrain, no lower than a floor that goes from shallow (when built) to deep (at the end of its production).
RawMaterialDescription
RawMaterialDescription: a storable resource.
ResidenceDescription
ResidenceDescription (version 2).
SpawnEntry
One SpawnDescription entry: a template spawned while the parent’s growth is in [lo, hi].
StatusIconDescription
StatusIconDescription: the icon sprite sheet, icon size and screen-constant flag. The height offset is not serialized and stays 1.0.
StorageDescription
StorageDescription.
TerraformDescription
TerraformDescription: a tunnel’s floor and ceiling picking meshes, each with the cell types its vertices may change.
TerrainGenerator
TerrainGenerator: a New Game terrain profile.
ToolbarDescription
A template’s toolbar component (ToolbarDescription): the icon, name and tooltip shown for build and utility entries, and its placement messages.
ToolbarItem
One entry of the in-game toolbar: a button or a sub-menu. The game builds each level of the toolbar from the entries whose parent matches, in the order of order.
TornadoParticle
The Tornado particle class (Graphics::Particle subclass): particles spiralling up a funnel. Colours are BGRA bytes, times System::Time microseconds. See docs/PARTICLES.md.
TradeDescription
A TradeDescription: the trading post’s boat, merchants and trade window.
TradeRow
A TradeDescription row by population (0x14 bytes): towns below population people see a merchant every (months + RandFloatTol × range) × 300 s, and divide the merchant’s lots and each lot’s amount.
UiController
One entry of a UIDescription controller table.
UiDescription
UIDescription: a utility window built from a host dialog with content placed into its named slots, each with an optional controller.
ValueDescription
A ValueDescription: what one unit of a good is worth in trade, and how it is shown.
WorkDescription
WorkDescription (Template\X.rsc:work).
WorkPlaceDescription
WorkPlaceDescription: the profession its workers take (none for storage barns and houses) and a second reference.

Enums§

Scalar
A value of the citizen description: a float or an integer.

Functions§

animal_description
Read a AnimalDescription from the bytes of its resource.
attendance_description
AttendanceDescription: the capacity (Chapel 200, DoctorHouse 30, SchoolHouse 20).
auto_pickup_description
AutoPickupDescription:, whether the workplace’s workers pick up the piles they make first.
build_description
Read a BuildDescription from the bytes of its resource.
cemetery_description
CemeteryDescription: the tombstone template.
character_description
Read a CharacterDescription from the bytes of its resource.
citizen_description
Read a CitizenDescription from the bytes of its resource.
clear_area_description
Read a ClearAreaDescription from the bytes of its resource.
climate_generator
Read a ClimateGenerator from the bytes of its resource.
climate_header
Read a ClimateHeader from the bytes of its resource.
component_description
Read a ComponentDescription from the bytes of its resource.
consume_produce_description
Read a ConsumeProduceDescription from the bytes of its resource.
create_bridge_description
Read a CreateBridgeDescription from the bytes of its resource.
create_drag_description
Read a CreateDragDescription from the bytes of its resource.
create_fenced_description
Read a CreateFencedDescription from the bytes of its resource.
create_placed_description
Read a CreatePlacedDescription from the bytes of its resource.
create_removal_description
Read a CreateRemovalDescription from the bytes of its resource.
create_road_description
Read a CreateRoadDescription from the bytes of its resource.
crop_field_description
CropFieldDescription (versioned): a tending visit’s growth and, from version 1, the stock slot.
decal_description
Read a DecalDescription from the bytes of its resource.
destroy_description
Read a DestroyDescription from the bytes of its resource.
disease
Read a Disease from the bytes of its resource.
disease_description
Read a DiseaseDescription from the bytes of its resource.
environment_description
Read a EnvironmentDescription from the bytes of its resource.
external_list
An ExternalList: an ordered list of resource references, for example Game/Terrain/TerrainList.rsc, which fills the terrain selector of the New Game dialog.
fire_description
Read a FireDescription from the bytes of its resource.
fishing_description
Read a FishingDescription from the bytes of its resource.
floor_description
Read a FloorDescription from the bytes of its resource.
forester_description
Read a ForesterDescription from the bytes of its resource.
fruit_description
FruitDescription: ripening time (× 300 s), the best temperature, its range, the fruit’s raw material.
growth_description
Read a GrowthDescription from the bytes of its resource.
happiness_description
Read a HappinessDescription from the bytes of its resource.
herbalist_description
Read a HerbalistDescription from the bytes of its resource.
herd_description
Read a HerdDescription from the bytes of its resource.
hunt_description
Read a HuntDescription from the bytes of its resource.
immigration_description
Read a ImmigrationDescription from the bytes of its resource.
interact_description
Read a InteractDescription from the bytes of its resource.
interaction_points
Interaction points of one category (0 use, 1 build, 2 create) in point-list order.
livestock_description
Read a LivestockDescription from the bytes of its resource.
map_description
Read a MapDescription from the bytes of its resource.
map_generator
Read a MapGenerator from the bytes of its resource.
market_description
Read a MarketDescription from the bytes of its resource.
model_description
Read a ModelDescription from the bytes of its resource.
natural_resource_description
Read a NaturalResourceDescription from the bytes of its resource.
nomad_description
A NomadDescription: the citizen template nomads become, and the men’s and women’s material instance (put in their model’s material 0).
orchard_description
OrchardDescription (versioned): tree spacing, a tending visit’s ripening and, from version 1, the stock slot.
particle_description
Read a ParticleDescription from the bytes of its resource.
particle_system
Read a ParticleSystem from the bytes of its resource.
pasture_description
A PastureDescription. From version 1, it has the stock slot of the limit of its products (5 by default).
point_list
Read a PointList from the bytes of its resource.
population_description
Read a PopulationDescription from the bytes of its resource.
profession
Read a Profession from the bytes of its resource.
quarry_description
Read a QuarryDescription from the bytes of its resource.
radius_description
RadiusDescription: radius, display reference.
raw_material_description
Read a RawMaterialDescription from the bytes of its resource.
residence_description
Read a ResidenceDescription from the bytes of its resource.
spawn_description
SpawnDescription.
status_icon_description
Read a StatusIconDescription from the bytes of its resource.
storage_description
Read a StorageDescription from the bytes of its resource.
storage_location_description
The mask of a StorageLocationDescription: the kinds of goods a storage place accepts.
terraform_description
Read a TerraformDescription from the bytes of its resource.
terrain_generator
Read a TerrainGenerator from the bytes of its resource.
tombstone_description
TombstoneDescription: a grave lasts (+ RandFloat ×) × 300 s.
toolbar_description
Read a ToolbarDescription from the bytes of its resource.
toolbar_item
Read a ToolbarItem from the bytes of its resource.
tornado_description
TornadoDescription: speed, the ends’ least distance, the reach of a wrecking pass, the time between passes, how far a pass throws its point.
tornado_particle
Read a TornadoParticle from the bytes of its resource.
trade_description
Read a TradeDescription from the bytes of its resource.
ui_description
Read a UiDescription from the bytes of its resource.
value_description
Read a ValueDescription from the bytes of its resource.
work_description
Read a WorkDescription from the bytes of its resource.
workplace_description
Read a WorkPlaceDescription from the bytes of its resource.